aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/nfs_fs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/nfs_fs.h')
-rw-r--r--include/linux/nfs_fs.h39
1 files changed, 10 insertions, 29 deletions
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 45228c1a1195..04963063e620 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -33,6 +33,7 @@
33#define FLUSH_HIGHPRI 16 /* high priority memory reclaim flush */ 33#define FLUSH_HIGHPRI 16 /* high priority memory reclaim flush */
34#define FLUSH_NOCOMMIT 32 /* Don't send the NFSv3/v4 COMMIT */ 34#define FLUSH_NOCOMMIT 32 /* Don't send the NFSv3/v4 COMMIT */
35#define FLUSH_INVALIDATE 64 /* Invalidate the page cache */ 35#define FLUSH_INVALIDATE 64 /* Invalidate the page cache */
36#define FLUSH_NOWRITEPAGE 128 /* Don't call writepage() */
36 37
37#ifdef __KERNEL__ 38#ifdef __KERNEL__
38 39
@@ -318,7 +319,7 @@ extern void put_nfs_open_context(struct nfs_open_context *ctx);
318extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode); 319extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode);
319 320
320/* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ 321/* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */
321extern u32 root_nfs_parse_addr(char *name); /*__init*/ 322extern __be32 root_nfs_parse_addr(char *name); /*__init*/
322 323
323static inline void nfs_fattr_init(struct nfs_fattr *fattr) 324static inline void nfs_fattr_init(struct nfs_fattr *fattr)
324{ 325{
@@ -427,19 +428,21 @@ extern int nfs_flush_incompatible(struct file *file, struct page *page);
427extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int); 428extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int);
428extern int nfs_writeback_done(struct rpc_task *, struct nfs_write_data *); 429extern int nfs_writeback_done(struct rpc_task *, struct nfs_write_data *);
429extern void nfs_writedata_release(void *); 430extern void nfs_writedata_release(void *);
430 431extern int nfs_set_page_dirty(struct page *);
431#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
432struct nfs_write_data *nfs_commit_alloc(void);
433void nfs_commit_free(struct nfs_write_data *p);
434#endif
435 432
436/* 433/*
437 * Try to write back everything synchronously (but check the 434 * Try to write back everything synchronously (but check the
438 * return value!) 435 * return value!)
439 */ 436 */
440extern int nfs_sync_inode_wait(struct inode *, unsigned long, unsigned int, int); 437extern long nfs_sync_mapping_wait(struct address_space *, struct writeback_control *, int);
438extern int nfs_sync_mapping_range(struct address_space *, loff_t, loff_t, int);
439extern int nfs_wb_all(struct inode *inode);
440extern int nfs_wb_page(struct inode *inode, struct page* page);
441extern int nfs_wb_page_priority(struct inode *inode, struct page* page, int how);
441#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) 442#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
442extern int nfs_commit_inode(struct inode *, int); 443extern int nfs_commit_inode(struct inode *, int);
444extern struct nfs_write_data *nfs_commit_alloc(void);
445extern void nfs_commit_free(struct nfs_write_data *wdata);
443extern void nfs_commit_release(void *wdata); 446extern void nfs_commit_release(void *wdata);
444#else 447#else
445static inline int 448static inline int
@@ -455,28 +458,6 @@ nfs_have_writebacks(struct inode *inode)
455 return NFS_I(inode)->npages != 0; 458 return NFS_I(inode)->npages != 0;
456} 459}
457 460
458static inline int
459nfs_wb_all(struct inode *inode)
460{
461 int error = nfs_sync_inode_wait(inode, 0, 0, 0);
462 return (error < 0) ? error : 0;
463}
464
465/*
466 * Write back all requests on one page - we do this before reading it.
467 */
468static inline int nfs_wb_page_priority(struct inode *inode, struct page* page, int how)
469{
470 int error = nfs_sync_inode_wait(inode, page->index, 1,
471 how | FLUSH_STABLE);
472 return (error < 0) ? error : 0;
473}
474
475static inline int nfs_wb_page(struct inode *inode, struct page* page)
476{
477 return nfs_wb_page_priority(inode, page, 0);
478}
479
480/* 461/*
481 * Allocate nfs_write_data structures 462 * Allocate nfs_write_data structures
482 */ 463 */