From patchwork Fri Oct 22 19:14:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jvrao X-Patchwork-Id: 276311 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 o9MIt4Cq016620 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 22 Oct 2010 18:55:41 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1P9MlT-00081r-1d; Fri, 22 Oct 2010 18:54:55 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1P9MlR-00081P-3h for v9fs-developer@lists.sourceforge.net; Fri, 22 Oct 2010 18:54:53 +0000 X-ACL-Warn: Received: from e37.co.us.ibm.com ([32.97.110.158]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1P9MlP-0006Sl-Lz for v9fs-developer@lists.sourceforge.net; Fri, 22 Oct 2010 18:54:52 +0000 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by e37.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id o9MIqZHX027839 for ; Fri, 22 Oct 2010 12:52:35 -0600 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id o9MIsjne193912 for ; Fri, 22 Oct 2010 12:54:45 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o9MIsiaA006230 for ; Fri, 22 Oct 2010 12:54:45 -0600 Received: from localhost.localdomain (elm9m80.beaverton.ibm.com [9.47.81.80]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id o9MIshk5006175; Fri, 22 Oct 2010 12:54:43 -0600 From: "Venkateswararao Jujjuri (JV)" To: v9fs-developer@lists.sourceforge.net Date: Fri, 22 Oct 2010 12:14:45 -0700 Message-Id: <1287774885-19005-1-git-send-email-jvrao@linux.vnet.ibm.com> X-Mailer: git-send-email 1.6.0.6 X-Spam-Score: -0.3 (/) 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 -0.3 AWL AWL: From: address is in the auto white-list X-Headers-End: 1P9MlP-0006Sl-Lz Cc: linux-fsdevel@vger.kernel.org Subject: [V9fs-developer] [PATCH] [9p] Add datasync to client side TFSYNC/RFSYNC for dotl 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]); Fri, 22 Oct 2010 18:55:41 +0000 (UTC) diff --git a/fs/9p/v9fs_vfs.h b/fs/9p/v9fs_vfs.h index d26db19..bab0eac 100644 --- a/fs/9p/v9fs_vfs.h +++ b/fs/9p/v9fs_vfs.h @@ -65,5 +65,6 @@ int v9fs_uflags2omode(int uflags, int extended); ssize_t v9fs_file_readn(struct file *, char *, char __user *, u32, u64); void v9fs_blank_wstat(struct p9_wstat *wstat); int v9fs_vfs_setattr_dotl(struct dentry *, struct iattr *); +int v9fs_file_fsync_dotl(struct file *filp, int datasync); #define P9_LOCK_TIMEOUT (30*HZ) diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c index 170f5bb..b84ebe8 100644 --- a/fs/9p/vfs_dir.c +++ b/fs/9p/vfs_dir.c @@ -315,4 +315,5 @@ const struct file_operations v9fs_dir_operations_dotl = { .readdir = v9fs_dir_readdir_dotl, .open = v9fs_file_open, .release = v9fs_dir_release, + .fsync = v9fs_file_fsync_dotl, }; diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index 3a4352f..240c306 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c @@ -491,7 +491,7 @@ static int v9fs_file_fsync(struct file *filp, int datasync) return retval; } -static int v9fs_file_fsync_dotl(struct file *filp, int datasync) +int v9fs_file_fsync_dotl(struct file *filp, int datasync) { struct p9_fid *fid; int retval; @@ -501,7 +501,7 @@ static int v9fs_file_fsync_dotl(struct file *filp, int datasync) fid = filp->private_data; - retval = p9_client_fsync(fid); + retval = p9_client_fsync(fid, datasync); return retval; } diff --git a/include/net/9p/client.h b/include/net/9p/client.h index d22e17e..9cbaa30 100644 --- a/include/net/9p/client.h +++ b/include/net/9p/client.h @@ -232,7 +232,7 @@ int p9_client_symlink(struct p9_fid *fid, char *name, char *symname, gid_t gid, int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode, gid_t gid, struct p9_qid *qid); int p9_client_clunk(struct p9_fid *fid); -int p9_client_fsync(struct p9_fid *fid); +int p9_client_fsync(struct p9_fid *fid, int datasync); int p9_client_remove(struct p9_fid *fid); int p9_client_read(struct p9_fid *fid, char *data, char __user *udata, u64 offset, u32 count); diff --git a/net/9p/client.c b/net/9p/client.c index d5344d8..186f4e3 100644 --- a/net/9p/client.c +++ b/net/9p/client.c @@ -1213,17 +1213,18 @@ int p9_client_link(struct p9_fid *dfid, struct p9_fid *oldfid, char *newname) } EXPORT_SYMBOL(p9_client_link); -int p9_client_fsync(struct p9_fid *fid) +int p9_client_fsync(struct p9_fid *fid, int datasync) { int err; struct p9_client *clnt; struct p9_req_t *req; - P9_DPRINTK(P9_DEBUG_9P, ">>> TFSYNC fid %d\n", fid->fid); + P9_DPRINTK(P9_DEBUG_9P, ">>> TFSYNC fid %d datasync:%d\n", + fid->fid, datasync); err = 0; clnt = fid->clnt; - req = p9_client_rpc(clnt, P9_TFSYNC, "d", fid->fid); + req = p9_client_rpc(clnt, P9_TFSYNC, "dd", fid->fid, datasync); if (IS_ERR(req)) { err = PTR_ERR(req); goto error;