From patchwork Fri Jul 13 07:53:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 1194261 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 3FF2C3FC4C for ; Fri, 13 Jul 2012 07:55:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755179Ab2GMHzx (ORCPT ); Fri, 13 Jul 2012 03:55:53 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]:49057 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755103Ab2GMHzw (ORCPT ); Fri, 13 Jul 2012 03:55:52 -0400 Received: by mail-lb0-f174.google.com with SMTP id gm6so5433132lbb.19 for ; Fri, 13 Jul 2012 00:55:51 -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=4vbdhIPQGow5FsLExzwpdms/4XPpnMtRtqc9SJRn4cE=; b=bYoxOYXyGgt4XA/xkdhHGWvSn3yNIAlch89ysOGe+BwdIah1O1Tx7AXRX8kPf42v7N iBZCLdr5DCSllrSq0nsInpzQ6lNz+BtkCuuG9wEiXS+f0FCFKY0H59eqyBgJTSPr+S/P mico955J1e2vbpscxP/4II002tsxIrx9qs1bmkxeDcITLMGnlJKN+xBzK7iSl7+vYBAr /NU3r6nb51WnyCDSZ1o836Wji31vidlORuztZH4idC4r9d7apCxHOYUpMKwjUjUISppX b+orXaxBJjuEJ8ZdPSu5zH9gpnbkQzGymHOfd8LGlPMTEUALNVeCLfoe5UWhFvQdV+/D I9gQ== Received: by 10.112.29.166 with SMTP id l6mr293406lbh.68.1342166151718; Fri, 13 Jul 2012 00:55:51 -0700 (PDT) Received: from localhost.localdomain ([178.45.132.158]) by mx.google.com with ESMTPS id er3sm1595545lbb.16.2012.07.13.00.55.49 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 13 Jul 2012 00:55:50 -0700 (PDT) From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Subject: [PATCH v3 26/32] CIFS: Add SMB2 support for build_path_to_root Date: Fri, 13 Jul 2012 11:53:39 +0400 Message-Id: <1342166025-29377-27-git-send-email-pshilovsky@samba.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1342166025-29377-1-git-send-email-pshilovsky@samba.org> References: <1342166025-29377-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/smb2ops.c | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index bcf310c..2f9950e 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -190,6 +190,23 @@ smb2_get_srv_inum(const unsigned int xid, struct cifs_tcon *tcon, return 0; } +static char * +smb2_build_path_to_root(struct smb_vol *vol, struct cifs_sb_info *cifs_sb, + struct cifs_tcon *tcon) +{ + int pplen = vol->prepath ? strlen(vol->prepath) : 0; + char *full_path = NULL; + + /* if no prefix path, simply set path to the root of share to "" */ + if (pplen == 0) { + full_path = kzalloc(2, GFP_KERNEL); + return full_path; + } + + cERROR(1, "prefixpath is not supported for SMB2 now"); + return NULL; +} + struct smb_version_operations smb21_operations = { .setup_request = smb2_setup_request, .check_receive = smb2_check_receive, @@ -210,6 +227,7 @@ struct smb_version_operations smb21_operations = { .is_path_accessible = smb2_is_path_accessible, .query_path_info = smb2_query_path_info, .get_srv_inum = smb2_get_srv_inum, + .build_path_to_root = smb2_build_path_to_root, }; struct smb_version_values smb21_values = {