diff options
author | Kirill Tkhai <ktkhai@virtuozzo.com> | 2018-11-09 13:33:17 +0300 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2019-02-13 13:15:13 +0100 |
commit | 4510d86fbbb36872224482bb21836d47cce8be8c (patch) | |
tree | d4340b770fd1f73d14c5391f407b50b00b946f2b /fs/fuse/inode.c | |
parent | ebf84d0c7220c7c9b904c405e61175d2a50cfb39 (diff) |
fuse: Convert fc->attr_version into atomic64_t
This patch makes fc->attr_version of atomic64_t type, so fc->lock won't be
needed to read or modify it anymore.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/inode.c')
-rw-r--r-- | fs/fuse/inode.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index c2d4099429be..86e86fcd6267 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -163,7 +163,7 @@ void fuse_change_attributes_common(struct inode *inode, struct fuse_attr *attr, struct fuse_conn *fc = get_fuse_conn(inode); struct fuse_inode *fi = get_fuse_inode(inode); - fi->attr_version = ++fc->attr_version; + fi->attr_version = atomic64_inc_return(&fc->attr_version); fi->i_time = attr_valid; WRITE_ONCE(fi->inval_mask, 0); @@ -624,7 +624,7 @@ void fuse_conn_init(struct fuse_conn *fc, struct user_namespace *user_ns) fc->blocked = 0; fc->initialized = 0; fc->connected = 1; - fc->attr_version = 1; + atomic64_set(&fc->attr_version, 1); get_random_bytes(&fc->scramble_key, sizeof(fc->scramble_key)); fc->pid_ns = get_pid_ns(task_active_pid_ns(current)); fc->user_ns = get_user_ns(user_ns); |