diff options
Diffstat (limited to 'fs/fuse/inode.c')
-rw-r--r-- | fs/fuse/inode.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 1ce67668a8e1..9961d8432ce3 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c | |||
@@ -97,6 +97,7 @@ static struct inode *fuse_alloc_inode(struct super_block *sb) | |||
97 | INIT_LIST_HEAD(&fi->queued_writes); | 97 | INIT_LIST_HEAD(&fi->queued_writes); |
98 | INIT_LIST_HEAD(&fi->writepages); | 98 | INIT_LIST_HEAD(&fi->writepages); |
99 | init_waitqueue_head(&fi->page_waitq); | 99 | init_waitqueue_head(&fi->page_waitq); |
100 | mutex_init(&fi->mutex); | ||
100 | fi->forget = fuse_alloc_forget(); | 101 | fi->forget = fuse_alloc_forget(); |
101 | if (!fi->forget) { | 102 | if (!fi->forget) { |
102 | kmem_cache_free(fuse_inode_cachep, inode); | 103 | kmem_cache_free(fuse_inode_cachep, inode); |
@@ -117,6 +118,7 @@ static void fuse_destroy_inode(struct inode *inode) | |||
117 | struct fuse_inode *fi = get_fuse_inode(inode); | 118 | struct fuse_inode *fi = get_fuse_inode(inode); |
118 | BUG_ON(!list_empty(&fi->write_files)); | 119 | BUG_ON(!list_empty(&fi->write_files)); |
119 | BUG_ON(!list_empty(&fi->queued_writes)); | 120 | BUG_ON(!list_empty(&fi->queued_writes)); |
121 | mutex_destroy(&fi->mutex); | ||
120 | kfree(fi->forget); | 122 | kfree(fi->forget); |
121 | call_rcu(&inode->i_rcu, fuse_i_callback); | 123 | call_rcu(&inode->i_rcu, fuse_i_callback); |
122 | } | 124 | } |
@@ -351,6 +353,18 @@ int fuse_reverse_inval_inode(struct super_block *sb, u64 nodeid, | |||
351 | return 0; | 353 | return 0; |
352 | } | 354 | } |
353 | 355 | ||
356 | void fuse_lock_inode(struct inode *inode) | ||
357 | { | ||
358 | if (!get_fuse_conn(inode)->parallel_dirops) | ||
359 | mutex_lock(&get_fuse_inode(inode)->mutex); | ||
360 | } | ||
361 | |||
362 | void fuse_unlock_inode(struct inode *inode) | ||
363 | { | ||
364 | if (!get_fuse_conn(inode)->parallel_dirops) | ||
365 | mutex_unlock(&get_fuse_inode(inode)->mutex); | ||
366 | } | ||
367 | |||
354 | static void fuse_umount_begin(struct super_block *sb) | 368 | static void fuse_umount_begin(struct super_block *sb) |
355 | { | 369 | { |
356 | fuse_abort_conn(get_fuse_conn_super(sb)); | 370 | fuse_abort_conn(get_fuse_conn_super(sb)); |
@@ -898,6 +912,8 @@ static void process_init_reply(struct fuse_conn *fc, struct fuse_req *req) | |||
898 | fc->async_dio = 1; | 912 | fc->async_dio = 1; |
899 | if (arg->flags & FUSE_WRITEBACK_CACHE) | 913 | if (arg->flags & FUSE_WRITEBACK_CACHE) |
900 | fc->writeback_cache = 1; | 914 | fc->writeback_cache = 1; |
915 | if (arg->flags & FUSE_PARALLEL_DIROPS) | ||
916 | fc->parallel_dirops = 1; | ||
901 | if (arg->time_gran && arg->time_gran <= 1000000000) | 917 | if (arg->time_gran && arg->time_gran <= 1000000000) |
902 | fc->sb->s_time_gran = arg->time_gran; | 918 | fc->sb->s_time_gran = arg->time_gran; |
903 | } else { | 919 | } else { |
@@ -928,7 +944,8 @@ static void fuse_send_init(struct fuse_conn *fc, struct fuse_req *req) | |||
928 | FUSE_SPLICE_WRITE | FUSE_SPLICE_MOVE | FUSE_SPLICE_READ | | 944 | FUSE_SPLICE_WRITE | FUSE_SPLICE_MOVE | FUSE_SPLICE_READ | |
929 | FUSE_FLOCK_LOCKS | FUSE_IOCTL_DIR | FUSE_AUTO_INVAL_DATA | | 945 | FUSE_FLOCK_LOCKS | FUSE_IOCTL_DIR | FUSE_AUTO_INVAL_DATA | |
930 | FUSE_DO_READDIRPLUS | FUSE_READDIRPLUS_AUTO | FUSE_ASYNC_DIO | | 946 | FUSE_DO_READDIRPLUS | FUSE_READDIRPLUS_AUTO | FUSE_ASYNC_DIO | |
931 | FUSE_WRITEBACK_CACHE | FUSE_NO_OPEN_SUPPORT; | 947 | FUSE_WRITEBACK_CACHE | FUSE_NO_OPEN_SUPPORT | |
948 | FUSE_PARALLEL_DIROPS; | ||
932 | req->in.h.opcode = FUSE_INIT; | 949 | req->in.h.opcode = FUSE_INIT; |
933 | req->in.numargs = 1; | 950 | req->in.numargs = 1; |
934 | req->in.args[0].size = sizeof(*arg); | 951 | req->in.args[0].size = sizeof(*arg); |