Commit c02745ef authored by Jaegeuk Kim's avatar Jaegeuk Kim

f2fs: pass flags field to setxattr functions

This patch passes the "flags" field to the low level setxattr functions
to use XATTR_REPLACE in the following patches.
Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
parent e1123268
...@@ -240,7 +240,7 @@ static int __f2fs_set_acl(struct inode *inode, int type, ...@@ -240,7 +240,7 @@ static int __f2fs_set_acl(struct inode *inode, int type,
} }
} }
error = f2fs_setxattr(inode, name_index, "", value, size, ipage); error = f2fs_setxattr(inode, name_index, "", value, size, ipage, 0);
kfree(value); kfree(value);
if (!error) if (!error)
......
...@@ -108,7 +108,8 @@ static int f2fs_xattr_generic_set(struct dentry *dentry, const char *name, ...@@ -108,7 +108,8 @@ static int f2fs_xattr_generic_set(struct dentry *dentry, const char *name,
if (strcmp(name, "") == 0) if (strcmp(name, "") == 0)
return -EINVAL; return -EINVAL;
return f2fs_setxattr(dentry->d_inode, type, name, value, size, NULL); return f2fs_setxattr(dentry->d_inode, type, name,
value, size, NULL, flags);
} }
static size_t f2fs_xattr_advise_list(struct dentry *dentry, char *list, static size_t f2fs_xattr_advise_list(struct dentry *dentry, char *list,
...@@ -157,7 +158,7 @@ static int f2fs_xattr_advise_set(struct dentry *dentry, const char *name, ...@@ -157,7 +158,7 @@ static int f2fs_xattr_advise_set(struct dentry *dentry, const char *name,
#ifdef CONFIG_F2FS_FS_SECURITY #ifdef CONFIG_F2FS_FS_SECURITY
static int __f2fs_setxattr(struct inode *inode, int index, static int __f2fs_setxattr(struct inode *inode, int index,
const char *name, const void *value, size_t size, const char *name, const void *value, size_t size,
struct page *ipage); struct page *ipage, int);
static int f2fs_initxattrs(struct inode *inode, const struct xattr *xattr_array, static int f2fs_initxattrs(struct inode *inode, const struct xattr *xattr_array,
void *page) void *page)
...@@ -168,7 +169,7 @@ static int f2fs_initxattrs(struct inode *inode, const struct xattr *xattr_array, ...@@ -168,7 +169,7 @@ static int f2fs_initxattrs(struct inode *inode, const struct xattr *xattr_array,
for (xattr = xattr_array; xattr->name != NULL; xattr++) { for (xattr = xattr_array; xattr->name != NULL; xattr++) {
err = __f2fs_setxattr(inode, F2FS_XATTR_INDEX_SECURITY, err = __f2fs_setxattr(inode, F2FS_XATTR_INDEX_SECURITY,
xattr->name, xattr->value, xattr->name, xattr->value,
xattr->value_len, (struct page *)page); xattr->value_len, (struct page *)page, 0);
if (err < 0) if (err < 0)
break; break;
} }
...@@ -479,7 +480,7 @@ ssize_t f2fs_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size) ...@@ -479,7 +480,7 @@ ssize_t f2fs_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size)
static int __f2fs_setxattr(struct inode *inode, int index, static int __f2fs_setxattr(struct inode *inode, int index,
const char *name, const void *value, size_t size, const char *name, const void *value, size_t size,
struct page *ipage) struct page *ipage, int flags)
{ {
struct f2fs_inode_info *fi = F2FS_I(inode); struct f2fs_inode_info *fi = F2FS_I(inode);
struct f2fs_xattr_entry *here, *last; struct f2fs_xattr_entry *here, *last;
...@@ -586,7 +587,7 @@ static int __f2fs_setxattr(struct inode *inode, int index, ...@@ -586,7 +587,7 @@ static int __f2fs_setxattr(struct inode *inode, int index,
int f2fs_setxattr(struct inode *inode, int index, const char *name, int f2fs_setxattr(struct inode *inode, int index, const char *name,
const void *value, size_t size, const void *value, size_t size,
struct page *ipage) struct page *ipage, int flags)
{ {
struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb); struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
int err; int err;
...@@ -596,7 +597,7 @@ int f2fs_setxattr(struct inode *inode, int index, const char *name, ...@@ -596,7 +597,7 @@ int f2fs_setxattr(struct inode *inode, int index, const char *name,
f2fs_lock_op(sbi); f2fs_lock_op(sbi);
/* protect xattr_ver */ /* protect xattr_ver */
down_write(&F2FS_I(inode)->i_sem); down_write(&F2FS_I(inode)->i_sem);
err = __f2fs_setxattr(inode, index, name, value, size, ipage); err = __f2fs_setxattr(inode, index, name, value, size, ipage, flags);
up_write(&F2FS_I(inode)->i_sem); up_write(&F2FS_I(inode)->i_sem);
f2fs_unlock_op(sbi); f2fs_unlock_op(sbi);
......
...@@ -114,14 +114,14 @@ extern const struct xattr_handler f2fs_xattr_security_handler; ...@@ -114,14 +114,14 @@ extern const struct xattr_handler f2fs_xattr_security_handler;
extern const struct xattr_handler *f2fs_xattr_handlers[]; extern const struct xattr_handler *f2fs_xattr_handlers[];
extern int f2fs_setxattr(struct inode *, int, const char *, extern int f2fs_setxattr(struct inode *, int, const char *,
const void *, size_t, struct page *); const void *, size_t, struct page *, int);
extern int f2fs_getxattr(struct inode *, int, const char *, void *, size_t); extern int f2fs_getxattr(struct inode *, int, const char *, void *, size_t);
extern ssize_t f2fs_listxattr(struct dentry *, char *, size_t); extern ssize_t f2fs_listxattr(struct dentry *, char *, size_t);
#else #else
#define f2fs_xattr_handlers NULL #define f2fs_xattr_handlers NULL
static inline int f2fs_setxattr(struct inode *inode, int index, static inline int f2fs_setxattr(struct inode *inode, int index,
const char *name, const void *value, size_t size) const char *name, const void *value, size_t size, int flags)
{ {
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment