From patchwork Wed Jul 18 15:48:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 1211931 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 90CCF3FD4F for ; Wed, 18 Jul 2012 15:50:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751687Ab2GRPuE (ORCPT ); Wed, 18 Jul 2012 11:50:04 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]:57672 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754067Ab2GRPuD (ORCPT ); Wed, 18 Jul 2012 11:50:03 -0400 Received: by mail-lb0-f174.google.com with SMTP id gm6so2257593lbb.19 for ; Wed, 18 Jul 2012 08:50:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; bh=eJHsaDMQje0c4jjBcmo5P9IUUZ0cF7VFTbRyabfyqvo=; b=yapgUqwcHez+hUpm+pVEC4fh0ycDrFEwnzkmavpEsIB+jipwGKWlhFToFXlauuoO+j 9v4F0FFmansUUz9AOf+Bj2j7yvdoCrq6qrFYxWhgq16Fwh2Cp6aHWRTCcNRu1qcuNz1v R5+LhuR3NhiKr2b6X7tQmESrMfgnwvnDpfMhcoI5aK9glqyi/8KLHf5eMrcSYPBO/zAg NyojVpK+nyf0NBPPOU1LU3nBSnqbzYWLl9I7m+X6kOUSfsgZc6mwKT6hY5EY/yaDKcom VKN0tMLzKnnSp+iC6iX5p5R5MKkV4yROaRtu3+O8ONh5P8vd3HLxRsi+je2Xm7E/2a37 8C2A== Received: by 10.112.101.97 with SMTP id ff1mr2077628lbb.69.1342626602737; Wed, 18 Jul 2012 08:50:02 -0700 (PDT) Received: from localhost.localdomain ([178.45.208.11]) by mx.google.com with ESMTPS id p2sm4826985lbj.4.2012.07.18.08.50.01 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 18 Jul 2012 08:50:01 -0700 (PDT) From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Subject: [PATCH 06/45] CIFS: Add SMB2 support for rmdir Date: Wed, 18 Jul 2012 19:48:22 +0400 Message-Id: <1342626541-29872-7-git-send-email-pshilovsky@samba.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1342626541-29872-1-git-send-email-pshilovsky@samba.org> References: <1342626541-29872-1-git-send-email-pshilovsky@samba.org> Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Signed-off-by: Pavel Shilovsky Reviewed-by: Jeff Layton --- fs/cifs/smb2inode.c | 9 +++++++++ fs/cifs/smb2ops.c | 1 + fs/cifs/smb2proto.h | 2 ++ 3 files changed, 12 insertions(+), 0 deletions(-) diff --git a/fs/cifs/smb2inode.c b/fs/cifs/smb2inode.c index e129527..2aa5cb0 100644 --- a/fs/cifs/smb2inode.c +++ b/fs/cifs/smb2inode.c @@ -152,3 +152,12 @@ smb2_mkdir_setinfo(struct inode *inode, const char *name, if (tmprc == 0) cifs_i->cifsAttrs = dosattrs; } + +int +smb2_rmdir(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_NOT_FILE | CREATE_DELETE_ON_CLOSE, + NULL, SMB2_OP_DELETE); +} diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index cc74871..826209b 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -320,6 +320,7 @@ struct smb_version_operations smb21_operations = { .build_path_to_root = smb2_build_path_to_root, .mkdir = smb2_mkdir, .mkdir_setinfo = smb2_mkdir_setinfo, + .rmdir = smb2_rmdir, }; struct smb_version_values smb21_values = { diff --git a/fs/cifs/smb2proto.h b/fs/cifs/smb2proto.h index f992508..bfaa7b1 100644 --- a/fs/cifs/smb2proto.h +++ b/fs/cifs/smb2proto.h @@ -57,6 +57,8 @@ extern int smb2_mkdir(const unsigned int xid, struct cifs_tcon *tcon, extern void smb2_mkdir_setinfo(struct inode *inode, const char *full_path, struct cifs_sb_info *cifs_sb, 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); /* * SMB2 Worker functions - most of protocol specific implementation details