Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 59301226 authored by Al Viro's avatar Al Viro
Browse files

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: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 00235411
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -239,13 +239,13 @@ static int v9fs_xattr_get_acl(const struct xattr_handler *handler,
}

static int v9fs_xattr_set_acl(const struct xattr_handler *handler,
			      struct dentry *dentry, const char *name,
			      const void *value, size_t size, int flags)
			      struct dentry *dentry, struct inode *inode,
			      const char *name, const void *value,
			      size_t size, int flags)
{
	int retval;
	struct posix_acl *acl;
	struct v9fs_session_info *v9ses;
	struct inode *inode = d_inode(dentry);

	v9ses = v9fs_dentry2v9ses(dentry);
	/*
+3 −2
Original line number Diff line number Diff line
@@ -147,8 +147,9 @@ static int v9fs_xattr_handler_get(const struct xattr_handler *handler,
}

static int v9fs_xattr_handler_set(const struct xattr_handler *handler,
				  struct dentry *dentry, const char *name,
				  const void *value, size_t size, int flags)
				  struct dentry *dentry, struct inode *inode,
				  const char *name, const void *value,
				  size_t size, int flags)
{
	const char *full_name = xattr_full_name(handler, name);

+5 −7
Original line number Diff line number Diff line
@@ -380,23 +380,21 @@ static int btrfs_xattr_handler_get(const struct xattr_handler *handler,
}

static int btrfs_xattr_handler_set(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)
{
	struct inode *inode = d_inode(dentry);

	name = xattr_full_name(handler, name);
	return __btrfs_setxattr(NULL, inode, name, buffer, size, flags);
}

static int btrfs_xattr_handler_set_prop(const struct xattr_handler *handler,
					struct dentry *dentry,
					struct dentry *unused, struct inode *inode,
					const char *name, const void *value,
					size_t size, int flags)
{
	name = xattr_full_name(handler, name);
	return btrfs_set_prop(d_inode(dentry), name, value, size, flags);
	return btrfs_set_prop(inode, name, value, size, flags);
}

static const struct xattr_handler btrfs_security_xattr_handler = {
+4 −3
Original line number Diff line number Diff line
@@ -1051,12 +1051,13 @@ static int ceph_get_xattr_handler(const struct xattr_handler *handler,
}

static int ceph_set_xattr_handler(const struct xattr_handler *handler,
				  struct dentry *dentry, const char *name,
				  const void *value, size_t size, int flags)
				  struct dentry *unused, struct inode *inode,
				  const char *name, const void *value,
				  size_t size, int flags)
{
	if (!ceph_is_valid_xattr(name))
		return -EOPNOTSUPP;
	return __ceph_setxattr(d_inode(dentry), name, value, size, flags);
	return __ceph_setxattr(inode, name, value, size, flags);
}

const struct xattr_handler ceph_other_xattr_handler = {
+5 −4
Original line number Diff line number Diff line
@@ -39,8 +39,9 @@
enum { XATTR_USER, XATTR_CIFS_ACL, XATTR_ACL_ACCESS, XATTR_ACL_DEFAULT };

static int cifs_xattr_set(const struct xattr_handler *handler,
			  struct dentry *dentry, const char *name,
			  const void *value, size_t size, int flags)
			  struct dentry *dentry, struct inode *inode,
			  const char *name, const void *value,
			  size_t size, int flags)
{
	int rc = -EOPNOTSUPP;
	unsigned int xid;
@@ -99,12 +100,12 @@ static int cifs_xattr_set(const struct xattr_handler *handler,
			if (value &&
			    pTcon->ses->server->ops->set_acl)
				rc = pTcon->ses->server->ops->set_acl(pacl,
						size, d_inode(dentry),
						size, inode,
						full_path, CIFS_ACL_DACL);
			else
				rc = -EOPNOTSUPP;
			if (rc == 0) /* force revalidate of the inode */
				CIFS_I(d_inode(dentry))->time = 0;
				CIFS_I(inode)->time = 0;
			kfree(pacl);
		}
#endif /* CONFIG_CIFS_ACL */
Loading