From patchwork Thu Mar 25 17:26:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Garlick X-Patchwork-Id: 88292 X-Patchwork-Delegate: ericvh@gmail.com Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2PHQlGY012943 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 25 Mar 2010 17:27:23 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NuqpN-0004E5-LH; Thu, 25 Mar 2010 17:26:41 +0000 Received: from sfi-mx-3.v28.ch3.sourceforge.com ([172.29.28.123] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NuqpM-0004Ds-Ae for v9fs-developer@lists.sourceforge.net; Thu, 25 Mar 2010 17:26:40 +0000 Received-SPF: pass (sfi-mx-3.v28.ch3.sourceforge.com: domain of llnl.gov designates 128.115.41.83 as permitted sender) client-ip=128.115.41.83; envelope-from=garlick@llnl.gov; helo=smtp.llnl.gov; Received: from nspiron-3.llnl.gov ([128.115.41.83] helo=smtp.llnl.gov) by sfi-mx-3.v28.ch3.sourceforge.com with esmtp (Exim 4.69) id 1NuqpL-000235-2O for v9fs-developer@lists.sourceforge.net; Thu, 25 Mar 2010 17:26:40 +0000 X-Attachments: None Received: from eris.llnl.gov ([134.9.2.84]) by smtp.llnl.gov with ESMTP; 25 Mar 2010 10:26:33 -0700 Received: from mrhankey.llnl.gov (mrhankey [192.168.1.135]) by eris.llnl.gov (Postfix) with ESMTP id 3D59C7C4A5; Thu, 25 Mar 2010 10:26:33 -0700 (PDT) Received: from mrhankey.llnl.gov (localhost.localdomain [127.0.0.1]) by mrhankey.llnl.gov (8.13.8/8.13.8) with ESMTP id o2PHQXQH026579; Thu, 25 Mar 2010 10:26:33 -0700 Received: (from garlick@localhost) by mrhankey.llnl.gov (8.13.8/8.13.8/Submit) id o2PHQWtR026578; Thu, 25 Mar 2010 10:26:32 -0700 From: Jim Garlick To: v9fs-developer@lists.sourceforge.net Date: Thu, 25 Mar 2010 10:26:32 -0700 Message-Id: <1269537992-26559-1-git-send-email-garlick@llnl.gov> X-Mailer: git-send-email 1.5.4.5 X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1NuqpL-000235-2O Cc: Jim Garlick Subject: [V9fs-developer] [PATCH 1/1] 9p: enable .u protocol changes if .L. X-BeenThere: v9fs-developer@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: v9fs-developer-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 25 Mar 2010 17:27:23 +0000 (UTC) diff --git a/fs/9p/fid.c b/fs/9p/fid.c index 08b2eb1..b20fbaa 100644 --- a/fs/9p/fid.c +++ b/fs/9p/fid.c @@ -151,7 +151,7 @@ struct p9_fid *v9fs_fid_lookup(struct dentry *dentry) if (access == V9FS_ACCESS_SINGLE) return ERR_PTR(-EPERM); - if (v9fs_proto_dotu(v9ses)) + if (v9fs_proto_dotu(v9ses) || v9fs_proto_dotl(v9ses)) uname = NULL; else uname = v9ses->uname; diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index df52d48..1985786 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c @@ -61,7 +61,8 @@ int v9fs_file_open(struct inode *inode, struct file *file) P9_DPRINTK(P9_DEBUG_VFS, "inode: %p file: %p \n", inode, file); v9ses = v9fs_inode2v9ses(inode); - omode = v9fs_uflags2omode(file->f_flags, v9fs_proto_dotu(v9ses)); + omode = v9fs_uflags2omode(file->f_flags, + v9fs_proto_dotu(v9ses) || v9fs_proto_dotl(v9ses)); fid = file->private_data; if (!fid) { fid = v9fs_fid_clone(file->f_path.dentry); @@ -77,7 +78,8 @@ int v9fs_file_open(struct inode *inode, struct file *file) i_size_write(inode, 0); inode->i_blocks = 0; } - if ((file->f_flags & O_APPEND) && (!v9fs_proto_dotu(v9ses))) + if ((file->f_flags & O_APPEND) && !v9fs_proto_dotu(v9ses) + && !v9fs_proto_dotl(v9ses)) generic_file_llseek(file, 0, SEEK_END); } diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 5fe45d6..9143586 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -60,7 +60,7 @@ static int unixmode2p9mode(struct v9fs_session_info *v9ses, int mode) res = mode & 0777; if (S_ISDIR(mode)) res |= P9_DMDIR; - if (v9fs_proto_dotu(v9ses)) { + if (v9fs_proto_dotu(v9ses) || v9fs_proto_dotl(v9ses)) { if (S_ISLNK(mode)) res |= P9_DMSYMLINK; if (v9ses->nodev == 0) { @@ -97,26 +97,24 @@ static int unixmode2p9mode(struct v9fs_session_info *v9ses, int mode) static int p9mode2unixmode(struct v9fs_session_info *v9ses, int mode) { int res; + int extended = (v9fs_proto_dotu(v9ses) || v9fs_proto_dotl(v9ses)); res = mode & 0777; if ((mode & P9_DMDIR) == P9_DMDIR) res |= S_IFDIR; - else if ((mode & P9_DMSYMLINK) && (v9fs_proto_dotu(v9ses))) + else if ((mode & P9_DMSYMLINK) && extended) res |= S_IFLNK; - else if ((mode & P9_DMSOCKET) && (v9fs_proto_dotu(v9ses)) - && (v9ses->nodev == 0)) + else if ((mode & P9_DMSOCKET) && extended && (v9ses->nodev == 0)) res |= S_IFSOCK; - else if ((mode & P9_DMNAMEDPIPE) && (v9fs_proto_dotu(v9ses)) - && (v9ses->nodev == 0)) + else if ((mode & P9_DMNAMEDPIPE) && extended && (v9ses->nodev == 0)) res |= S_IFIFO; - else if ((mode & P9_DMDEVICE) && (v9fs_proto_dotu(v9ses)) - && (v9ses->nodev == 0)) + else if ((mode & P9_DMDEVICE) && extended && (v9ses->nodev == 0)) res |= S_IFBLK; else res |= S_IFREG; - if (v9fs_proto_dotu(v9ses)) { + if (extended) { if ((mode & P9_DMSETUID) == P9_DMSETUID) res |= S_ISUID; @@ -265,7 +263,7 @@ struct inode *v9fs_get_inode(struct super_block *sb, int mode) case S_IFBLK: case S_IFCHR: case S_IFSOCK: - if (!v9fs_proto_dotu(v9ses)) { + if (!v9fs_proto_dotu(v9ses) && !v9fs_proto_dotl(v9ses)) { P9_DPRINTK(P9_DEBUG_ERROR, "special files without extended mode\n"); err = -EINVAL; @@ -278,7 +276,7 @@ struct inode *v9fs_get_inode(struct super_block *sb, int mode) inode->i_fop = &v9fs_file_operations; break; case S_IFLNK: - if (!v9fs_proto_dotu(v9ses)) { + if (!v9fs_proto_dotu(v9ses) && !v9fs_proto_dotl(v9ses)) { P9_DPRINTK(P9_DEBUG_ERROR, "extended modes used w/o 9P2000.u\n"); err = -EINVAL; @@ -288,7 +286,7 @@ struct inode *v9fs_get_inode(struct super_block *sb, int mode) break; case S_IFDIR: inc_nlink(inode); - if (v9fs_proto_dotu(v9ses)) + if (v9fs_proto_dotu(v9ses) || v9fs_proto_dotl(v9ses)) inode->i_op = &v9fs_dir_inode_operations_ext; else inode->i_op = &v9fs_dir_inode_operations; @@ -575,8 +573,8 @@ v9fs_vfs_create(struct inode *dir, struct dentry *dentry, int mode, flags = O_RDWR; fid = v9fs_create(v9ses, dir, dentry, NULL, perm, - v9fs_uflags2omode(flags, - v9fs_proto_dotu(v9ses))); + v9fs_uflags2omode(flags, v9fs_proto_dotu(v9ses) + || v9fs_proto_dotl(v9ses))); if (IS_ERR(fid)) { err = PTR_ERR(fid); fid = NULL; @@ -859,7 +857,7 @@ static int v9fs_vfs_setattr(struct dentry *dentry, struct iattr *iattr) if (iattr->ia_valid & ATTR_SIZE) wstat.length = iattr->ia_size; - if (v9fs_proto_dotu(v9ses)) { + if (v9fs_proto_dotu(v9ses) || v9fs_proto_dotl(v9ses)) { if (iattr->ia_valid & ATTR_UID) wstat.n_uid = iattr->ia_uid; @@ -900,12 +898,13 @@ v9fs_stat2inode(struct p9_wstat *stat, struct inode *inode, inode->i_uid = v9ses->dfltuid; inode->i_gid = v9ses->dfltgid; - if (v9fs_proto_dotu(v9ses)) { + if (v9fs_proto_dotu(v9ses) || v9fs_proto_dotl(v9ses)) { inode->i_uid = stat->n_uid; inode->i_gid = stat->n_gid; } if ((S_ISREG(inode->i_mode)) || (S_ISDIR(inode->i_mode))) { - if (v9fs_proto_dotu(v9ses) && (stat->extension[0] != '\0')) { + if ((v9fs_proto_dotu(v9ses) || v9fs_proto_dotl(v9ses)) + && (stat->extension[0] != '\0')) { /* * Hadlink support got added later to * to the .u extension. So there can be @@ -994,7 +993,7 @@ static int v9fs_readlink(struct dentry *dentry, char *buffer, int buflen) if (IS_ERR(fid)) return PTR_ERR(fid); - if (!v9fs_proto_dotu(v9ses)) + if (!v9fs_proto_dotu(v9ses) && !v9fs_proto_dotl(v9ses)) return -EBADF; st = p9_client_stat(fid); @@ -1084,7 +1083,7 @@ static int v9fs_vfs_mkspecial(struct inode *dir, struct dentry *dentry, struct p9_fid *fid; v9ses = v9fs_inode2v9ses(dir); - if (!v9fs_proto_dotu(v9ses)) { + if (!v9fs_proto_dotu(v9ses) && !v9fs_proto_dotl(v9ses)) { P9_DPRINTK(P9_DEBUG_ERROR, "not extended\n"); return -EPERM; }