aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/pnfs.h')
-rw-r--r--fs/nfs/pnfs.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index 0383e66e71f0..c34f7a0e3bc2 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -129,6 +129,7 @@ extern void pnfs_unregister_layoutdriver(struct pnfs_layoutdriver_type *);
129extern int nfs4_proc_getdeviceinfo(struct nfs_server *server, 129extern int nfs4_proc_getdeviceinfo(struct nfs_server *server,
130 struct pnfs_device *dev); 130 struct pnfs_device *dev);
131extern int nfs4_proc_layoutget(struct nfs4_layoutget *lgp); 131extern int nfs4_proc_layoutget(struct nfs4_layoutget *lgp);
132extern int nfs4_proc_layoutreturn(struct nfs4_layoutreturn *lrp);
132 133
133/* pnfs.c */ 134/* pnfs.c */
134void get_layout_hdr(struct pnfs_layout_hdr *lo); 135void get_layout_hdr(struct pnfs_layout_hdr *lo);
@@ -165,6 +166,7 @@ void pnfs_roc_set_barrier(struct inode *ino, u32 barrier);
165bool pnfs_roc_drain(struct inode *ino, u32 *barrier); 166bool pnfs_roc_drain(struct inode *ino, u32 *barrier);
166void pnfs_set_layoutcommit(struct nfs_write_data *wdata); 167void pnfs_set_layoutcommit(struct nfs_write_data *wdata);
167int pnfs_layoutcommit_inode(struct inode *inode, bool sync); 168int pnfs_layoutcommit_inode(struct inode *inode, bool sync);
169int _pnfs_return_layout(struct inode *);
168int pnfs_ld_write_done(struct nfs_write_data *); 170int pnfs_ld_write_done(struct nfs_write_data *);
169int pnfs_ld_read_done(struct nfs_read_data *); 171int pnfs_ld_read_done(struct nfs_read_data *);
170 172
@@ -256,6 +258,17 @@ static inline void pnfs_clear_request_commit(struct nfs_page *req)
256 put_lseg(req->wb_commit_lseg); 258 put_lseg(req->wb_commit_lseg);
257} 259}
258 260
261static inline int pnfs_return_layout(struct inode *ino)
262{
263 struct nfs_inode *nfsi = NFS_I(ino);
264 struct nfs_server *nfss = NFS_SERVER(ino);
265
266 if (pnfs_enabled_sb(nfss) && nfsi->layout)
267 return _pnfs_return_layout(ino);
268
269 return 0;
270}
271
259#else /* CONFIG_NFS_V4_1 */ 272#else /* CONFIG_NFS_V4_1 */
260 273
261static inline void pnfs_destroy_all_layouts(struct nfs_client *clp) 274static inline void pnfs_destroy_all_layouts(struct nfs_client *clp)
@@ -298,6 +311,11 @@ pnfs_try_to_write_data(struct nfs_write_data *data,
298 return PNFS_NOT_ATTEMPTED; 311 return PNFS_NOT_ATTEMPTED;
299} 312}
300 313
314static inline int pnfs_return_layout(struct inode *ino)
315{
316 return 0;
317}
318
301static inline bool 319static inline bool
302pnfs_roc(struct inode *ino) 320pnfs_roc(struct inode *ino)
303{ 321{