All of lore.kernel.org
 help / color / mirror / Atom feed
From: schumaker.anna@gmail.com
To: Trond.Myklebust@hammerspace.com, linux-nfs@vger.kernel.org
Cc: Anna.Schumaker@Netapp.com
Subject: [PATCH v2 04/14] NFS: Remove the nfs4_label from the nfs4_link_res struct
Date: Fri, 22 Oct 2021 13:11:03 -0400	[thread overview]
Message-ID: <20211022171113.16739-5-Anna.Schumaker@Netapp.com> (raw)
In-Reply-To: <20211022171113.16739-1-Anna.Schumaker@Netapp.com>

From: Anna Schumaker <Anna.Schumaker@Netapp.com>

Again, use the fattr's label field instead.

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
---
 fs/nfs/nfs4proc.c       | 16 +++-------------
 fs/nfs/nfs4xdr.c        |  2 +-
 include/linux/nfs_xdr.h |  1 -
 3 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 06569a35a6df..fed15eafc03b 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -4791,7 +4791,6 @@ static int _nfs4_proc_link(struct inode *inode, struct inode *dir, const struct
 	};
 	struct nfs4_link_res res = {
 		.server = server,
-		.label = NULL,
 	};
 	struct rpc_message msg = {
 		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LINK],
@@ -4800,18 +4799,12 @@ static int _nfs4_proc_link(struct inode *inode, struct inode *dir, const struct
 	};
 	int status = -ENOMEM;
 
-	res.fattr = nfs_alloc_fattr();
+	res.fattr = nfs_alloc_fattr_with_label(server);
 	if (res.fattr == NULL)
 		goto out;
 
-	res.label = nfs4_label_alloc(server, GFP_KERNEL);
-	if (IS_ERR(res.label)) {
-		status = PTR_ERR(res.label);
-		goto out;
-	}
-
 	nfs4_inode_make_writeable(inode);
-	nfs4_bitmap_copy_adjust(bitmask, nfs4_bitmask(server, res.label), inode,
+	nfs4_bitmap_copy_adjust(bitmask, nfs4_bitmask(server, res.fattr->label), inode,
 				NFS_INO_INVALID_CHANGE);
 	status = nfs4_call_sync(server->client, server, &msg, &arg.seq_args, &res.seq_res, 1);
 	if (!status) {
@@ -4820,12 +4813,9 @@ static int _nfs4_proc_link(struct inode *inode, struct inode *dir, const struct
 		nfs4_inc_nlink(inode);
 		status = nfs_post_op_update_inode(inode, res.fattr);
 		if (!status)
-			nfs_setsecurity(inode, res.fattr, res.label);
+			nfs_setsecurity(inode, res.fattr, res.fattr->label);
 	}
 
-
-	nfs4_label_free(res.label);
-
 out:
 	nfs_free_fattr(res.fattr);
 	return status;
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 98594a97529d..4ce6d2430ff1 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -6331,7 +6331,7 @@ static int nfs4_xdr_dec_link(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
 	status = decode_restorefh(xdr);
 	if (status)
 		goto out;
-	decode_getfattr_label(xdr, res->fattr, res->label, res->server);
+	decode_getfattr_label(xdr, res->fattr, res->fattr->label, res->server);
 out:
 	return status;
 }
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 5aba81b74c98..d55bf3fd5167 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1079,7 +1079,6 @@ struct nfs4_link_res {
 	struct nfs4_sequence_res	seq_res;
 	const struct nfs_server *	server;
 	struct nfs_fattr *		fattr;
-	struct nfs4_label		*label;
 	struct nfs4_change_info		cinfo;
 	struct nfs_fattr *		dir_attr;
 };
-- 
2.33.1


  parent reply	other threads:[~2021-10-22 17:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-22 17:10 [PATCH v2 00/14] NFS: Clean up nfs4_label allocation schumaker.anna
2021-10-22 17:11 ` [PATCH v2 01/14] NFS: Create a new nfs_alloc_fattr_with_label() function schumaker.anna
2021-10-22 17:11 ` [PATCH v2 02/14] NFS: Remove the nfs4_label from the nfs_entry struct schumaker.anna
2021-10-22 17:11 ` [PATCH v2 03/14] NFS: Remove the nfs4_label from the nfs4_create_res struct schumaker.anna
2021-10-22 17:11 ` schumaker.anna [this message]
2021-10-22 17:11 ` [PATCH v2 05/14] NFS: Remove the label from the nfs4_lookup_res struct schumaker.anna
2021-11-07  1:24   ` kernel test robot
2021-11-07  1:24     ` kernel test robot
2021-10-22 17:11 ` [PATCH v2 06/14] NFS: Remove the nfs4_label from the nfs4_lookupp_res struct schumaker.anna
2021-10-22 17:11 ` [PATCH v2 07/14] NFS: Remove the f_label from the nfs4_opendata and nfs_openres schumaker.anna
2021-10-22 17:11 ` [PATCH v2 08/14] NFS: Remove the nfs4_label from the nfs4_getattr_res schumaker.anna
2021-10-22 17:11 ` [PATCH v2 09/14] NFS: Remove the nfs4_label from the nfs_setattrres schumaker.anna
2021-10-22 17:11 ` [PATCH v2 10/14] NFS: Remove the nfs4_label argument from nfs_instantiate() schumaker.anna
2021-10-22 17:11 ` [PATCH v2 11/14] NFS: Remove the nfs4_label argument from nfs_add_or_obtain() schumaker.anna
2021-10-22 17:11 ` [PATCH v2 12/14] NFS: Remove the nfs4_label argument from nfs_fhget() schumaker.anna
2021-10-22 17:11 ` [PATCH v2 13/14] NFS: Remove the nfs4_label argument from nfs_setsecurity schumaker.anna
2021-10-22 17:11 ` [PATCH v2 14/14] NFS: Remove the nfs4_label argument from decode_getattr_*() functions schumaker.anna
2021-11-12  6:45 [PATCH v2 05/14] NFS: Remove the label from the nfs4_lookup_res struct kernel test robot
2021-11-16  7:10 ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211022171113.16739-5-Anna.Schumaker@Netapp.com \
    --to=schumaker.anna@gmail.com \
    --cc=Anna.Schumaker@Netapp.com \
    --cc=Trond.Myklebust@hammerspace.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.