From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Venkateswararao Jujjuri (JV)" Subject: Re: [V9fs-developer] [PATCH 2/2] [9p] Introduce client side TFSYNC/RFSYNC for dotl. Date: Mon, 27 Sep 2010 08:54:20 -0700 Message-ID: <4CA0BE2C.7040803@linux.vnet.ibm.com> References: <1285376668-2234-1-git-send-email-jvrao@linux.vnet.ibm.com> <1285376668-2234-2-git-send-email-jvrao@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: v9fs-developer@lists.sourceforge.net, linux-fsdevel@vger.kernel.org To: Eric Van Hensbergen Return-path: Received: from e3.ny.us.ibm.com ([32.97.182.143]:51501 "EHLO e3.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755687Ab0I0Pyz (ORCPT ); Mon, 27 Sep 2010 11:54:55 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e3.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id o8RFcPiA025755 for ; Mon, 27 Sep 2010 11:38:25 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o8RFsccN096722 for ; Mon, 27 Sep 2010 11:54:38 -0400 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 o8RFsb5g003339 for ; Mon, 27 Sep 2010 09:54:37 -0600 In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 9/27/2010 5:59 AM, Eric Van Hensbergen wrote: > Remind me again why we need this? Don't blank twstats provide the > same functionality? WSTAT is a dotu operation, and we are overloading it to accomplish the sync. I think it is good idea to avoid overloading in dotl and especially if it is happening through dotu protocol. Also, we are trying to get 1-to-1 correspondence (where ever is possible) between Linux VFS and dotl. Thanks, JV > -eric > > > On Fri, Sep 24, 2010 at 8:04 PM, Venkateswararao Jujjuri (JV) > wrote: >> SYNOPSIS >> size[4] Tfsync tag[2] fid[4] >> >> size[4] Rfsync tag[2] >> >> DESCRIPTION >> >> The Tfsync transaction transfers ("flushes") all modified in-core data of >> file identified by fid to the disk device (or other permanent storage >> device) where that file resides. >> >> Signed-off-by: Venkateswararao Jujjuri >> --- >> fs/9p/vfs_file.c | 18 ++++++++++++++++-- >> include/net/9p/9p.h | 2 ++ >> include/net/9p/client.h | 1 + >> net/9p/client.c | 25 +++++++++++++++++++++++++ >> 4 files changed, 44 insertions(+), 2 deletions(-) >> >> diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c >> index 28db7fb..fdf3032 100644 >> --- a/fs/9p/vfs_file.c >> +++ b/fs/9p/vfs_file.c >> @@ -290,6 +290,20 @@ static int v9fs_file_fsync(struct file *filp, int datasync) >> return retval; >> } >> >> +static int v9fs_file_fsync_dotl(struct file *filp, int datasync) >> +{ >> + struct p9_fid *fid; >> + int retval; >> + >> + P9_DPRINTK(P9_DEBUG_VFS, "v9fs_file_fsync_dotl: filp %p datasync %x\n", >> + filp, datasync); >> + >> + fid = filp->private_data; >> + >> + retval = p9_client_fsync(fid); >> + return retval; >> +} >> + >> static const struct file_operations v9fs_cached_file_operations = { >> .llseek = generic_file_llseek, >> .read = do_sync_read, >> @@ -311,7 +325,7 @@ static const struct file_operations v9fs_cached_file_operations_dotl = { >> .release = v9fs_dir_release, >> .lock = v9fs_file_lock, >> .mmap = generic_file_readonly_mmap, >> - .fsync = v9fs_file_fsync, >> + .fsync = v9fs_file_fsync_dotl, >> }; >> >> const struct file_operations v9fs_file_operations = { >> @@ -333,5 +347,5 @@ const struct file_operations v9fs_file_operations_dotl = { >> .release = v9fs_dir_release, >> .lock = v9fs_file_lock, >> .mmap = generic_file_readonly_mmap, >> - .fsync = v9fs_file_fsync, >> + .fsync = v9fs_file_fsync_dotl, >> }; >> diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h >> index a4a1b04..55e9605 100644 >> --- a/include/net/9p/9p.h >> +++ b/include/net/9p/9p.h >> @@ -163,6 +163,8 @@ enum p9_msg_t { >> P9_RXATTRCREATE, >> P9_TREADDIR = 40, >> P9_RREADDIR, >> + P9_TFSYNC = 50, >> + P9_RFSYNC, >> P9_TLINK = 70, >> P9_RLINK, >> P9_TMKDIR = 72, >> diff --git a/include/net/9p/client.h b/include/net/9p/client.h >> index d1aa2cf..fbb23b4 100644 >> --- a/include/net/9p/client.h >> +++ b/include/net/9p/client.h >> @@ -232,6 +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_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 208efce..124241b 100644 >> --- a/net/9p/client.c >> +++ b/net/9p/client.c >> @@ -1211,6 +1211,31 @@ 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 err; >> + struct p9_client *clnt; >> + struct p9_req_t *req; >> + >> + P9_DPRINTK(P9_DEBUG_9P, ">>> TFSYNC fid %d\n", fid->fid); >> + err = 0; >> + clnt = fid->clnt; >> + >> + req = p9_client_rpc(clnt, P9_TFSYNC, "d", fid->fid); >> + if (IS_ERR(req)) { >> + err = PTR_ERR(req); >> + goto error; >> + } >> + >> + P9_DPRINTK(P9_DEBUG_9P, "<<< RFSYNC fid %d\n", fid->fid); >> + >> + p9_free_req(clnt, req); >> + >> +error: >> + return err; >> +} >> +EXPORT_SYMBOL(p9_client_fsync); >> + >> int p9_client_clunk(struct p9_fid *fid) >> { >> int err; >> -- >> 1.6.5.2 >> >> >> ------------------------------------------------------------------------------ >> Start uncovering the many advantages of virtual appliances >> and start using them to simplify application deployment and >> accelerate your shift to cloud computing. >> http://p.sf.net/sfu/novell-sfdev2dev >> _______________________________________________ >> V9fs-developer mailing list >> V9fs-developer@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/v9fs-developer >>