diff options
Diffstat (limited to 'include/linux/nfs_fs.h')
| -rw-r--r-- | include/linux/nfs_fs.h | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index d09db1bc9083..508f8cf6da37 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
| @@ -33,9 +33,6 @@ | |||
| 33 | #define FLUSH_STABLE 4 /* commit to stable storage */ | 33 | #define FLUSH_STABLE 4 /* commit to stable storage */ |
| 34 | #define FLUSH_LOWPRI 8 /* low priority background flush */ | 34 | #define FLUSH_LOWPRI 8 /* low priority background flush */ |
| 35 | #define FLUSH_HIGHPRI 16 /* high priority memory reclaim flush */ | 35 | #define FLUSH_HIGHPRI 16 /* high priority memory reclaim flush */ |
| 36 | #define FLUSH_NOCOMMIT 32 /* Don't send the NFSv3/v4 COMMIT */ | ||
| 37 | #define FLUSH_INVALIDATE 64 /* Invalidate the page cache */ | ||
| 38 | #define FLUSH_NOWRITEPAGE 128 /* Don't call writepage() */ | ||
| 39 | 36 | ||
| 40 | #ifdef __KERNEL__ | 37 | #ifdef __KERNEL__ |
| 41 | 38 | ||
| @@ -75,13 +72,20 @@ struct nfs_access_entry { | |||
| 75 | int mask; | 72 | int mask; |
| 76 | }; | 73 | }; |
| 77 | 74 | ||
| 75 | struct nfs_lock_context { | ||
| 76 | atomic_t count; | ||
| 77 | struct list_head list; | ||
| 78 | struct nfs_open_context *open_context; | ||
| 79 | fl_owner_t lockowner; | ||
| 80 | pid_t pid; | ||
| 81 | }; | ||
| 82 | |||
| 78 | struct nfs4_state; | 83 | struct nfs4_state; |
| 79 | struct nfs_open_context { | 84 | struct nfs_open_context { |
| 80 | atomic_t count; | 85 | struct nfs_lock_context lock_context; |
| 81 | struct path path; | 86 | struct path path; |
| 82 | struct rpc_cred *cred; | 87 | struct rpc_cred *cred; |
| 83 | struct nfs4_state *state; | 88 | struct nfs4_state *state; |
| 84 | fl_owner_t lockowner; | ||
| 85 | fmode_t mode; | 89 | fmode_t mode; |
| 86 | 90 | ||
| 87 | unsigned long flags; | 91 | unsigned long flags; |
| @@ -166,6 +170,7 @@ struct nfs_inode { | |||
| 166 | struct radix_tree_root nfs_page_tree; | 170 | struct radix_tree_root nfs_page_tree; |
| 167 | 171 | ||
| 168 | unsigned long npages; | 172 | unsigned long npages; |
| 173 | unsigned long ncommit; | ||
| 169 | 174 | ||
| 170 | /* Open contexts for shared mmap writes */ | 175 | /* Open contexts for shared mmap writes */ |
| 171 | struct list_head open_files; | 176 | struct list_head open_files; |
| @@ -211,6 +216,7 @@ struct nfs_inode { | |||
| 211 | #define NFS_INO_FLUSHING (4) /* inode is flushing out data */ | 216 | #define NFS_INO_FLUSHING (4) /* inode is flushing out data */ |
| 212 | #define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */ | 217 | #define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */ |
| 213 | #define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */ | 218 | #define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */ |
| 219 | #define NFS_INO_COMMIT (7) /* inode is committing unstable writes */ | ||
| 214 | 220 | ||
| 215 | static inline struct nfs_inode *NFS_I(const struct inode *inode) | 221 | static inline struct nfs_inode *NFS_I(const struct inode *inode) |
| 216 | { | 222 | { |
| @@ -349,15 +355,30 @@ extern int nfs_attribute_timeout(struct inode *inode); | |||
| 349 | extern int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode); | 355 | extern int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode); |
| 350 | extern int __nfs_revalidate_inode(struct nfs_server *, struct inode *); | 356 | extern int __nfs_revalidate_inode(struct nfs_server *, struct inode *); |
| 351 | extern int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping); | 357 | extern int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping); |
| 352 | extern int nfs_revalidate_mapping_nolock(struct inode *inode, struct address_space *mapping); | ||
| 353 | extern int nfs_setattr(struct dentry *, struct iattr *); | 358 | extern int nfs_setattr(struct dentry *, struct iattr *); |
| 354 | extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr); | 359 | extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr); |
| 355 | extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); | 360 | extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); |
| 356 | extern void put_nfs_open_context(struct nfs_open_context *ctx); | 361 | extern void put_nfs_open_context(struct nfs_open_context *ctx); |
| 357 | extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode); | 362 | extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode); |
| 363 | extern struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx); | ||
| 364 | extern void nfs_put_lock_context(struct nfs_lock_context *l_ctx); | ||
| 358 | extern u64 nfs_compat_user_ino64(u64 fileid); | 365 | extern u64 nfs_compat_user_ino64(u64 fileid); |
| 359 | extern void nfs_fattr_init(struct nfs_fattr *fattr); | 366 | extern void nfs_fattr_init(struct nfs_fattr *fattr); |
| 360 | 367 | ||
| 368 | extern struct nfs_fattr *nfs_alloc_fattr(void); | ||
| 369 | |||
| 370 | static inline void nfs_free_fattr(const struct nfs_fattr *fattr) | ||
| 371 | { | ||
| 372 | kfree(fattr); | ||
| 373 | } | ||
| 374 | |||
| 375 | extern struct nfs_fh *nfs_alloc_fhandle(void); | ||
| 376 | |||
| 377 | static inline void nfs_free_fhandle(const struct nfs_fh *fh) | ||
| 378 | { | ||
| 379 | kfree(fh); | ||
| 380 | } | ||
| 381 | |||
| 361 | /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ | 382 | /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ |
| 362 | extern __be32 root_nfs_parse_addr(char *name); /*__init*/ | 383 | extern __be32 root_nfs_parse_addr(char *name); /*__init*/ |
| 363 | extern unsigned long nfs_inc_attr_generation_counter(void); | 384 | extern unsigned long nfs_inc_attr_generation_counter(void); |
| @@ -477,9 +498,7 @@ extern int nfs_writeback_done(struct rpc_task *, struct nfs_write_data *); | |||
| 477 | * Try to write back everything synchronously (but check the | 498 | * Try to write back everything synchronously (but check the |
| 478 | * return value!) | 499 | * return value!) |
| 479 | */ | 500 | */ |
| 480 | extern long nfs_sync_mapping_wait(struct address_space *, struct writeback_control *, int); | ||
| 481 | extern int nfs_wb_all(struct inode *inode); | 501 | extern int nfs_wb_all(struct inode *inode); |
| 482 | extern int nfs_wb_nocommit(struct inode *inode); | ||
| 483 | extern int nfs_wb_page(struct inode *inode, struct page* page); | 502 | extern int nfs_wb_page(struct inode *inode, struct page* page); |
| 484 | extern int nfs_wb_page_cancel(struct inode *inode, struct page* page); | 503 | extern int nfs_wb_page_cancel(struct inode *inode, struct page* page); |
| 485 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) | 504 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) |
