Skip to content

Commit

Permalink
9p: Add datasync to client side TFSYNC/RFSYNC for dotl
Browse files Browse the repository at this point in the history
SYNOPSIS
    size[4] Tfsync tag[2] fid[4] datasync[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.

    If datasync flag is specified data will be fleshed but does not flush
    modified metadata unless  that  metadata  is  needed  in order to allow a
    subsequent data retrieval to be correctly handled.

Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
  • Loading branch information
Venkateswararao Jujjuri (JV) authored and ericvh committed Oct 28, 2010
1 parent 7b3bb3f commit b165d60
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions fs/9p/v9fs_vfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
1 change: 1 addition & 0 deletions fs/9p/vfs_dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
4 changes: 2 additions & 2 deletions fs/9p/vfs_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion include/net/9p/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,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);
Expand Down
7 changes: 4 additions & 3 deletions net/9p/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1165,17 +1165,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;
Expand Down

0 comments on commit b165d60

Please sign in to comment.