From patchwork Wed Jul 18 15:48:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 1211961 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 B079E3FD4F for ; Wed, 18 Jul 2012 15:50:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754077Ab2GRPuK (ORCPT ); Wed, 18 Jul 2012 11:50:10 -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 S1754054Ab2GRPuJ (ORCPT ); Wed, 18 Jul 2012 11:50:09 -0400 Received: by mail-lb0-f174.google.com with SMTP id gm6so2257593lbb.19 for ; Wed, 18 Jul 2012 08:50:08 -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=lb9bDqGI+vxVBMat6qbhBCsI0Ymi9ijYtMfuKqySFTA=; b=lNkLtTQlzbB2Krowm+pVG8KRprJAU2+exd4JDySGjh7+EBfPZYqyR2sFSRlyTNMQcw 7lgW14tTA8GrrXgvVokcXyr/wWpK+f4zzLm2eX5YFwdgBP5ssjsnGpk5wlytIPUgYbZ6 WKBcdCHUIUFEJaOr/hN5ae5S245c5fZQb9PisWa2yENIffnPKiho5DH3LZiibQBWnrrj gwemISGm668+gQDyU8XzsY8FJX8yVPFlmnhchw9t5NbceM5XvCOkUeEKrZAbjo58mBo0 fKcihQy7/QrgOPE5Kqrpj2IHhzJ46SoRWFaMBLPRjjS+E76FRMIlhUzOA6dxe+IEHKvS hycA== Received: by 10.112.24.194 with SMTP id w2mr2027736lbf.75.1342626608757; Wed, 18 Jul 2012 08:50:08 -0700 (PDT) Received: from localhost.localdomain ([178.45.208.11]) by mx.google.com with ESMTPS id p2sm4826985lbj.4.2012.07.18.08.50.07 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 18 Jul 2012 08:50:08 -0700 (PDT) From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Subject: [PATCH 09/45] CIFS: Add SMB2 support for unlink Date: Wed, 18 Jul 2012 19:48:25 +0400 Message-Id: <1342626541-29872-10-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 --- 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 2aa5cb0..02a9bda 100644 --- a/fs/cifs/smb2inode.c +++ b/fs/cifs/smb2inode.c @@ -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); +} diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 826209b..bf9b318 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -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 = { diff --git a/fs/cifs/smb2proto.h b/fs/cifs/smb2proto.h index bfaa7b1..f4ac727 100644 --- a/fs/cifs/smb2proto.h +++ b/fs/cifs/smb2proto.h @@ -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