aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfsplus
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-05-27 10:19:30 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2016-05-27 15:39:43 -0400
commit5930122683dff58f0846b0f0405b4bd598a3ba6a (patch)
treee7823a7eefaafb7b6ddc61a7ccc1a1892998310f /fs/hfsplus
parent002354112f1e3cc7400ef48b853aefb90e801588 (diff)
switch xattr_handler->set() to passing dentry and inode separately
preparation for similar switch in ->setxattr() (see the next commit for rationale). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/hfsplus')
-rw-r--r--fs/hfsplus/xattr.c12
-rw-r--r--fs/hfsplus/xattr.h2
-rw-r--r--fs/hfsplus/xattr_security.c7
-rw-r--r--fs/hfsplus/xattr_trusted.c7
-rw-r--r--fs/hfsplus/xattr_user.c7
5 files changed, 19 insertions, 16 deletions
diff --git a/fs/hfsplus/xattr.c b/fs/hfsplus/xattr.c
index 4f118d282a7a..d37bb88dc746 100644
--- a/fs/hfsplus/xattr.c
+++ b/fs/hfsplus/xattr.c
@@ -424,7 +424,7 @@ static int copy_name(char *buffer, const char *xattr_name, int name_len)
424 return len; 424 return len;
425} 425}
426 426
427int hfsplus_setxattr(struct dentry *dentry, const char *name, 427int hfsplus_setxattr(struct inode *inode, const char *name,
428 const void *value, size_t size, int flags, 428 const void *value, size_t size, int flags,
429 const char *prefix, size_t prefixlen) 429 const char *prefix, size_t prefixlen)
430{ 430{
@@ -437,8 +437,7 @@ int hfsplus_setxattr(struct dentry *dentry, const char *name,
437 return -ENOMEM; 437 return -ENOMEM;
438 strcpy(xattr_name, prefix); 438 strcpy(xattr_name, prefix);
439 strcpy(xattr_name + prefixlen, name); 439 strcpy(xattr_name + prefixlen, name);
440 res = __hfsplus_setxattr(d_inode(dentry), xattr_name, value, size, 440 res = __hfsplus_setxattr(inode, xattr_name, value, size, flags);
441 flags);
442 kfree(xattr_name); 441 kfree(xattr_name);
443 return res; 442 return res;
444} 443}
@@ -864,8 +863,9 @@ static int hfsplus_osx_getxattr(const struct xattr_handler *handler,
864} 863}
865 864
866static int hfsplus_osx_setxattr(const struct xattr_handler *handler, 865static int hfsplus_osx_setxattr(const struct xattr_handler *handler,
867 struct dentry *dentry, const char *name, 866 struct dentry *unused, struct inode *inode,
868 const void *buffer, size_t size, int flags) 867 const char *name, const void *buffer,
868 size_t size, int flags)
869{ 869{
870 /* 870 /*
871 * Don't allow setting properly prefixed attributes 871 * Don't allow setting properly prefixed attributes
@@ -880,7 +880,7 @@ static int hfsplus_osx_setxattr(const struct xattr_handler *handler,
880 * creates), so we pass the name through unmodified (after 880 * creates), so we pass the name through unmodified (after
881 * ensuring it doesn't conflict with another namespace). 881 * ensuring it doesn't conflict with another namespace).
882 */ 882 */
883 return __hfsplus_setxattr(d_inode(dentry), name, buffer, size, flags); 883 return __hfsplus_setxattr(inode, name, buffer, size, flags);
884} 884}
885 885
886const struct xattr_handler hfsplus_xattr_osx_handler = { 886const struct xattr_handler hfsplus_xattr_osx_handler = {
diff --git a/fs/hfsplus/xattr.h b/fs/hfsplus/xattr.h
index d04ba6f58df2..68f6b539371f 100644
--- a/fs/hfsplus/xattr.h
+++ b/fs/hfsplus/xattr.h
@@ -21,7 +21,7 @@ extern const struct xattr_handler *hfsplus_xattr_handlers[];
21int __hfsplus_setxattr(struct inode *inode, const char *name, 21int __hfsplus_setxattr(struct inode *inode, const char *name,
22 const void *value, size_t size, int flags); 22 const void *value, size_t size, int flags);
23 23
24int hfsplus_setxattr(struct dentry *dentry, const char *name, 24int hfsplus_setxattr(struct inode *inode, const char *name,
25 const void *value, size_t size, int flags, 25 const void *value, size_t size, int flags,
26 const char *prefix, size_t prefixlen); 26 const char *prefix, size_t prefixlen);
27 27
diff --git a/fs/hfsplus/xattr_security.c b/fs/hfsplus/xattr_security.c
index ae2ca8c2e335..37b3efa733ef 100644
--- a/fs/hfsplus/xattr_security.c
+++ b/fs/hfsplus/xattr_security.c
@@ -23,10 +23,11 @@ static int hfsplus_security_getxattr(const struct xattr_handler *handler,
23} 23}
24 24
25static int hfsplus_security_setxattr(const struct xattr_handler *handler, 25static int hfsplus_security_setxattr(const struct xattr_handler *handler,
26 struct dentry *dentry, const char *name, 26 struct dentry *unused, struct inode *inode,
27 const void *buffer, size_t size, int flags) 27 const char *name, const void *buffer,
28 size_t size, int flags)
28{ 29{
29 return hfsplus_setxattr(dentry, name, buffer, size, flags, 30 return hfsplus_setxattr(inode, name, buffer, size, flags,
30 XATTR_SECURITY_PREFIX, 31 XATTR_SECURITY_PREFIX,
31 XATTR_SECURITY_PREFIX_LEN); 32 XATTR_SECURITY_PREFIX_LEN);
32} 33}
diff --git a/fs/hfsplus/xattr_trusted.c b/fs/hfsplus/xattr_trusted.c
index eae2947060aa..94519d6c627d 100644
--- a/fs/hfsplus/xattr_trusted.c
+++ b/fs/hfsplus/xattr_trusted.c
@@ -21,10 +21,11 @@ static int hfsplus_trusted_getxattr(const struct xattr_handler *handler,
21} 21}
22 22
23static int hfsplus_trusted_setxattr(const struct xattr_handler *handler, 23static int hfsplus_trusted_setxattr(const struct xattr_handler *handler,
24 struct dentry *dentry, const char *name, 24 struct dentry *unused, struct inode *inode,
25 const void *buffer, size_t size, int flags) 25 const char *name, const void *buffer,
26 size_t size, int flags)
26{ 27{
27 return hfsplus_setxattr(dentry, name, buffer, size, flags, 28 return hfsplus_setxattr(inode, name, buffer, size, flags,
28 XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN); 29 XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN);
29} 30}
30 31
diff --git a/fs/hfsplus/xattr_user.c b/fs/hfsplus/xattr_user.c
index 3c9eec3e4c7b..fae6c0ea0030 100644
--- a/fs/hfsplus/xattr_user.c
+++ b/fs/hfsplus/xattr_user.c
@@ -21,10 +21,11 @@ static int hfsplus_user_getxattr(const struct xattr_handler *handler,
21} 21}
22 22
23static int hfsplus_user_setxattr(const struct xattr_handler *handler, 23static int hfsplus_user_setxattr(const struct xattr_handler *handler,
24 struct dentry *dentry, const char *name, 24 struct dentry *unused, struct inode *inode,
25 const void *buffer, size_t size, int flags) 25 const char *name, const void *buffer,
26 size_t size, int flags)
26{ 27{
27 return hfsplus_setxattr(dentry, name, buffer, size, flags, 28 return hfsplus_setxattr(inode, name, buffer, size, flags,
28 XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN); 29 XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN);
29} 30}
30 31