Commit 7d2e0a09 authored by Miklos Szeredi's avatar Miklos Szeredi

fuse: simplify unique ctr

Since it's a 64bit counter, it's never gonna wrap around.  Remove code
dealing with that possibility.
Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
Reviewed-by: default avatarAshish Samant <ashish.samant@oracle.com>
parent 41f98274
...@@ -319,12 +319,7 @@ static unsigned len_args(unsigned numargs, struct fuse_arg *args) ...@@ -319,12 +319,7 @@ static unsigned len_args(unsigned numargs, struct fuse_arg *args)
static u64 fuse_get_unique(struct fuse_conn *fc) static u64 fuse_get_unique(struct fuse_conn *fc)
{ {
fc->reqctr++; return ++fc->reqctr;
/* zero is special */
if (fc->reqctr == 0)
fc->reqctr = 1;
return fc->reqctr;
} }
static void queue_request(struct fuse_conn *fc, struct fuse_req *req) static void queue_request(struct fuse_conn *fc, struct fuse_req *req)
......
...@@ -588,7 +588,6 @@ void fuse_conn_init(struct fuse_conn *fc) ...@@ -588,7 +588,6 @@ void fuse_conn_init(struct fuse_conn *fc)
fc->congestion_threshold = FUSE_DEFAULT_CONGESTION_THRESHOLD; fc->congestion_threshold = FUSE_DEFAULT_CONGESTION_THRESHOLD;
fc->khctr = 0; fc->khctr = 0;
fc->polled_files = RB_ROOT; fc->polled_files = RB_ROOT;
fc->reqctr = 0;
fc->blocked = 0; fc->blocked = 0;
fc->initialized = 0; fc->initialized = 0;
fc->attr_version = 1; fc->attr_version = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment