]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
UBIFS: Add xattr support for symlinks
authorSubodh Nijsure <snijsure@grid-net.com>
Fri, 31 Oct 2014 18:50:29 +0000 (13:50 -0500)
committerRichard Weinberger <richard@nod.at>
Wed, 28 Jan 2015 15:08:46 +0000 (16:08 +0100)
Artem: rename the __ubifs_setxattr() functions to just 'setxattr()'.

Signed-off-by: Subodh Nijsure <snijsure@grid-net.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Ben Shelton <ben.shelton@ni.com>
Acked-by: Terry Wilcox <terry.wilcox@ni.com>
Acked-by: Gratian Crisan <gratian.crisan@ni.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
fs/ubifs/file.c
fs/ubifs/xattr.c

index 538519ee37d939536806fe62ecb55ba8bc9e04b3..4855abcfe25677673c12d911bc07f7e95baad840 100644 (file)
@@ -1574,6 +1574,10 @@ const struct inode_operations ubifs_symlink_inode_operations = {
        .follow_link = ubifs_follow_link,
        .setattr     = ubifs_setattr,
        .getattr     = ubifs_getattr,
+       .setxattr    = ubifs_setxattr,
+       .getxattr    = ubifs_getxattr,
+       .listxattr   = ubifs_listxattr,
+       .removexattr = ubifs_removexattr,
 };
 
 const struct file_operations ubifs_file_operations = {
index 5e0a63b1b0d54a24d407c08cf1f3fef25008e0f9..c3254a681a7869da0d52008236420400f7863ef4 100644 (file)
@@ -293,18 +293,16 @@ static struct inode *iget_xattr(struct ubifs_info *c, ino_t inum)
        return ERR_PTR(-EINVAL);
 }
 
-int ubifs_setxattr(struct dentry *dentry, const char *name,
-                  const void *value, size_t size, int flags)
+static int setxattr(struct inode *host, const char *name, const void *value,
+                   size_t size, int flags)
 {
-       struct inode *inode, *host = dentry->d_inode;
+       struct inode *inode;
        struct ubifs_info *c = host->i_sb->s_fs_info;
        struct qstr nm = QSTR_INIT(name, strlen(name));
        struct ubifs_dent_node *xent;
        union ubifs_key key;
        int err, type;
 
-       dbg_gen("xattr '%s', host ino %lu ('%pd'), size %zd", name,
-               host->i_ino, dentry, size);
        ubifs_assert(mutex_is_locked(&host->i_mutex));
 
        if (size > UBIFS_MAX_INO_DATA)
@@ -356,6 +354,15 @@ out_free:
        return err;
 }
 
+int ubifs_setxattr(struct dentry *dentry, const char *name,
+                  const void *value, size_t size, int flags)
+{
+       dbg_gen("xattr '%s', host ino %lu ('%pd'), size %zd",
+               name, dentry->d_inode->i_ino, dentry, size);
+
+       return setxattr(dentry->d_inode, name, value, size, flags);
+}
+
 ssize_t ubifs_getxattr(struct dentry *dentry, const char *name, void *buf,
                       size_t size)
 {