From patchwork Wed Aug 4 14:11:43 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Metzmacher X-Patchwork-Id: 117044 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o74ECAae020389 for ; Wed, 4 Aug 2010 14:13:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758054Ab0HDOMJ (ORCPT ); Wed, 4 Aug 2010 10:12:09 -0400 Received: from mo-p05-ob.rzone.de ([81.169.146.180]:42303 "EHLO mo-p05-ob.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758040Ab0HDOMI (ORCPT ); Wed, 4 Aug 2010 10:12:08 -0400 X-RZG-AUTH: :IXQkeEW8Yfo/5haL0ckzWIsAYh739YBunhBBa3aNBybZ0RbCJO+qMzncuA== X-RZG-CLASS-ID: mo05 Received: from localhost.localdomain (xdsl-78-34-239-115.netcologne.de [78.34.239.115]) by post.strato.de (fruni mo33) (RZmta 23.4) with (EDH-RSA-DES-CBC3-SHA encrypted) ESMTP id c04253m74DdRcl ; Wed, 4 Aug 2010 16:12:04 +0200 (MEST) From: Stefan Metzmacher To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org, Stefan Metzmacher Subject: [PATCH 2/8] cifs: add CIFSCreateMFSymLink() and CIFSQueryMFSymLink() as stubs Date: Wed, 4 Aug 2010 16:11:43 +0200 Message-Id: <1280931109-22380-3-git-send-email-metze@samba.org> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: References: Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 04 Aug 2010 14:13:06 +0000 (UTC) diff --git a/fs/cifs/link.c b/fs/cifs/link.c index 473ca80..2358a5f 100644 --- a/fs/cifs/link.c +++ b/fs/cifs/link.c @@ -29,6 +29,24 @@ #include "cifs_debug.h" #include "cifs_fs_sb.h" +static int +CIFSCreateMFSymLink(const int xid, struct cifsTconInfo *tcon, + const char *fromName, const char *toName, + const struct nls_table *nls_codepage) +{ + int rc = -EOPNOTSUPP; + return rc; +} + +static int +CIFSQueryMFSymLink(const int xid, struct cifsTconInfo *tcon, + const unsigned char *searchName, char **symlinkinfo, + const struct nls_table *nls_codepage) +{ + int rc = -EOPNOTSUPP; + return rc; +} + int cifs_hardlink(struct dentry *old_file, struct inode *inode, struct dentry *direntry) @@ -130,7 +148,8 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd) * but there doesn't seem to be any harm in allowing the client to * read them. */ - if (!(tcon->ses->capabilities & CAP_UNIX)) { + if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) + && !(tcon->ses->capabilities & CAP_UNIX)) { rc = -EACCES; goto out; } @@ -141,8 +160,12 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd) cFYI(1, "Full path: %s inode = 0x%p", full_path, inode); - rc = CIFSSMBUnixQuerySymLink(xid, tcon, full_path, &target_path, - cifs_sb->local_nls); + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) + rc = CIFSQueryMFSymLink(xid, tcon, full_path, &target_path, + cifs_sb->local_nls); + else + rc = CIFSSMBUnixQuerySymLink(xid, tcon, full_path, &target_path, + cifs_sb->local_nls); kfree(full_path); out: if (rc != 0) { @@ -182,7 +205,10 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname) cFYI(1, "symname is %s", symname); /* BB what if DFS and this volume is on different share? BB */ - if (pTcon->unix_ext) + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) + rc = CIFSCreateMFSymLink(xid, pTcon, full_path, symname, + cifs_sb->local_nls); + else if (pTcon->unix_ext) rc = CIFSUnixCreateSymLink(xid, pTcon, full_path, symname, cifs_sb->local_nls); /* else