Skip to content

Commit 1a500f0

Browse files
piastrysmfrench
authored andcommitted
CIFS: Add SMB2 support for rmdir
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
1 parent f958ca5 commit 1a500f0

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎fs/cifs/smb2inode.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,12 @@ smb2_mkdir_setinfo(struct inode *inode, const char *name,
152152
if (tmprc == 0)
153153
cifs_i->cifsAttrs = dosattrs;
154154
}
155+
156+
int
157+
smb2_rmdir(const unsigned int xid, struct cifs_tcon *tcon, const char *name,
158+
struct cifs_sb_info *cifs_sb)
159+
{
160+
return smb2_open_op_close(xid, tcon, cifs_sb, name, DELETE, FILE_OPEN,
161+
0, CREATE_NOT_FILE | CREATE_DELETE_ON_CLOSE,
162+
NULL, SMB2_OP_DELETE);
163+
}

‎fs/cifs/smb2ops.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ struct smb_version_operations smb21_operations = {
320320
.build_path_to_root = smb2_build_path_to_root,
321321
.mkdir = smb2_mkdir,
322322
.mkdir_setinfo = smb2_mkdir_setinfo,
323+
.rmdir = smb2_rmdir,
323324
};
324325

325326
struct smb_version_values smb21_values = {

‎fs/cifs/smb2proto.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ extern int smb2_mkdir(const unsigned int xid, struct cifs_tcon *tcon,
5757
extern void smb2_mkdir_setinfo(struct inode *inode, const char *full_path,
5858
struct cifs_sb_info *cifs_sb,
5959
struct cifs_tcon *tcon, const unsigned int xid);
60+
extern int smb2_rmdir(const unsigned int xid, struct cifs_tcon *tcon,
61+
const char *name, struct cifs_sb_info *cifs_sb);
6062

6163
/*
6264
* SMB2 Worker functions - most of protocol specific implementation details

0 commit comments

Comments
 (0)