CIFS: Add SMB2 support for unlink
authorPavel Shilovsky <pshilovsky@samba.org>
Tue, 18 Sep 2012 23:20:25 +0000 (16:20 -0700)
committerSteve French <smfrench@gmail.com>
Tue, 25 Sep 2012 02:46:26 +0000 (21:46 -0500)
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
fs/cifs/smb2inode.c
fs/cifs/smb2ops.c
fs/cifs/smb2proto.h

index 2aa5cb08c526a3461ea759ea6f09b8abb65686b9..02a9bda4248c289a98ac46a1a4a94e581ebf3d42 100644 (file)
@@ -161,3 +161,12 @@ smb2_rmdir(const unsigned int xid, struct cifs_tcon *tcon, const char *name,
                                  0, CREATE_NOT_FILE | CREATE_DELETE_ON_CLOSE,
                                  NULL, SMB2_OP_DELETE);
 }
+
+int
+smb2_unlink(const unsigned int xid, struct cifs_tcon *tcon, const char *name,
+           struct cifs_sb_info *cifs_sb)
+{
+       return smb2_open_op_close(xid, tcon, cifs_sb, name, DELETE, FILE_OPEN,
+                                 0, CREATE_DELETE_ON_CLOSE, NULL,
+                                 SMB2_OP_DELETE);
+}
index 826209bf36842c904259533a0199fc6f5138a0b9..bf9b318cfa4b436c61cc70dcec77c28ec3b80f05 100644 (file)
@@ -321,6 +321,7 @@ struct smb_version_operations smb21_operations = {
        .mkdir = smb2_mkdir,
        .mkdir_setinfo = smb2_mkdir_setinfo,
        .rmdir = smb2_rmdir,
+       .unlink = smb2_unlink,
 };
 
 struct smb_version_values smb21_values = {
index bfaa7b148afd0e4d3d334a52c699a90dac75aeea..f4ac72799f70a293138fd462b4def4cc6fe48bc9 100644 (file)
@@ -59,6 +59,8 @@ extern void smb2_mkdir_setinfo(struct inode *inode, const char *full_path,
                               struct cifs_tcon *tcon, const unsigned int xid);
 extern int smb2_rmdir(const unsigned int xid, struct cifs_tcon *tcon,
                      const char *name, struct cifs_sb_info *cifs_sb);
+extern int smb2_unlink(const unsigned int xid, struct cifs_tcon *tcon,
+                      const char *name, struct cifs_sb_info *cifs_sb);
 
 /*
  * SMB2 Worker functions - most of protocol specific implementation details