Commit 75126f55 authored by Miklos Szeredi's avatar Miklos Szeredi

fuse: use atomic64_t for khctr

...to get rid of one more fc->lock use.
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent eb98e3bd
...@@ -64,9 +64,7 @@ struct fuse_file *fuse_file_alloc(struct fuse_conn *fc) ...@@ -64,9 +64,7 @@ struct fuse_file *fuse_file_alloc(struct fuse_conn *fc)
RB_CLEAR_NODE(&ff->polled_node); RB_CLEAR_NODE(&ff->polled_node);
init_waitqueue_head(&ff->poll_wait); init_waitqueue_head(&ff->poll_wait);
spin_lock(&fc->lock); ff->kh = atomic64_inc_return(&fc->khctr);
ff->kh = ++fc->khctr;
spin_unlock(&fc->lock);
return ff; return ff;
} }
......
...@@ -544,7 +544,7 @@ struct fuse_conn { ...@@ -544,7 +544,7 @@ struct fuse_conn {
struct fuse_iqueue iq; struct fuse_iqueue iq;
/** The next unique kernel file handle */ /** The next unique kernel file handle */
u64 khctr; atomic64_t khctr;
/** rbtree of fuse_files waiting for poll events indexed by ph */ /** rbtree of fuse_files waiting for poll events indexed by ph */
struct rb_root polled_files; struct rb_root polled_files;
......
...@@ -622,7 +622,7 @@ void fuse_conn_init(struct fuse_conn *fc, struct user_namespace *user_ns) ...@@ -622,7 +622,7 @@ void fuse_conn_init(struct fuse_conn *fc, struct user_namespace *user_ns)
atomic_set(&fc->num_waiting, 0); atomic_set(&fc->num_waiting, 0);
fc->max_background = FUSE_DEFAULT_MAX_BACKGROUND; fc->max_background = FUSE_DEFAULT_MAX_BACKGROUND;
fc->congestion_threshold = FUSE_DEFAULT_CONGESTION_THRESHOLD; fc->congestion_threshold = FUSE_DEFAULT_CONGESTION_THRESHOLD;
fc->khctr = 0; atomic64_set(&fc->khctr, 0);
fc->polled_files = RB_ROOT; fc->polled_files = RB_ROOT;
fc->blocked = 0; fc->blocked = 0;
fc->initialized = 0; fc->initialized = 0;
......
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