mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
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 <[email protected]>
This commit is contained in:
parent
002354112f
commit
5930122683
34 changed files with 156 additions and 135 deletions
|
|
@ -424,7 +424,7 @@ static int copy_name(char *buffer, const char *xattr_name, int name_len)
|
|||
return len;
|
||||
}
|
||||
|
||||
int hfsplus_setxattr(struct dentry *dentry, const char *name,
|
||||
int hfsplus_setxattr(struct inode *inode, const char *name,
|
||||
const void *value, size_t size, int flags,
|
||||
const char *prefix, size_t prefixlen)
|
||||
{
|
||||
|
|
@ -437,8 +437,7 @@ int hfsplus_setxattr(struct dentry *dentry, const char *name,
|
|||
return -ENOMEM;
|
||||
strcpy(xattr_name, prefix);
|
||||
strcpy(xattr_name + prefixlen, name);
|
||||
res = __hfsplus_setxattr(d_inode(dentry), xattr_name, value, size,
|
||||
flags);
|
||||
res = __hfsplus_setxattr(inode, xattr_name, value, size, flags);
|
||||
kfree(xattr_name);
|
||||
return res;
|
||||
}
|
||||
|
|
@ -864,8 +863,9 @@ static int hfsplus_osx_getxattr(const struct xattr_handler *handler,
|
|||
}
|
||||
|
||||
static int hfsplus_osx_setxattr(const struct xattr_handler *handler,
|
||||
struct dentry *dentry, const char *name,
|
||||
const void *buffer, size_t size, int flags)
|
||||
struct dentry *unused, struct inode *inode,
|
||||
const char *name, const void *buffer,
|
||||
size_t size, int flags)
|
||||
{
|
||||
/*
|
||||
* Don't allow setting properly prefixed attributes
|
||||
|
|
@ -880,7 +880,7 @@ static int hfsplus_osx_setxattr(const struct xattr_handler *handler,
|
|||
* creates), so we pass the name through unmodified (after
|
||||
* ensuring it doesn't conflict with another namespace).
|
||||
*/
|
||||
return __hfsplus_setxattr(d_inode(dentry), name, buffer, size, flags);
|
||||
return __hfsplus_setxattr(inode, name, buffer, size, flags);
|
||||
}
|
||||
|
||||
const struct xattr_handler hfsplus_xattr_osx_handler = {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ extern const struct xattr_handler *hfsplus_xattr_handlers[];
|
|||
int __hfsplus_setxattr(struct inode *inode, const char *name,
|
||||
const void *value, size_t size, int flags);
|
||||
|
||||
int hfsplus_setxattr(struct dentry *dentry, const char *name,
|
||||
int hfsplus_setxattr(struct inode *inode, const char *name,
|
||||
const void *value, size_t size, int flags,
|
||||
const char *prefix, size_t prefixlen);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,10 +23,11 @@ static int hfsplus_security_getxattr(const struct xattr_handler *handler,
|
|||
}
|
||||
|
||||
static int hfsplus_security_setxattr(const struct xattr_handler *handler,
|
||||
struct dentry *dentry, const char *name,
|
||||
const void *buffer, size_t size, int flags)
|
||||
struct dentry *unused, struct inode *inode,
|
||||
const char *name, const void *buffer,
|
||||
size_t size, int flags)
|
||||
{
|
||||
return hfsplus_setxattr(dentry, name, buffer, size, flags,
|
||||
return hfsplus_setxattr(inode, name, buffer, size, flags,
|
||||
XATTR_SECURITY_PREFIX,
|
||||
XATTR_SECURITY_PREFIX_LEN);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,10 +21,11 @@ static int hfsplus_trusted_getxattr(const struct xattr_handler *handler,
|
|||
}
|
||||
|
||||
static int hfsplus_trusted_setxattr(const struct xattr_handler *handler,
|
||||
struct dentry *dentry, const char *name,
|
||||
const void *buffer, size_t size, int flags)
|
||||
struct dentry *unused, struct inode *inode,
|
||||
const char *name, const void *buffer,
|
||||
size_t size, int flags)
|
||||
{
|
||||
return hfsplus_setxattr(dentry, name, buffer, size, flags,
|
||||
return hfsplus_setxattr(inode, name, buffer, size, flags,
|
||||
XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,10 +21,11 @@ static int hfsplus_user_getxattr(const struct xattr_handler *handler,
|
|||
}
|
||||
|
||||
static int hfsplus_user_setxattr(const struct xattr_handler *handler,
|
||||
struct dentry *dentry, const char *name,
|
||||
const void *buffer, size_t size, int flags)
|
||||
struct dentry *unused, struct inode *inode,
|
||||
const char *name, const void *buffer,
|
||||
size_t size, int flags)
|
||||
{
|
||||
return hfsplus_setxattr(dentry, name, buffer, size, flags,
|
||||
return hfsplus_setxattr(inode, name, buffer, size, flags,
|
||||
XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue