X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=fs%2Ffuse%2Ffuse_i.h;h=319596df5dc602ab529cc14a09c02597fd7fd0f0;hb=75b96f0ec5faf730128c32187e3e28441c27a094;hp=3d18556a01ada6881a40829b39b22444532e65fe;hpb=996fe06160998a38ff07189feb3ec8ab8f68fd4e;p=platform%2Fkernel%2Flinux-rpi.git diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 3d18556..319596d 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -482,6 +482,7 @@ struct fuse_dev { struct fuse_fs_context { int fd; + struct file *file; unsigned int rootmode; kuid_t user_id; kgid_t group_id; @@ -508,6 +509,13 @@ struct fuse_fs_context { void **fudptr; }; +struct fuse_sync_bucket { + /* count is a possible scalability bottleneck */ + atomic_t count; + wait_queue_head_t waitq; + struct rcu_head rcu; +}; + /** * A Fuse connection. * @@ -800,6 +808,9 @@ struct fuse_conn { /** List of filesystems using this connection */ struct list_head mounts; + + /* New writepages go into this bucket */ + struct fuse_sync_bucket __rcu *curr_bucket; }; /* @@ -903,6 +914,15 @@ static inline void fuse_page_descs_length_init(struct fuse_page_desc *descs, descs[i].length = PAGE_SIZE - descs[i].offset; } +static inline void fuse_sync_bucket_dec(struct fuse_sync_bucket *bucket) +{ + /* Need RCU protection to prevent use after free after the decrement */ + rcu_read_lock(); + if (atomic_dec_and_test(&bucket->count)) + wake_up(&bucket->waitq); + rcu_read_unlock(); +} + /** Device operations */ extern const struct file_operations fuse_dev_operations;