diff options
author | Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com> | 2010-09-22 20:19:19 -0400 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2010-10-28 10:08:47 -0400 |
commit | 920e65dc6911da28a58e17f4b683302636fc6d8e (patch) | |
tree | 761280ee48576a45d13df5df685ea6b9da7fd775 | |
parent | b04faaf3717307cd976a15667c8c24161c1d24ef (diff) |
[9p] Introduce client side TFSYNC/RFSYNC for dotl.
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 <jvrao@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
-rw-r--r-- | fs/9p/vfs_file.c | 18 | ||||
-rw-r--r-- | include/net/9p/9p.h | 2 | ||||
-rw-r--r-- | include/net/9p/client.h | 1 | ||||
-rw-r--r-- | 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 28db7fb1d96..fdf303207c7 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) | |||
290 | return retval; | 290 | return retval; |
291 | } | 291 | } |
292 | 292 | ||
293 | static int v9fs_file_fsync_dotl(struct file *filp, int datasync) | ||
294 | { | ||
295 | struct p9_fid *fid; | ||
296 | int retval; | ||
297 | |||
298 | P9_DPRINTK(P9_DEBUG_VFS, "v9fs_file_fsync_dotl: filp %p datasync %x\n", | ||
299 | filp, datasync); | ||
300 | |||
301 | fid = filp->private_data; | ||
302 | |||
303 | retval = p9_client_fsync(fid); | ||
304 | return retval; | ||
305 | } | ||
306 | |||
293 | static const struct file_operations v9fs_cached_file_operations = { | 307 | static const struct file_operations v9fs_cached_file_operations = { |
294 | .llseek = generic_file_llseek, | 308 | .llseek = generic_file_llseek, |
295 | .read = do_sync_read, | 309 | .read = do_sync_read, |
@@ -311,7 +325,7 @@ static const struct file_operations v9fs_cached_file_operations_dotl = { | |||
311 | .release = v9fs_dir_release, | 325 | .release = v9fs_dir_release, |
312 | .lock = v9fs_file_lock, | 326 | .lock = v9fs_file_lock, |
313 | .mmap = generic_file_readonly_mmap, | 327 | .mmap = generic_file_readonly_mmap, |
314 | .fsync = v9fs_file_fsync, | 328 | .fsync = v9fs_file_fsync_dotl, |
315 | }; | 329 | }; |
316 | 330 | ||
317 | const struct file_operations v9fs_file_operations = { | 331 | const struct file_operations v9fs_file_operations = { |
@@ -333,5 +347,5 @@ const struct file_operations v9fs_file_operations_dotl = { | |||
333 | .release = v9fs_dir_release, | 347 | .release = v9fs_dir_release, |
334 | .lock = v9fs_file_lock, | 348 | .lock = v9fs_file_lock, |
335 | .mmap = generic_file_readonly_mmap, | 349 | .mmap = generic_file_readonly_mmap, |
336 | .fsync = v9fs_file_fsync, | 350 | .fsync = v9fs_file_fsync_dotl, |
337 | }; | 351 | }; |
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h index a4a1b043a8c..55e96057f47 100644 --- a/include/net/9p/9p.h +++ b/include/net/9p/9p.h | |||
@@ -163,6 +163,8 @@ enum p9_msg_t { | |||
163 | P9_RXATTRCREATE, | 163 | P9_RXATTRCREATE, |
164 | P9_TREADDIR = 40, | 164 | P9_TREADDIR = 40, |
165 | P9_RREADDIR, | 165 | P9_RREADDIR, |
166 | P9_TFSYNC = 50, | ||
167 | P9_RFSYNC, | ||
166 | P9_TLINK = 70, | 168 | P9_TLINK = 70, |
167 | P9_RLINK, | 169 | P9_RLINK, |
168 | P9_TMKDIR = 72, | 170 | P9_TMKDIR = 72, |
diff --git a/include/net/9p/client.h b/include/net/9p/client.h index 7f63d5ab7b4..8744e3ad4a0 100644 --- a/include/net/9p/client.h +++ b/include/net/9p/client.h | |||
@@ -229,6 +229,7 @@ int p9_client_symlink(struct p9_fid *fid, char *name, char *symname, gid_t gid, | |||
229 | int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode, | 229 | int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode, |
230 | gid_t gid, struct p9_qid *qid); | 230 | gid_t gid, struct p9_qid *qid); |
231 | int p9_client_clunk(struct p9_fid *fid); | 231 | int p9_client_clunk(struct p9_fid *fid); |
232 | int p9_client_fsync(struct p9_fid *fid); | ||
232 | int p9_client_remove(struct p9_fid *fid); | 233 | int p9_client_remove(struct p9_fid *fid); |
233 | int p9_client_read(struct p9_fid *fid, char *data, char __user *udata, | 234 | int p9_client_read(struct p9_fid *fid, char *data, char __user *udata, |
234 | u64 offset, u32 count); | 235 | u64 offset, u32 count); |
diff --git a/net/9p/client.c b/net/9p/client.c index e50ec802937..30c4a1b224f 100644 --- a/net/9p/client.c +++ b/net/9p/client.c | |||
@@ -1162,6 +1162,31 @@ int p9_client_link(struct p9_fid *dfid, struct p9_fid *oldfid, char *newname) | |||
1162 | } | 1162 | } |
1163 | EXPORT_SYMBOL(p9_client_link); | 1163 | EXPORT_SYMBOL(p9_client_link); |
1164 | 1164 | ||
1165 | int p9_client_fsync(struct p9_fid *fid) | ||
1166 | { | ||
1167 | int err; | ||
1168 | struct p9_client *clnt; | ||
1169 | struct p9_req_t *req; | ||
1170 | |||
1171 | P9_DPRINTK(P9_DEBUG_9P, ">>> TFSYNC fid %d\n", fid->fid); | ||
1172 | err = 0; | ||
1173 | clnt = fid->clnt; | ||
1174 | |||
1175 | req = p9_client_rpc(clnt, P9_TFSYNC, "d", fid->fid); | ||
1176 | if (IS_ERR(req)) { | ||
1177 | err = PTR_ERR(req); | ||
1178 | goto error; | ||
1179 | } | ||
1180 | |||
1181 | P9_DPRINTK(P9_DEBUG_9P, "<<< RFSYNC fid %d\n", fid->fid); | ||
1182 | |||
1183 | p9_free_req(clnt, req); | ||
1184 | |||
1185 | error: | ||
1186 | return err; | ||
1187 | } | ||
1188 | EXPORT_SYMBOL(p9_client_fsync); | ||
1189 | |||
1165 | int p9_client_clunk(struct p9_fid *fid) | 1190 | int p9_client_clunk(struct p9_fid *fid) |
1166 | { | 1191 | { |
1167 | int err; | 1192 | int err; |