Skip to content

Commit

Permalink
UBIFS: Add xattr support for symlinks
Browse files Browse the repository at this point in the history
Artem: rename the __ubifs_setxattr() functions to just 'setxattr()'.

Signed-off-by: Subodh Nijsure <[email protected]>
Signed-off-by: Marc Kleine-Budde <[email protected]>
Signed-off-by: Ben Shelton <[email protected]>
Acked-by: Terry Wilcox <[email protected]>
Acked-by: Gratian Crisan <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
  • Loading branch information
Subodh Nijsure authored and richardweinberger committed Jan 28, 2015
1 parent ff1f48e commit 895d9db
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
4 changes: 4 additions & 0 deletions fs/ubifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
17 changes: 12 additions & 5 deletions fs/ubifs/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -356,6 +354,15 @@ int ubifs_setxattr(struct dentry *dentry, const char *name,
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)
{
Expand Down

0 comments on commit 895d9db

Please sign in to comment.