fuse: simplify unique ctr
authorMiklos Szeredi <mszeredi@suse.cz>
Wed, 1 Jul 2015 14:26:00 +0000 (16:26 +0200)
committerMiklos Szeredi <mszeredi@suse.cz>
Wed, 1 Jul 2015 14:26:00 +0000 (16:26 +0200)
Since it's a 64bit counter, it's never gonna wrap around.  Remove code
dealing with that possibility.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Reviewed-by: Ashish Samant <ashish.samant@oracle.com>
fs/fuse/dev.c
fs/fuse/inode.c

index 6cb0b0bc9029835c48d4b3513b9edb696e4c47d8..2014cee76036b51a751110ce32c995d150978857 100644 (file)
@@ -319,12 +319,7 @@ static unsigned len_args(unsigned numargs, struct fuse_arg *args)
 
 static u64 fuse_get_unique(struct fuse_conn *fc)
 {
-       fc->reqctr++;
-       /* zero is special */
-       if (fc->reqctr == 0)
-               fc->reqctr = 1;
-
-       return fc->reqctr;
+       return ++fc->reqctr;
 }
 
 static void queue_request(struct fuse_conn *fc, struct fuse_req *req)
index f7c9b7225ec51a232602e12a65107225f9c398b2..2f902b8edcf22a880b67378f9a5513fcda32d7fb 100644 (file)
@@ -588,7 +588,6 @@ void fuse_conn_init(struct fuse_conn *fc)
        fc->congestion_threshold = FUSE_DEFAULT_CONGESTION_THRESHOLD;
        fc->khctr = 0;
        fc->polled_files = RB_ROOT;
-       fc->reqctr = 0;
        fc->blocked = 0;
        fc->initialized = 0;
        fc->attr_version = 1;