aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ubifs/file.c4
-rw-r--r--fs/ubifs/xattr.c17
2 files changed, 16 insertions, 5 deletions
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
index 538519ee37d9..4855abcfe256 100644
--- a/fs/ubifs/file.c
+++ b/fs/ubifs/file.c
@@ -1574,6 +1574,10 @@ const struct inode_operations ubifs_symlink_inode_operations = {
1574 .follow_link = ubifs_follow_link, 1574 .follow_link = ubifs_follow_link,
1575 .setattr = ubifs_setattr, 1575 .setattr = ubifs_setattr,
1576 .getattr = ubifs_getattr, 1576 .getattr = ubifs_getattr,
1577 .setxattr = ubifs_setxattr,
1578 .getxattr = ubifs_getxattr,
1579 .listxattr = ubifs_listxattr,
1580 .removexattr = ubifs_removexattr,
1577}; 1581};
1578 1582
1579const struct file_operations ubifs_file_operations = { 1583const struct file_operations ubifs_file_operations = {
diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c
index 5e0a63b1b0d5..c3254a681a78 100644
--- a/fs/ubifs/xattr.c
+++ b/fs/ubifs/xattr.c
@@ -293,18 +293,16 @@ static struct inode *iget_xattr(struct ubifs_info *c, ino_t inum)
293 return ERR_PTR(-EINVAL); 293 return ERR_PTR(-EINVAL);
294} 294}
295 295
296int ubifs_setxattr(struct dentry *dentry, const char *name, 296static int setxattr(struct inode *host, const char *name, const void *value,
297 const void *value, size_t size, int flags) 297 size_t size, int flags)
298{ 298{
299 struct inode *inode, *host = dentry->d_inode; 299 struct inode *inode;
300 struct ubifs_info *c = host->i_sb->s_fs_info; 300 struct ubifs_info *c = host->i_sb->s_fs_info;
301 struct qstr nm = QSTR_INIT(name, strlen(name)); 301 struct qstr nm = QSTR_INIT(name, strlen(name));
302 struct ubifs_dent_node *xent; 302 struct ubifs_dent_node *xent;
303 union ubifs_key key; 303 union ubifs_key key;
304 int err, type; 304 int err, type;
305 305
306 dbg_gen("xattr '%s', host ino %lu ('%pd'), size %zd", name,
307 host->i_ino, dentry, size);
308 ubifs_assert(mutex_is_locked(&host->i_mutex)); 306 ubifs_assert(mutex_is_locked(&host->i_mutex));
309 307
310 if (size > UBIFS_MAX_INO_DATA) 308 if (size > UBIFS_MAX_INO_DATA)
@@ -356,6 +354,15 @@ out_free:
356 return err; 354 return err;
357} 355}
358 356
357int ubifs_setxattr(struct dentry *dentry, const char *name,
358 const void *value, size_t size, int flags)
359{
360 dbg_gen("xattr '%s', host ino %lu ('%pd'), size %zd",
361 name, dentry->d_inode->i_ino, dentry, size);
362
363 return setxattr(dentry->d_inode, name, value, size, flags);
364}
365
359ssize_t ubifs_getxattr(struct dentry *dentry, const char *name, void *buf, 366ssize_t ubifs_getxattr(struct dentry *dentry, const char *name, void *buf,
360 size_t size) 367 size_t size)
361{ 368{