Skip to content

Commit

Permalink
fuse: simplify unique ctr
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Miklos Szeredi committed Jul 1, 2015
1 parent 41f9827 commit 7d2e0a0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
7 changes: 1 addition & 6 deletions fs/fuse/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion fs/fuse/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7d2e0a0

Please sign in to comment.