diff options
Diffstat (limited to 'include/linux/nfs_fs.h')
-rw-r--r-- | include/linux/nfs_fs.h | 66 |
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 | */ |
292 | extern int nfs_sync_mapping(struct address_space *mapping); | ||
294 | extern void nfs_zap_caches(struct inode *); | 293 | extern void nfs_zap_caches(struct inode *); |
295 | extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *, | 294 | extern 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_ | |||
393 | extern struct inode_operations nfs_symlink_inode_operations; | 392 | extern struct inode_operations nfs_symlink_inode_operations; |
394 | 393 | ||
395 | /* | 394 | /* |
395 | * linux/fs/nfs/sysctl.c | ||
396 | */ | ||
397 | #ifdef CONFIG_SYSCTL | ||
398 | extern int nfs_register_sysctl(void); | ||
399 | extern 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 | */ |
398 | extern int nfs_async_unlink(struct dentry *); | 408 | extern int nfs_async_unlink(struct dentry *); |
@@ -405,10 +415,12 @@ extern int nfs_writepage(struct page *page, struct writeback_control *wbc); | |||
405 | extern int nfs_writepages(struct address_space *, struct writeback_control *); | 415 | extern int nfs_writepages(struct address_space *, struct writeback_control *); |
406 | extern int nfs_flush_incompatible(struct file *file, struct page *page); | 416 | extern int nfs_flush_incompatible(struct file *file, struct page *page); |
407 | extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int); | 417 | extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int); |
408 | extern void nfs_writeback_done(struct rpc_task *task); | 418 | extern void nfs_writeback_done(struct rpc_task *task, void *data); |
419 | extern 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) |
411 | extern void nfs_commit_done(struct rpc_task *); | 422 | extern void nfs_commit_done(struct rpc_task *, void *data); |
423 | extern 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 | */ |
460 | extern mempool_t *nfs_wdata_mempool; | 472 | extern mempool_t *nfs_wdata_mempool; |
461 | 473 | ||
462 | static inline struct nfs_write_data *nfs_writedata_alloc(void) | 474 | static 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 | ||
472 | static inline void nfs_writedata_free(struct nfs_write_data *p) | 497 | static 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) | |||
480 | extern int nfs_readpage(struct file *, struct page *); | 507 | extern int nfs_readpage(struct file *, struct page *); |
481 | extern int nfs_readpages(struct file *, struct address_space *, | 508 | extern int nfs_readpages(struct file *, struct address_space *, |
482 | struct list_head *, unsigned); | 509 | struct list_head *, unsigned); |
483 | extern void nfs_readpage_result(struct rpc_task *); | 510 | extern void nfs_readpage_result(struct rpc_task *, void *); |
511 | extern 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 | */ |
488 | extern mempool_t *nfs_rdata_mempool; | 517 | extern mempool_t *nfs_rdata_mempool; |
489 | 518 | ||
490 | static inline struct nfs_read_data *nfs_readdata_alloc(void) | 519 | static 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 | ||
498 | static inline void nfs_readdata_free(struct nfs_read_data *p) | 542 | static 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 | ||
503 | extern void nfs_readdata_release(struct rpc_task *task); | ||
504 | |||
505 | /* | 549 | /* |
506 | * linux/fs/nfs3proc.c | 550 | * linux/fs/nfs3proc.c |
507 | */ | 551 | */ |