static inline int ovl_do_setxattr(struct dentry *dentry, const char *name,
const void *value, size_t size, int flags)
{
- struct inode *inode = dentry->d_inode;
- int err;
-
- inode_lock(inode);
- err = __vfs_setxattr_noperm(dentry, name, value, size, flags);
- inode_unlock(inode);
-
+ int err = vfs_setxattr(dentry, name, value, size, flags);
pr_debug("setxattr(%pd2, \"%s\", \"%*s\", 0x%x) = %i\n",
dentry, name, (int) size, (char *) value, flags, err);
return err;
static inline int ovl_do_removexattr(struct dentry *dentry, const char *name)
{
- struct inode *inode = dentry->d_inode;
- int err;
-
- inode_lock(inode);
- err = __vfs_removexattr_noperm(dentry, name);
- inode_unlock(inode);
-
+ int err = vfs_removexattr(dentry, name);
pr_debug("removexattr(%pd2, \"%s\") = %i\n", dentry, name, err);
return err;
}
return error;
}
-EXPORT_SYMBOL_GPL(__vfs_setxattr_noperm);
int
}
EXPORT_SYMBOL_GPL(vfs_listxattr);
-/**
- * __vfs_removexattr_noperm - perform removexattr operation without
- * performing permission checks.
- *
- * @dentry - object to perform setxattr on
- * @name - xattr name to set
- *
- * returns the result of the internal setxattr or setsecurity operations.
- *
- * This function requires the caller to lock the inode's i_mutex before it
- * is executed. It also assumes that the caller will make the appropriate
- * permission checks.
- */
-int __vfs_removexattr_noperm(struct dentry *dentry, const char *name)
-{
- struct inode *inode = dentry->d_inode;
- int error = -EOPNOTSUPP;
-
- if (inode->i_op->removexattr) {
- error = inode->i_op->removexattr(dentry, name);
- if (!error) {
- fsnotify_xattr(dentry);
- evm_inode_post_removexattr(dentry, name);
- }
- }
-
- return error;
-}
-EXPORT_SYMBOL_GPL(__vfs_removexattr_noperm);
-
int
__vfs_removexattr(struct dentry *dentry, const char *name)
{
if (error)
goto out;
- error = __vfs_removexattr_noperm(dentry, name);
+ error = __vfs_removexattr(dentry, name);
if (!error) {
fsnotify_xattr(dentry);
int __vfs_setxattr_noperm(struct dentry *, const char *, const void *, size_t, int);
int vfs_setxattr(struct dentry *, const char *, const void *, size_t, int);
int __vfs_removexattr(struct dentry *, const char *);
-int __vfs_removexattr_noperm(struct dentry *dentry, const char *name);
int vfs_removexattr(struct dentry *, const char *);
ssize_t generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size);