diff options
Diffstat (limited to 'fs/nfs/pnfs.h')
-rw-r--r-- | fs/nfs/pnfs.h | 18 |
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 *); | |||
129 | extern int nfs4_proc_getdeviceinfo(struct nfs_server *server, | 129 | extern int nfs4_proc_getdeviceinfo(struct nfs_server *server, |
130 | struct pnfs_device *dev); | 130 | struct pnfs_device *dev); |
131 | extern int nfs4_proc_layoutget(struct nfs4_layoutget *lgp); | 131 | extern int nfs4_proc_layoutget(struct nfs4_layoutget *lgp); |
132 | extern int nfs4_proc_layoutreturn(struct nfs4_layoutreturn *lrp); | ||
132 | 133 | ||
133 | /* pnfs.c */ | 134 | /* pnfs.c */ |
134 | void get_layout_hdr(struct pnfs_layout_hdr *lo); | 135 | void get_layout_hdr(struct pnfs_layout_hdr *lo); |
@@ -165,6 +166,7 @@ void pnfs_roc_set_barrier(struct inode *ino, u32 barrier); | |||
165 | bool pnfs_roc_drain(struct inode *ino, u32 *barrier); | 166 | bool pnfs_roc_drain(struct inode *ino, u32 *barrier); |
166 | void pnfs_set_layoutcommit(struct nfs_write_data *wdata); | 167 | void pnfs_set_layoutcommit(struct nfs_write_data *wdata); |
167 | int pnfs_layoutcommit_inode(struct inode *inode, bool sync); | 168 | int pnfs_layoutcommit_inode(struct inode *inode, bool sync); |
169 | int _pnfs_return_layout(struct inode *); | ||
168 | int pnfs_ld_write_done(struct nfs_write_data *); | 170 | int pnfs_ld_write_done(struct nfs_write_data *); |
169 | int pnfs_ld_read_done(struct nfs_read_data *); | 171 | int 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 | ||
261 | static 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 | ||
261 | static inline void pnfs_destroy_all_layouts(struct nfs_client *clp) | 274 | static 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 | ||
314 | static inline int pnfs_return_layout(struct inode *ino) | ||
315 | { | ||
316 | return 0; | ||
317 | } | ||
318 | |||
301 | static inline bool | 319 | static inline bool |
302 | pnfs_roc(struct inode *ino) | 320 | pnfs_roc(struct inode *ino) |
303 | { | 321 | { |