From patchwork Tue Oct 5 17:01:28 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 233341 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o95H2RxC018567 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 5 Oct 2010 17:02:51 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1P3AuC-0005jC-Mb; Tue, 05 Oct 2010 17:02:20 +0000 Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1P3AuB-0005j7-82 for v9fs-developer@lists.sourceforge.net; Tue, 05 Oct 2010 17:02:19 +0000 X-ACL-Warn: Received: from e28smtp03.in.ibm.com ([122.248.162.3]) by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1P3Au1-0007CY-9w for v9fs-developer@lists.sourceforge.net; Tue, 05 Oct 2010 17:02:19 +0000 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by e28smtp03.in.ibm.com (8.14.4/8.13.1) with ESMTP id o95H1bYV007377 for ; Tue, 5 Oct 2010 22:31:37 +0530 Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o95H1bZF2855070 for ; Tue, 5 Oct 2010 22:31:37 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o95H1aMB017640 for ; Tue, 5 Oct 2010 22:31:36 +0530 Received: from localhost.localdomain ([9.77.201.212]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id o95H1Ygw017328; Tue, 5 Oct 2010 22:31:35 +0530 From: "Aneesh Kumar K.V" To: v9fs-developer@lists.sourceforge.net Date: Tue, 5 Oct 2010 22:31:28 +0530 Message-Id: <1286298090-2422-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.0.4 X-Spam-Score: -0.0 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain X-Headers-End: 1P3Au1-0007CY-9w Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [V9fs-developer] [PATCH 1/3] fs/9p: Update TLCREATE to allow create without open 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 (demeter1.kernel.org [140.211.167.41]); Tue, 05 Oct 2010 17:02:51 +0000 (UTC) diff --git a/fs/9p/v9fs.h b/fs/9p/v9fs.h index 8bb7792..6209a29 100644 --- a/fs/9p/v9fs.h +++ b/fs/9p/v9fs.h @@ -126,6 +126,8 @@ void v9fs_session_begin_cancel(struct v9fs_session_info *v9ses); #define V9FS_DEFUID (-2) #define V9FS_DEFGID (-2) +#define P9_LOOKUP_OPEN 0x1 + static inline struct v9fs_session_info *v9fs_inode2v9ses(struct inode *inode) { return (inode->i_sb->s_fs_info); diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 2f904a8..1ec9075 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -668,8 +668,9 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, int omode, int err = 0; char *name = NULL; gid_t gid; - int flags; + int flags = 0; mode_t mode; + int lookup_flags = 0; struct v9fs_session_info *v9ses; struct p9_fid *fid = NULL; struct p9_fid *dfid, *ofid; @@ -679,11 +680,10 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, int omode, struct posix_acl *pacl = NULL, *dacl = NULL; v9ses = v9fs_inode2v9ses(dir); - if (nd && nd->flags & LOOKUP_OPEN) + if (nd && nd->flags & LOOKUP_OPEN) { flags = nd->intent.open.flags - 1; - else - flags = O_RDWR; - + lookup_flags = P9_LOOKUP_OPEN; + } name = (char *) dentry->d_name.name; P9_DPRINTK(P9_DEBUG_VFS, "v9fs_vfs_create_dotl: name:%s flags:0x%x " "mode:0x%x\n", name, flags, omode); @@ -713,7 +713,8 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, int omode, "Failed to get acl values in creat %d\n", err); goto error; } - err = p9_client_create_dotl(ofid, name, flags, mode, gid, &qid); + err = p9_client_create_dotl(ofid, name, flags, mode, + gid, lookup_flags, &qid); if (err < 0) { P9_DPRINTK(P9_DEBUG_VFS, "p9_client_open_dotl failed in creat %d\n", diff --git a/include/net/9p/client.h b/include/net/9p/client.h index fb358f5..b0b97ec 100644 --- a/include/net/9p/client.h +++ b/include/net/9p/client.h @@ -230,7 +230,7 @@ int p9_client_link(struct p9_fid *fid, struct p9_fid *oldfid, char *newname); int p9_client_symlink(struct p9_fid *fid, char *name, char *symname, gid_t gid, struct p9_qid *qid); int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode, - gid_t gid, struct p9_qid *qid); + gid_t gid, int lookup_flags, struct p9_qid *qid); int p9_client_clunk(struct p9_fid *fid); int p9_client_remove(struct p9_fid *fid); int p9_client_read(struct p9_fid *fid, char *data, char __user *udata, diff --git a/net/9p/client.c b/net/9p/client.c index 4b90b82..9950275 100644 --- a/net/9p/client.c +++ b/net/9p/client.c @@ -1070,7 +1070,7 @@ error: EXPORT_SYMBOL(p9_client_open); int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode, - gid_t gid, struct p9_qid *qid) + gid_t gid, int lookup_flags, struct p9_qid *qid) { int err = 0; struct p9_client *clnt; @@ -1085,8 +1085,8 @@ int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode, if (ofid->mode != -1) return -EINVAL; - req = p9_client_rpc(clnt, P9_TLCREATE, "dsddd", ofid->fid, name, flags, - mode, gid); + req = p9_client_rpc(clnt, P9_TLCREATE, "dsdddd", ofid->fid, name, flags, + mode, gid, lookup_flags); if (IS_ERR(req)) { err = PTR_ERR(req); goto error;