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.h66
1 files changed, 55 insertions, 11 deletions
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 12787a9b0259..547d649b274e 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -38,9 +38,6 @@
38# define NFS_DEBUG 38# define NFS_DEBUG
39#endif 39#endif
40 40
41#define NFS_MAX_FILE_IO_BUFFER_SIZE 32768
42#define NFS_DEF_FILE_IO_BUFFER_SIZE 4096
43
44/* Default timeout values */ 41/* Default timeout values */
45#define NFS_MAX_UDP_TIMEOUT (60*HZ) 42#define NFS_MAX_UDP_TIMEOUT (60*HZ)
46#define NFS_MAX_TCP_TIMEOUT (600*HZ) 43#define NFS_MAX_TCP_TIMEOUT (600*HZ)
@@ -65,6 +62,7 @@
65#define FLUSH_STABLE 4 /* commit to stable storage */ 62#define FLUSH_STABLE 4 /* commit to stable storage */
66#define FLUSH_LOWPRI 8 /* low priority background flush */ 63#define FLUSH_LOWPRI 8 /* low priority background flush */
67#define FLUSH_HIGHPRI 16 /* high priority memory reclaim flush */ 64#define FLUSH_HIGHPRI 16 /* high priority memory reclaim flush */
65#define FLUSH_NOCOMMIT 32 /* Don't send the NFSv3/v4 COMMIT */
68 66
69#ifdef __KERNEL__ 67#ifdef __KERNEL__
70 68
@@ -291,6 +289,7 @@ static inline int nfs_verify_change_attribute(struct inode *inode, unsigned long
291/* 289/*
292 * linux/fs/nfs/inode.c 290 * linux/fs/nfs/inode.c
293 */ 291 */
292extern int nfs_sync_mapping(struct address_space *mapping);
294extern void nfs_zap_caches(struct inode *); 293extern void nfs_zap_caches(struct inode *);
295extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *, 294extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *,
296 struct nfs_fattr *); 295 struct nfs_fattr *);
@@ -393,6 +392,17 @@ extern int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fh, struct nfs_
393extern struct inode_operations nfs_symlink_inode_operations; 392extern struct inode_operations nfs_symlink_inode_operations;
394 393
395/* 394/*
395 * linux/fs/nfs/sysctl.c
396 */
397#ifdef CONFIG_SYSCTL
398extern int nfs_register_sysctl(void);
399extern void nfs_unregister_sysctl(void);
400#else
401#define nfs_register_sysctl() do { } while(0)
402#define nfs_unregister_sysctl() do { } while(0)
403#endif
404
405/*
396 * linux/fs/nfs/unlink.c 406 * linux/fs/nfs/unlink.c
397 */ 407 */
398extern int nfs_async_unlink(struct dentry *); 408extern int nfs_async_unlink(struct dentry *);
@@ -405,10 +415,12 @@ extern int nfs_writepage(struct page *page, struct writeback_control *wbc);
405extern int nfs_writepages(struct address_space *, struct writeback_control *); 415extern int nfs_writepages(struct address_space *, struct writeback_control *);
406extern int nfs_flush_incompatible(struct file *file, struct page *page); 416extern int nfs_flush_incompatible(struct file *file, struct page *page);
407extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int); 417extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int);
408extern void nfs_writeback_done(struct rpc_task *task); 418extern void nfs_writeback_done(struct rpc_task *task, void *data);
419extern void nfs_writedata_release(void *data);
409 420
410#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) 421#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
411extern void nfs_commit_done(struct rpc_task *); 422extern void nfs_commit_done(struct rpc_task *, void *data);
423extern void nfs_commit_release(void *data);
412#endif 424#endif
413 425
414/* 426/*
@@ -459,18 +471,33 @@ static inline int nfs_wb_page(struct inode *inode, struct page* page)
459 */ 471 */
460extern mempool_t *nfs_wdata_mempool; 472extern mempool_t *nfs_wdata_mempool;
461 473
462static inline struct nfs_write_data *nfs_writedata_alloc(void) 474static inline struct nfs_write_data *nfs_writedata_alloc(unsigned int pagecount)
463{ 475{
464 struct nfs_write_data *p = mempool_alloc(nfs_wdata_mempool, SLAB_NOFS); 476 struct nfs_write_data *p = mempool_alloc(nfs_wdata_mempool, SLAB_NOFS);
477
465 if (p) { 478 if (p) {
466 memset(p, 0, sizeof(*p)); 479 memset(p, 0, sizeof(*p));
467 INIT_LIST_HEAD(&p->pages); 480 INIT_LIST_HEAD(&p->pages);
481 if (pagecount < NFS_PAGEVEC_SIZE)
482 p->pagevec = &p->page_array[0];
483 else {
484 size_t size = ++pagecount * sizeof(struct page *);
485 p->pagevec = kmalloc(size, GFP_NOFS);
486 if (p->pagevec) {
487 memset(p->pagevec, 0, size);
488 } else {
489 mempool_free(p, nfs_wdata_mempool);
490 p = NULL;
491 }
492 }
468 } 493 }
469 return p; 494 return p;
470} 495}
471 496
472static inline void nfs_writedata_free(struct nfs_write_data *p) 497static inline void nfs_writedata_free(struct nfs_write_data *p)
473{ 498{
499 if (p && (p->pagevec != &p->page_array[0]))
500 kfree(p->pagevec);
474 mempool_free(p, nfs_wdata_mempool); 501 mempool_free(p, nfs_wdata_mempool);
475} 502}
476 503
@@ -480,28 +507,45 @@ static inline void nfs_writedata_free(struct nfs_write_data *p)
480extern int nfs_readpage(struct file *, struct page *); 507extern int nfs_readpage(struct file *, struct page *);
481extern int nfs_readpages(struct file *, struct address_space *, 508extern int nfs_readpages(struct file *, struct address_space *,
482 struct list_head *, unsigned); 509 struct list_head *, unsigned);
483extern void nfs_readpage_result(struct rpc_task *); 510extern void nfs_readpage_result(struct rpc_task *, void *);
511extern void nfs_readdata_release(void *data);
512
484 513
485/* 514/*
486 * Allocate and free nfs_read_data structures 515 * Allocate and free nfs_read_data structures
487 */ 516 */
488extern mempool_t *nfs_rdata_mempool; 517extern mempool_t *nfs_rdata_mempool;
489 518
490static inline struct nfs_read_data *nfs_readdata_alloc(void) 519static inline struct nfs_read_data *nfs_readdata_alloc(unsigned int pagecount)
491{ 520{
492 struct nfs_read_data *p = mempool_alloc(nfs_rdata_mempool, SLAB_NOFS); 521 struct nfs_read_data *p = mempool_alloc(nfs_rdata_mempool, SLAB_NOFS);
493 if (p) 522
523 if (p) {
494 memset(p, 0, sizeof(*p)); 524 memset(p, 0, sizeof(*p));
525 INIT_LIST_HEAD(&p->pages);
526 if (pagecount < NFS_PAGEVEC_SIZE)
527 p->pagevec = &p->page_array[0];
528 else {
529 size_t size = ++pagecount * sizeof(struct page *);
530 p->pagevec = kmalloc(size, GFP_NOFS);
531 if (p->pagevec) {
532 memset(p->pagevec, 0, size);
533 } else {
534 mempool_free(p, nfs_rdata_mempool);
535 p = NULL;
536 }
537 }
538 }
495 return p; 539 return p;
496} 540}
497 541
498static inline void nfs_readdata_free(struct nfs_read_data *p) 542static inline void nfs_readdata_free(struct nfs_read_data *p)
499{ 543{
544 if (p && (p->pagevec != &p->page_array[0]))
545 kfree(p->pagevec);
500 mempool_free(p, nfs_rdata_mempool); 546 mempool_free(p, nfs_rdata_mempool);
501} 547}
502 548
503extern void nfs_readdata_release(struct rpc_task *task);
504
505/* 549/*
506 * linux/fs/nfs3proc.c 550 * linux/fs/nfs3proc.c
507 */ 551 */