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.h35
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
75struct 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
78struct nfs4_state; 83struct nfs4_state;
79struct nfs_open_context { 84struct 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
215static inline struct nfs_inode *NFS_I(const struct inode *inode) 221static inline struct nfs_inode *NFS_I(const struct inode *inode)
216{ 222{
@@ -349,15 +355,30 @@ extern int nfs_attribute_timeout(struct inode *inode);
349extern int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode); 355extern int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode);
350extern int __nfs_revalidate_inode(struct nfs_server *, struct inode *); 356extern int __nfs_revalidate_inode(struct nfs_server *, struct inode *);
351extern int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping); 357extern int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping);
352extern int nfs_revalidate_mapping_nolock(struct inode *inode, struct address_space *mapping);
353extern int nfs_setattr(struct dentry *, struct iattr *); 358extern int nfs_setattr(struct dentry *, struct iattr *);
354extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr); 359extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr);
355extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); 360extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx);
356extern void put_nfs_open_context(struct nfs_open_context *ctx); 361extern void put_nfs_open_context(struct nfs_open_context *ctx);
357extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode); 362extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode);
363extern struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx);
364extern void nfs_put_lock_context(struct nfs_lock_context *l_ctx);
358extern u64 nfs_compat_user_ino64(u64 fileid); 365extern u64 nfs_compat_user_ino64(u64 fileid);
359extern void nfs_fattr_init(struct nfs_fattr *fattr); 366extern void nfs_fattr_init(struct nfs_fattr *fattr);
360 367
368extern struct nfs_fattr *nfs_alloc_fattr(void);
369
370static inline void nfs_free_fattr(const struct nfs_fattr *fattr)
371{
372 kfree(fattr);
373}
374
375extern struct nfs_fh *nfs_alloc_fhandle(void);
376
377static 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. */
362extern __be32 root_nfs_parse_addr(char *name); /*__init*/ 383extern __be32 root_nfs_parse_addr(char *name); /*__init*/
363extern unsigned long nfs_inc_attr_generation_counter(void); 384extern 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 */
480extern long nfs_sync_mapping_wait(struct address_space *, struct writeback_control *, int);
481extern int nfs_wb_all(struct inode *inode); 501extern int nfs_wb_all(struct inode *inode);
482extern int nfs_wb_nocommit(struct inode *inode);
483extern int nfs_wb_page(struct inode *inode, struct page* page); 502extern int nfs_wb_page(struct inode *inode, struct page* page);
484extern int nfs_wb_page_cancel(struct inode *inode, struct page* page); 503extern 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)