1 From: Tiger Yang <tiger.yang@oracle.com>
2 Date: Fri, 14 Nov 2008 11:17:52 +0800
3 Subject: ocfs2: add mount option and Kconfig option for acl
6 This patch adds the Kconfig option "CONFIG_OCFS2_FS_POSIX_ACL"
7 and mount options "acl" to enable acls in Ocfs2.
9 Signed-off-by: Tiger Yang <tiger.yang@oracle.com>
10 Signed-off-by: Mark Fasheh <mfasheh@suse.com>
12 fs/ocfs2/super.c | 33 +++++++++++++++++++++++++++++++++
13 1 files changed, 33 insertions(+), 0 deletions(-)
15 diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
16 index 304b63a..9e7accc 100644
17 --- a/fs/ocfs2/super.c
18 +++ b/fs/ocfs2/super.c
19 @@ -158,6 +158,8 @@ enum {
28 @@ -180,6 +182,8 @@ static const match_table_t tokens = {
29 {Opt_user_xattr, "user_xattr"},
30 {Opt_nouser_xattr, "nouser_xattr"},
31 {Opt_inode64, "inode64"},
33 + {Opt_noacl, "noacl"},
37 @@ -466,6 +470,8 @@ unlock_osb:
39 /* Only save off the new mount options in case of a successful
41 + if (!(osb->s_feature_incompat & OCFS2_FEATURE_INCOMPAT_XATTR))
42 + parsed_options.mount_opt &= ~OCFS2_MOUNT_POSIX_ACL;
43 osb->s_mount_opt = parsed_options.mount_opt;
44 osb->s_atime_quantum = parsed_options.atime_quantum;
45 osb->preferred_slot = parsed_options.slot;
46 @@ -651,6 +657,10 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
51 + if (!(osb->s_feature_incompat & OCFS2_FEATURE_INCOMPAT_XATTR))
52 + parsed_options.mount_opt &= ~OCFS2_MOUNT_POSIX_ACL;
54 osb->s_mount_opt = parsed_options.mount_opt;
55 osb->s_atime_quantum = parsed_options.atime_quantum;
56 osb->preferred_slot = parsed_options.slot;
57 @@ -664,6 +674,9 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
59 sb->s_magic = OCFS2_SUPER_MAGIC;
61 + sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
62 + ((osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0);
64 /* Hard readonly mode only if: bdev_read_only, MS_RDONLY,
66 if (bdev_read_only(sb->s_bdev)) {
67 @@ -945,6 +958,19 @@ static int ocfs2_parse_options(struct super_block *sb,
69 mopt->mount_opt |= OCFS2_MOUNT_INODE64;
71 +#ifdef CONFIG_OCFS2_FS_POSIX_ACL
73 + mopt->mount_opt |= OCFS2_MOUNT_POSIX_ACL;
76 + mopt->mount_opt &= ~OCFS2_MOUNT_POSIX_ACL;
81 + printk(KERN_INFO "ocfs2 (no)acl options not supported\n");
86 "Unrecognized mount option \"%s\" "
87 @@ -1017,6 +1043,13 @@ static int ocfs2_show_options(struct seq_file *s, struct vfsmount *mnt)
88 if (opts & OCFS2_MOUNT_INODE64)
89 seq_printf(s, ",inode64");
91 +#ifdef CONFIG_OCFS2_FS_POSIX_ACL
92 + if (opts & OCFS2_MOUNT_POSIX_ACL)
93 + seq_printf(s, ",acl");
95 + seq_printf(s, ",noacl");