diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-20 13:44:27 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-20 13:44:27 -0500 |
commit | 788e7a89a03e364855583c0ab4649b94925efbb9 (patch) | |
tree | 4434c93af133a92f550ba0ecc8d3254cb222e72d /include | |
parent | 7117bf3dfb10b534a017260d9fc643bc1d0afd2a (diff) |
NFS: Cleanup of NFS write code in preparation for asynchronous o_direct
This patch inverts the callback hierarchy for NFS write calls.
Instead of having the NFSv2/v3/v4-specific code set up the RPC callback
ops, we allow the original caller to do so. This allows for more
flexibility w.r.t. how to set up and tear down the nfs_write_data
structure while still allowing the NFSv3/v4 code to perform error
handling.
The greater flexibility is needed by the asynchronous O_DIRECT code, which
wants to be able to hold on to the original nfs_write_data structures after
the WRITE RPC call has completed in order to be able to replay them if the
COMMIT call determines that the server has rebooted.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/nfs_fs.h | 7 | ||||
-rw-r--r-- | include/linux/nfs_xdr.h | 3 |
2 files changed, 2 insertions, 8 deletions
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index b71da4d4b137..782e59765696 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -407,13 +407,6 @@ extern int nfs_writepage(struct page *page, struct writeback_control *wbc); | |||
407 | extern int nfs_writepages(struct address_space *, struct writeback_control *); | 407 | extern int nfs_writepages(struct address_space *, struct writeback_control *); |
408 | extern int nfs_flush_incompatible(struct file *file, struct page *page); | 408 | extern int nfs_flush_incompatible(struct file *file, struct page *page); |
409 | extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int); | 409 | extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int); |
410 | extern void nfs_writeback_done(struct rpc_task *task, void *data); | ||
411 | extern void nfs_writedata_release(void *data); | ||
412 | |||
413 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) | ||
414 | extern void nfs_commit_done(struct rpc_task *, void *data); | ||
415 | extern void nfs_commit_release(void *data); | ||
416 | #endif | ||
417 | 410 | ||
418 | /* | 411 | /* |
419 | * Try to write back everything synchronously (but check the | 412 | * Try to write back everything synchronously (but check the |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 6d6f69ec5675..277750cc70c0 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -714,7 +714,6 @@ struct nfs_write_data { | |||
714 | #ifdef CONFIG_NFS_V4 | 714 | #ifdef CONFIG_NFS_V4 |
715 | unsigned long timestamp; /* For lease renewal */ | 715 | unsigned long timestamp; /* For lease renewal */ |
716 | #endif | 716 | #endif |
717 | void (*complete) (struct nfs_write_data *, int); | ||
718 | struct page *page_array[NFS_PAGEVEC_SIZE + 1]; | 717 | struct page *page_array[NFS_PAGEVEC_SIZE + 1]; |
719 | }; | 718 | }; |
720 | 719 | ||
@@ -770,7 +769,9 @@ struct nfs_rpc_ops { | |||
770 | u32 * (*decode_dirent)(u32 *, struct nfs_entry *, int plus); | 769 | u32 * (*decode_dirent)(u32 *, struct nfs_entry *, int plus); |
771 | void (*read_setup) (struct nfs_read_data *); | 770 | void (*read_setup) (struct nfs_read_data *); |
772 | void (*write_setup) (struct nfs_write_data *, int how); | 771 | void (*write_setup) (struct nfs_write_data *, int how); |
772 | int (*write_done) (struct rpc_task *, struct nfs_write_data *); | ||
773 | void (*commit_setup) (struct nfs_write_data *, int how); | 773 | void (*commit_setup) (struct nfs_write_data *, int how); |
774 | int (*commit_done) (struct rpc_task *, struct nfs_write_data *); | ||
774 | int (*file_open) (struct inode *, struct file *); | 775 | int (*file_open) (struct inode *, struct file *); |
775 | int (*file_release) (struct inode *, struct file *); | 776 | int (*file_release) (struct inode *, struct file *); |
776 | int (*lock)(struct file *, int, struct file_lock *); | 777 | int (*lock)(struct file *, int, struct file_lock *); |