aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/super.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2013-08-08 02:16:22 -0400
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-08-26 07:02:12 -0400
commit444c580f7e9ad29927a5d5269d576bd7cdccebb8 (patch)
treece7dd44ceb0a7da467c61f58903a4e151db2af7c /fs/f2fs/super.c
parent6e6b978c32bacd98a93e34af7f4222e76007705f (diff)
f2fs: add flags for inline xattrs
This patch adds basic inode flags for inline xattrs, F2FS_INLINE_XATTR, and add a mount option, inline_xattr, which is enabled when xattr is set. If the mount option is enabled, all the files are marked with the inline_xattrs flag. Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r--fs/f2fs/super.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index d28c4528eff8..70ecf484e7e5 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -47,6 +47,7 @@ enum {
47 Opt_noacl, 47 Opt_noacl,
48 Opt_active_logs, 48 Opt_active_logs,
49 Opt_disable_ext_identify, 49 Opt_disable_ext_identify,
50 Opt_inline_xattr,
50 Opt_err, 51 Opt_err,
51}; 52};
52 53
@@ -59,6 +60,7 @@ static match_table_t f2fs_tokens = {
59 {Opt_noacl, "noacl"}, 60 {Opt_noacl, "noacl"},
60 {Opt_active_logs, "active_logs=%u"}, 61 {Opt_active_logs, "active_logs=%u"},
61 {Opt_disable_ext_identify, "disable_ext_identify"}, 62 {Opt_disable_ext_identify, "disable_ext_identify"},
63 {Opt_inline_xattr, "inline_xattr"},
62 {Opt_err, NULL}, 64 {Opt_err, NULL},
63}; 65};
64 66
@@ -238,11 +240,18 @@ static int parse_options(struct super_block *sb, char *options)
238 case Opt_nouser_xattr: 240 case Opt_nouser_xattr:
239 clear_opt(sbi, XATTR_USER); 241 clear_opt(sbi, XATTR_USER);
240 break; 242 break;
243 case Opt_inline_xattr:
244 set_opt(sbi, INLINE_XATTR);
245 break;
241#else 246#else
242 case Opt_nouser_xattr: 247 case Opt_nouser_xattr:
243 f2fs_msg(sb, KERN_INFO, 248 f2fs_msg(sb, KERN_INFO,
244 "nouser_xattr options not supported"); 249 "nouser_xattr options not supported");
245 break; 250 break;
251 case Opt_inline_xattr:
252 f2fs_msg(sb, KERN_INFO,
253 "inline_xattr options not supported");
254 break;
246#endif 255#endif
247#ifdef CONFIG_F2FS_FS_POSIX_ACL 256#ifdef CONFIG_F2FS_FS_POSIX_ACL
248 case Opt_noacl: 257 case Opt_noacl:
@@ -292,6 +301,9 @@ static struct inode *f2fs_alloc_inode(struct super_block *sb)
292 301
293 set_inode_flag(fi, FI_NEW_INODE); 302 set_inode_flag(fi, FI_NEW_INODE);
294 303
304 if (test_opt(F2FS_SB(sb), INLINE_XATTR))
305 set_inode_flag(fi, FI_INLINE_XATTR);
306
295 return &fi->vfs_inode; 307 return &fi->vfs_inode;
296} 308}
297 309
@@ -444,6 +456,8 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
444 seq_puts(seq, ",user_xattr"); 456 seq_puts(seq, ",user_xattr");
445 else 457 else
446 seq_puts(seq, ",nouser_xattr"); 458 seq_puts(seq, ",nouser_xattr");
459 if (test_opt(sbi, INLINE_XATTR))
460 seq_puts(seq, ",inline_xattr");
447#endif 461#endif
448#ifdef CONFIG_F2FS_FS_POSIX_ACL 462#ifdef CONFIG_F2FS_FS_POSIX_ACL
449 if (test_opt(sbi, POSIX_ACL)) 463 if (test_opt(sbi, POSIX_ACL))