aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse/inode.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2009-06-30 14:12:23 -0400
committerMiklos Szeredi <mszeredi@suse.cz>2009-06-30 14:12:23 -0400
commite0a43ddcc08c34dbd666d93600fd23914505f4aa (patch)
tree103449845b1ffaf8f32ed98a1a543276227ec087 /fs/fuse/inode.c
parent201fa69a2849536ef2912e8e971ec0b01c04eff4 (diff)
fuse: allow umask processing in userspace
This patch lets filesystems handle masking the file mode on creation. This is needed if filesystem is using ACLs. - The CREATE, MKDIR and MKNOD requests are extended with a "umask" parameter. - A new FUSE_DONT_MASK flag is added to the INIT request/reply. With this the filesystem may request that the create mode is not masked. CC: Jean-Pierre André <jean-pierre.andre@wanadoo.fr> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Diffstat (limited to 'fs/fuse/inode.c')
-rw-r--r--fs/fuse/inode.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index d8673ccf90b7..6cc501bd0187 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -725,6 +725,8 @@ static void process_init_reply(struct fuse_conn *fc, struct fuse_req *req)
725 } 725 }
726 if (arg->flags & FUSE_BIG_WRITES) 726 if (arg->flags & FUSE_BIG_WRITES)
727 fc->big_writes = 1; 727 fc->big_writes = 1;
728 if (arg->flags & FUSE_DONT_MASK)
729 fc->dont_mask = 1;
728 } else { 730 } else {
729 ra_pages = fc->max_read / PAGE_CACHE_SIZE; 731 ra_pages = fc->max_read / PAGE_CACHE_SIZE;
730 fc->no_lock = 1; 732 fc->no_lock = 1;
@@ -748,7 +750,7 @@ static void fuse_send_init(struct fuse_conn *fc, struct fuse_req *req)
748 arg->minor = FUSE_KERNEL_MINOR_VERSION; 750 arg->minor = FUSE_KERNEL_MINOR_VERSION;
749 arg->max_readahead = fc->bdi.ra_pages * PAGE_CACHE_SIZE; 751 arg->max_readahead = fc->bdi.ra_pages * PAGE_CACHE_SIZE;
750 arg->flags |= FUSE_ASYNC_READ | FUSE_POSIX_LOCKS | FUSE_ATOMIC_O_TRUNC | 752 arg->flags |= FUSE_ASYNC_READ | FUSE_POSIX_LOCKS | FUSE_ATOMIC_O_TRUNC |
751 FUSE_EXPORT_SUPPORT | FUSE_BIG_WRITES; 753 FUSE_EXPORT_SUPPORT | FUSE_BIG_WRITES | FUSE_DONT_MASK;
752 req->in.h.opcode = FUSE_INIT; 754 req->in.h.opcode = FUSE_INIT;
753 req->in.numargs = 1; 755 req->in.numargs = 1;
754 req->in.args[0].size = sizeof(*arg); 756 req->in.args[0].size = sizeof(*arg);
@@ -864,6 +866,11 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
864 if (err) 866 if (err)
865 goto err_put_conn; 867 goto err_put_conn;
866 868
869 /* Handle umasking inside the fuse code */
870 if (sb->s_flags & MS_POSIXACL)
871 fc->dont_mask = 1;
872 sb->s_flags |= MS_POSIXACL;
873
867 fc->release = fuse_free_conn; 874 fc->release = fuse_free_conn;
868 fc->flags = d.flags; 875 fc->flags = d.flags;
869 fc->user_id = d.user_id; 876 fc->user_id = d.user_id;