Commit 47dd9597 authored by Ronnie Sahlberg's avatar Ronnie Sahlberg Committed by Steve French

cifs: change unlink to use a compound

This,and previous patches, drops the number of roundtrips from five to two
for unlink()
Signed-off-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent f733e393
...@@ -105,6 +105,8 @@ smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -105,6 +105,8 @@ smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
smb2_set_next_command(server, &rqst[num_rqst]); smb2_set_next_command(server, &rqst[num_rqst]);
smb2_set_related(&rqst[num_rqst++]); smb2_set_related(&rqst[num_rqst++]);
break; break;
case SMB2_OP_DELETE:
break;
case SMB2_OP_MKDIR: case SMB2_OP_MKDIR:
/* /*
* Directories are created through parameters in the * Directories are created through parameters in the
...@@ -148,6 +150,7 @@ smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -148,6 +150,7 @@ smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
if (rqst[2].rq_iov) if (rqst[2].rq_iov)
SMB2_close_free(&rqst[2]); SMB2_close_free(&rqst[2]);
break; break;
case SMB2_OP_DELETE:
case SMB2_OP_MKDIR: case SMB2_OP_MKDIR:
if (rqst[1].rq_iov) if (rqst[1].rq_iov)
SMB2_close_free(&rqst[1]); SMB2_close_free(&rqst[1]);
...@@ -202,8 +205,6 @@ smb2_open_op_close(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -202,8 +205,6 @@ smb2_open_op_close(const unsigned int xid, struct cifs_tcon *tcon,
} }
switch (command) { switch (command) {
case SMB2_OP_DELETE:
break;
case SMB2_OP_RMDIR: case SMB2_OP_RMDIR:
tmprc = SMB2_rmdir(xid, tcon, fid.persistent_fid, tmprc = SMB2_rmdir(xid, tcon, fid.persistent_fid,
fid.volatile_fid); fid.volatile_fid);
...@@ -330,9 +331,9 @@ int ...@@ -330,9 +331,9 @@ int
smb2_unlink(const unsigned int xid, struct cifs_tcon *tcon, const char *name, smb2_unlink(const unsigned int xid, struct cifs_tcon *tcon, const char *name,
struct cifs_sb_info *cifs_sb) struct cifs_sb_info *cifs_sb)
{ {
return smb2_open_op_close(xid, tcon, cifs_sb, name, DELETE, FILE_OPEN, return smb2_compound_op(xid, tcon, cifs_sb, name, DELETE, FILE_OPEN,
CREATE_DELETE_ON_CLOSE | OPEN_REPARSE_POINT, CREATE_DELETE_ON_CLOSE | OPEN_REPARSE_POINT,
NULL, SMB2_OP_DELETE); NULL, SMB2_OP_DELETE);
} }
static int static int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment