xattr.c (712cba5d87a6c0e980ee5fad45734e189c4d7151) xattr.c (7c45729a4d6d1c90879e6c5c2df325c2f6db7191)
1/*
2 * fs/f2fs/xattr.c
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com/
6 *
7 * Portions of this code from linux/fs/ext2/xattr.c
8 *

--- 92 unchanged lines hidden (view full) ---

101 size_t size, int flags)
102{
103 if (!inode_owner_or_capable(inode))
104 return -EPERM;
105 if (value == NULL)
106 return -EINVAL;
107
108 F2FS_I(inode)->i_advise |= *(char *)value;
1/*
2 * fs/f2fs/xattr.c
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com/
6 *
7 * Portions of this code from linux/fs/ext2/xattr.c
8 *

--- 92 unchanged lines hidden (view full) ---

101 size_t size, int flags)
102{
103 if (!inode_owner_or_capable(inode))
104 return -EPERM;
105 if (value == NULL)
106 return -EINVAL;
107
108 F2FS_I(inode)->i_advise |= *(char *)value;
109 f2fs_mark_inode_dirty_sync(inode);
109 f2fs_mark_inode_dirty_sync(inode, true);
110 return 0;
111}
112
113#ifdef CONFIG_F2FS_FS_SECURITY
114static int f2fs_initxattrs(struct inode *inode, const struct xattr *xattr_array,
115 void *page)
116{
117 const struct xattr *xattr;

--- 431 unchanged lines hidden (view full) ---

549 if (is_inode_flag_set(inode, FI_ACL_MODE)) {
550 inode->i_mode = F2FS_I(inode)->i_acl_mode;
551 inode->i_ctime = current_time(inode);
552 clear_inode_flag(inode, FI_ACL_MODE);
553 }
554 if (index == F2FS_XATTR_INDEX_ENCRYPTION &&
555 !strcmp(name, F2FS_XATTR_NAME_ENCRYPTION_CONTEXT))
556 f2fs_set_encrypted_inode(inode);
110 return 0;
111}
112
113#ifdef CONFIG_F2FS_FS_SECURITY
114static int f2fs_initxattrs(struct inode *inode, const struct xattr *xattr_array,
115 void *page)
116{
117 const struct xattr *xattr;

--- 431 unchanged lines hidden (view full) ---

549 if (is_inode_flag_set(inode, FI_ACL_MODE)) {
550 inode->i_mode = F2FS_I(inode)->i_acl_mode;
551 inode->i_ctime = current_time(inode);
552 clear_inode_flag(inode, FI_ACL_MODE);
553 }
554 if (index == F2FS_XATTR_INDEX_ENCRYPTION &&
555 !strcmp(name, F2FS_XATTR_NAME_ENCRYPTION_CONTEXT))
556 f2fs_set_encrypted_inode(inode);
557 f2fs_mark_inode_dirty_sync(inode);
557 f2fs_mark_inode_dirty_sync(inode, true);
558 if (!error && S_ISDIR(inode->i_mode))
559 set_sbi_flag(F2FS_I_SB(inode), SBI_NEED_CP);
560exit:
561 kzfree(base_addr);
562 return error;
563}
564
565int f2fs_setxattr(struct inode *inode, int index, const char *name,

--- 22 unchanged lines hidden ---
558 if (!error && S_ISDIR(inode->i_mode))
559 set_sbi_flag(F2FS_I_SB(inode), SBI_NEED_CP);
560exit:
561 kzfree(base_addr);
562 return error;
563}
564
565int f2fs_setxattr(struct inode *inode, int index, const char *name,

--- 22 unchanged lines hidden ---