From patchwork Tue Mar 17 18:13:53 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 12643 Received: from lists.samba.org (mail.samba.org [66.70.73.150]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2HIEm8V002602 for ; Tue, 17 Mar 2009 18:14:49 GMT Received: from dp.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id D50E4163C59 for ; Tue, 17 Mar 2009 18:14:33 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on dp.samba.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.8 tests=AWL,BAYES_00, DNS_FROM_RFC_POST,SPF_PASS autolearn=no version=3.1.7 X-Original-To: linux-cifs-client@lists.samba.org Delivered-To: linux-cifs-client@lists.samba.org Received: from ti-out-0910.google.com (ti-out-0910.google.com [209.85.142.185]) by lists.samba.org (Postfix) with ESMTP id 4C8FC163B61 for ; Tue, 17 Mar 2009 18:14:07 +0000 (GMT) Received: by ti-out-0910.google.com with SMTP id a1so52071tib.12 for ; Tue, 17 Mar 2009 11:14:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type; bh=X/BtLLjryq4oFlgzU5i84ZpBoXTYDgKCi5/UGvZFrRA=; b=LC2EyeprFWwWih+BQyMF8jtOyXcsvR9UH+6ITqPgETiuq+kO83gpjuSO4Rh/lf1hgk gHcvM+Tp3Tj7hz2Uc4b9NCI//XGC3IDCpJs+Pyr34CYITotgiO0EvJfo4qbHS8YRtM0w SXek/gILzj1He8st5/icr26tOBPEjtRrIydnU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; b=dGo1HpF89fXqP0Fx8aI5n5YmeSeU69ftOS7WvMAd33oKAYXqPTD0MJi7p/l1YnM+Y2 LhUjPQgNSqvImoKDBjCBLeza1PfjXFpUTvwJ0aaVkQdde89DIwxLE1mk8YfsYmsG1eMu 0ddKcG/wLJzpYnVLOzZ8sYQ296q/ywK9TIIHc= Received: by 10.110.26.8 with SMTP id 8mr437801tiz.46.1237313661788; Tue, 17 Mar 2009 11:14:21 -0700 (PDT) Received: from l102796.int.cboss.ru ([195.245.232.177]) by mx.google.com with ESMTPS id y3sm3722tia.23.2009.03.17.11.14.07 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 17 Mar 2009 11:14:16 -0700 (PDT) Message-ID: <49BFE861.80508@gmail.com> Date: Tue, 17 Mar 2009 21:13:53 +0300 From: Igor Mammedov User-Agent: Thunderbird 2.0.0.19 (X11/20081209) MIME-Version: 1.0 To: Steve French References: <49BFD27D.6050004@gmail.com> <524f69650903170953m63ed30abqecf4d727a1bcd931@mail.gmail.com> In-Reply-To: <524f69650903170953m63ed30abqecf4d727a1bcd931@mail.gmail.com> Cc: "linux-cifs-client@lists.samba.org" Subject: [linux-cifs-client] Re: [PATCH 1/3] [Try 2] [CIFS] Rename compose_mount_options to cifs_compose_mount_options. X-BeenThere: linux-cifs-client@lists.samba.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: The Linux CIFS VFS client List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-cifs-client-bounces+patchwork-cifs-client=patchwork.kernel.org@lists.samba.org Errors-To: linux-cifs-client-bounces+patchwork-cifs-client=patchwork.kernel.org@lists.samba.org Steve French wrote: > Looks ok except that we don't want function definition externs in > cifsglob.h but instead in cifsproto.h or cifsfs.h Fixed. > > On Tue, Mar 17, 2009 at 11:40 AM, Igor Mammedov wrote: >> -- >> >> Best regards, >> >> ------------------------- >> Igor Mammedov, >> niallain "at" gmail.com >> >> >> >> >> > > > >From 9194faababde50886dd154768d3f473c516db3bf Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Tue, 17 Mar 2009 21:07:23 +0300 Subject: [PATCH] [CIFS] Rename compose_mount_options to cifs_compose_mount_options. Make it available to others for reuse. Signed-off-by: Igor Mammedov --- fs/cifs/cifs_dfs_ref.c | 36 ++++++++++++++++-------------------- fs/cifs/cifsproto.h | 3 +++ 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c index 85c0a74..5fdbf8a 100644 --- a/fs/cifs/cifs_dfs_ref.c +++ b/fs/cifs/cifs_dfs_ref.c @@ -104,9 +104,9 @@ static char *cifs_get_share_name(const char *node_name) /** - * compose_mount_options - creates mount options for refferral + * cifs_compose_mount_options - creates mount options for refferral * @sb_mountdata: parent/root DFS mount options (template) - * @dentry: point where we are going to mount + * @fullpath: full path in UNC format * @ref: server's referral * @devname: pointer for saving device name * @@ -116,8 +116,8 @@ static char *cifs_get_share_name(const char *node_name) * Returns: pointer to new mount options or ERR_PTR. * Caller is responcible for freeing retunrned value if it is not error. */ -static char *compose_mount_options(const char *sb_mountdata, - struct dentry *dentry, +char *cifs_compose_mount_options(const char *sb_mountdata, + const char *fullpath, const struct dfs_info3_param *ref, char **devname) { @@ -128,7 +128,6 @@ static char *compose_mount_options(const char *sb_mountdata, char *srvIP = NULL; char sep = ','; int off, noff; - char *fullpath; if (sb_mountdata == NULL) return ERR_PTR(-EINVAL); @@ -202,17 +201,6 @@ static char *compose_mount_options(const char *sb_mountdata, goto compose_mount_options_err; } - /* - * this function gives us a path with a double backslash prefix. We - * require a single backslash for DFS. Temporarily increment fullpath - * to put it in the proper form and decrement before freeing it. - */ - fullpath = build_path_from_dentry(dentry); - if (!fullpath) { - rc = -ENOMEM; - goto compose_mount_options_err; - } - ++fullpath; tkn_e = strchr(tkn_e + 1, '\\'); if (tkn_e || (strlen(fullpath) - ref->path_consumed)) { strncat(mountdata, &sep, 1); @@ -221,8 +209,6 @@ static char *compose_mount_options(const char *sb_mountdata, strcat(mountdata, tkn_e + 1); strcat(mountdata, fullpath + ref->path_consumed); } - --fullpath; - kfree(fullpath); /*cFYI(1,("%s: parent mountdata: %s", __func__,sb_mountdata));*/ /*cFYI(1, ("%s: submount mountdata: %s", __func__, mountdata ));*/ @@ -245,10 +231,20 @@ static struct vfsmount *cifs_dfs_do_refmount(const struct vfsmount *mnt_parent, struct vfsmount *mnt; char *mountdata; char *devname = NULL; + char *fullpath; cifs_sb = CIFS_SB(dentry->d_inode->i_sb); - mountdata = compose_mount_options(cifs_sb->mountdata, - dentry, ref, &devname); + /* + * this function gives us a path with a double backslash prefix. We + * require a single backslash for DFS. + */ + fullpath = build_path_from_dentry(dentry); + if (!fullpath) + return ERR_PTR(-ENOMEM); + + mountdata = cifs_compose_mount_options(cifs_sb->mountdata, + fullpath + 1, ref, &devname); + kfree(fullpath); if (IS_ERR(mountdata)) return (struct vfsmount *)mountdata; diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h index a069e7b..4167716 100644 --- a/fs/cifs/cifsproto.h +++ b/fs/cifs/cifsproto.h @@ -44,6 +44,9 @@ extern void _FreeXid(unsigned int); extern char *build_path_from_dentry(struct dentry *); extern char *cifs_build_path_to_root(struct cifs_sb_info *cifs_sb); extern char *build_wildcard_path_from_dentry(struct dentry *direntry); +extern char *cifs_compose_mount_options(const char *sb_mountdata, + const char *fullpath, const struct dfs_info3_param *ref, + char **devname); /* extern void renew_parental_timestamps(struct dentry *direntry);*/ extern int SendReceive(const unsigned int /* xid */ , struct cifsSesInfo *, struct smb_hdr * /* input */ , -- 1.6.0.2