diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2014-04-22 23:23:14 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2014-05-06 21:21:56 -0400 |
commit | c02745ef684f9a6f98f30388ed048ee460db5483 (patch) | |
tree | 47ee64820f98b6b6dd679565217b7258a4a31ec5 /fs | |
parent | e112326805a50ee2016faf0971660122471f7c04 (diff) |
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: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/f2fs/acl.c | 2 | ||||
-rw-r--r-- | fs/f2fs/xattr.c | 13 | ||||
-rw-r--r-- | fs/f2fs/xattr.h | 4 |
3 files changed, 10 insertions, 9 deletions
diff --git a/fs/f2fs/acl.c b/fs/f2fs/acl.c index e93e4ec7d165..dbe2141d10ad 100644 --- a/fs/f2fs/acl.c +++ b/fs/f2fs/acl.c | |||
@@ -240,7 +240,7 @@ static int __f2fs_set_acl(struct inode *inode, int type, | |||
240 | } | 240 | } |
241 | } | 241 | } |
242 | 242 | ||
243 | error = f2fs_setxattr(inode, name_index, "", value, size, ipage); | 243 | error = f2fs_setxattr(inode, name_index, "", value, size, ipage, 0); |
244 | 244 | ||
245 | kfree(value); | 245 | kfree(value); |
246 | if (!error) | 246 | if (!error) |
diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c index 1de057d9e7a7..bbe9c2badf5d 100644 --- a/fs/f2fs/xattr.c +++ b/fs/f2fs/xattr.c | |||
@@ -108,7 +108,8 @@ static int f2fs_xattr_generic_set(struct dentry *dentry, const char *name, | |||
108 | if (strcmp(name, "") == 0) | 108 | if (strcmp(name, "") == 0) |
109 | return -EINVAL; | 109 | return -EINVAL; |
110 | 110 | ||
111 | return f2fs_setxattr(dentry->d_inode, type, name, value, size, NULL); | 111 | return f2fs_setxattr(dentry->d_inode, type, name, |
112 | value, size, NULL, flags); | ||
112 | } | 113 | } |
113 | 114 | ||
114 | static size_t f2fs_xattr_advise_list(struct dentry *dentry, char *list, | 115 | 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 | #ifdef CONFIG_F2FS_FS_SECURITY | 158 | #ifdef CONFIG_F2FS_FS_SECURITY |
158 | static int __f2fs_setxattr(struct inode *inode, int index, | 159 | static int __f2fs_setxattr(struct inode *inode, int index, |
159 | const char *name, const void *value, size_t size, | 160 | const char *name, const void *value, size_t size, |
160 | struct page *ipage); | 161 | struct page *ipage, int); |
161 | 162 | ||
162 | static int f2fs_initxattrs(struct inode *inode, const struct xattr *xattr_array, | 163 | static int f2fs_initxattrs(struct inode *inode, const struct xattr *xattr_array, |
163 | void *page) | 164 | void *page) |
@@ -168,7 +169,7 @@ static int f2fs_initxattrs(struct inode *inode, const struct xattr *xattr_array, | |||
168 | for (xattr = xattr_array; xattr->name != NULL; xattr++) { | 169 | for (xattr = xattr_array; xattr->name != NULL; xattr++) { |
169 | err = __f2fs_setxattr(inode, F2FS_XATTR_INDEX_SECURITY, | 170 | err = __f2fs_setxattr(inode, F2FS_XATTR_INDEX_SECURITY, |
170 | xattr->name, xattr->value, | 171 | xattr->name, xattr->value, |
171 | xattr->value_len, (struct page *)page); | 172 | xattr->value_len, (struct page *)page, 0); |
172 | if (err < 0) | 173 | if (err < 0) |
173 | break; | 174 | break; |
174 | } | 175 | } |
@@ -479,7 +480,7 @@ cleanup: | |||
479 | 480 | ||
480 | static int __f2fs_setxattr(struct inode *inode, int index, | 481 | static int __f2fs_setxattr(struct inode *inode, int index, |
481 | const char *name, const void *value, size_t size, | 482 | const char *name, const void *value, size_t size, |
482 | struct page *ipage) | 483 | struct page *ipage, int flags) |
483 | { | 484 | { |
484 | struct f2fs_inode_info *fi = F2FS_I(inode); | 485 | struct f2fs_inode_info *fi = F2FS_I(inode); |
485 | struct f2fs_xattr_entry *here, *last; | 486 | struct f2fs_xattr_entry *here, *last; |
@@ -586,7 +587,7 @@ exit: | |||
586 | 587 | ||
587 | int f2fs_setxattr(struct inode *inode, int index, const char *name, | 588 | int f2fs_setxattr(struct inode *inode, int index, const char *name, |
588 | const void *value, size_t size, | 589 | const void *value, size_t size, |
589 | struct page *ipage) | 590 | struct page *ipage, int flags) |
590 | { | 591 | { |
591 | struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb); | 592 | struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb); |
592 | int err; | 593 | int err; |
@@ -596,7 +597,7 @@ int f2fs_setxattr(struct inode *inode, int index, const char *name, | |||
596 | f2fs_lock_op(sbi); | 597 | f2fs_lock_op(sbi); |
597 | /* protect xattr_ver */ | 598 | /* protect xattr_ver */ |
598 | down_write(&F2FS_I(inode)->i_sem); | 599 | down_write(&F2FS_I(inode)->i_sem); |
599 | err = __f2fs_setxattr(inode, index, name, value, size, ipage); | 600 | err = __f2fs_setxattr(inode, index, name, value, size, ipage, flags); |
600 | up_write(&F2FS_I(inode)->i_sem); | 601 | up_write(&F2FS_I(inode)->i_sem); |
601 | f2fs_unlock_op(sbi); | 602 | f2fs_unlock_op(sbi); |
602 | 603 | ||
diff --git a/fs/f2fs/xattr.h b/fs/f2fs/xattr.h index 79bc2bb32aeb..34ab7dbcf5e3 100644 --- a/fs/f2fs/xattr.h +++ b/fs/f2fs/xattr.h | |||
@@ -114,14 +114,14 @@ extern const struct xattr_handler f2fs_xattr_security_handler; | |||
114 | extern const struct xattr_handler *f2fs_xattr_handlers[]; | 114 | extern const struct xattr_handler *f2fs_xattr_handlers[]; |
115 | 115 | ||
116 | extern int f2fs_setxattr(struct inode *, int, const char *, | 116 | extern int f2fs_setxattr(struct inode *, int, const char *, |
117 | const void *, size_t, struct page *); | 117 | const void *, size_t, struct page *, int); |
118 | extern int f2fs_getxattr(struct inode *, int, const char *, void *, size_t); | 118 | extern int f2fs_getxattr(struct inode *, int, const char *, void *, size_t); |
119 | extern ssize_t f2fs_listxattr(struct dentry *, char *, size_t); | 119 | extern ssize_t f2fs_listxattr(struct dentry *, char *, size_t); |
120 | #else | 120 | #else |
121 | 121 | ||
122 | #define f2fs_xattr_handlers NULL | 122 | #define f2fs_xattr_handlers NULL |
123 | static inline int f2fs_setxattr(struct inode *inode, int index, | 123 | static inline int f2fs_setxattr(struct inode *inode, int index, |
124 | const char *name, const void *value, size_t size) | 124 | const char *name, const void *value, size_t size, int flags) |
125 | { | 125 | { |
126 | return -EOPNOTSUPP; | 126 | return -EOPNOTSUPP; |
127 | } | 127 | } |