[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250831123602.14037-31-pali@kernel.org>
Date: Sun, 31 Aug 2025 14:35:57 +0200
From: Pali Rohár <pali@...nel.org>
To: Steve French <sfrench@...ba.org>,
Paulo Alcantara <pc@...guebit.com>,
ronnie sahlberg <ronniesahlberg@...il.com>
Cc: linux-cifs@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 30/35] cifs: Simplify SMB2_OP_DELETE API usage
Currently the caller of SMB2_OP_DELETE operation has to specify also the
CREATE_DELETE_ON_CLOSE flag. Simplify API usage and let the callee
smb2_compound_op() to automatically set this flag when issuing the
SMB2_OP_DELETE operation.
No functional change.
Signed-off-by: Pali Rohár <pali@...nel.org>
---
fs/smb/client/smb2inode.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/fs/smb/client/smb2inode.c b/fs/smb/client/smb2inode.c
index 59d73e01ccd2..a3b1ed53a860 100644
--- a/fs/smb/client/smb2inode.c
+++ b/fs/smb/client/smb2inode.c
@@ -255,6 +255,13 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
vars->oparms = *oparms;
vars->oparms.fid = &fid;
+ for (i = 0; i < num_cmds; i++) {
+ if (cmds[i] == SMB2_OP_DELETE) {
+ vars->oparms.create_options |= CREATE_DELETE_ON_CLOSE;
+ break;
+ }
+ }
+
rqst[num_rqst].rq_iov = &vars->open_iov[0];
rqst[num_rqst].rq_nvec = SMB2_CREATE_IOV_SIZE;
rc = SMB2_open_init(tcon, server,
@@ -1348,7 +1355,7 @@ smb2_unlink(const unsigned int xid, struct cifs_tcon *tcon, const char *name,
oparms = CIFS_OPARMS(cifs_sb, tcon, name,
DELETE, FILE_OPEN,
- CREATE_DELETE_ON_CLOSE | CREATE_NOT_DIR | OPEN_REPARSE_POINT,
+ CREATE_NOT_DIR | OPEN_REPARSE_POINT,
ACL_NO_MODE);
int rc = smb2_compound_op(xid, tcon, cifs_sb, name, &oparms,
NULL, &(int){SMB2_OP_DELETE}, 1,
--
2.20.1
Powered by blists - more mailing lists