diff options
Diffstat (limited to 'fs/nfs/internal.h')
-rw-r--r-- | fs/nfs/internal.h | 139 |
1 files changed, 90 insertions, 49 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index b777bdaba4c..18f99ef7134 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h | |||
@@ -103,6 +103,7 @@ struct nfs_parsed_mount_data { | |||
103 | unsigned int version; | 103 | unsigned int version; |
104 | unsigned int minorversion; | 104 | unsigned int minorversion; |
105 | char *fscache_uniq; | 105 | char *fscache_uniq; |
106 | bool need_mount; | ||
106 | 107 | ||
107 | struct { | 108 | struct { |
108 | struct sockaddr_storage address; | 109 | struct sockaddr_storage address; |
@@ -167,11 +168,13 @@ extern struct nfs_server *nfs_clone_server(struct nfs_server *, | |||
167 | struct nfs_fh *, | 168 | struct nfs_fh *, |
168 | struct nfs_fattr *, | 169 | struct nfs_fattr *, |
169 | rpc_authflavor_t); | 170 | rpc_authflavor_t); |
171 | extern int nfs_wait_client_init_complete(const struct nfs_client *clp); | ||
170 | extern void nfs_mark_client_ready(struct nfs_client *clp, int state); | 172 | extern void nfs_mark_client_ready(struct nfs_client *clp, int state); |
171 | extern int nfs4_check_client_ready(struct nfs_client *clp); | ||
172 | extern struct nfs_client *nfs4_set_ds_client(struct nfs_client* mds_clp, | 173 | extern struct nfs_client *nfs4_set_ds_client(struct nfs_client* mds_clp, |
173 | const struct sockaddr *ds_addr, | 174 | const struct sockaddr *ds_addr, |
174 | int ds_addrlen, int ds_proto); | 175 | int ds_addrlen, int ds_proto, |
176 | unsigned int ds_timeo, | ||
177 | unsigned int ds_retrans); | ||
175 | #ifdef CONFIG_PROC_FS | 178 | #ifdef CONFIG_PROC_FS |
176 | extern int __init nfs_fs_proc_init(void); | 179 | extern int __init nfs_fs_proc_init(void); |
177 | extern void nfs_fs_proc_exit(void); | 180 | extern void nfs_fs_proc_exit(void); |
@@ -185,21 +188,11 @@ static inline void nfs_fs_proc_exit(void) | |||
185 | } | 188 | } |
186 | #endif | 189 | #endif |
187 | 190 | ||
188 | /* nfs4namespace.c */ | ||
189 | #ifdef CONFIG_NFS_V4 | ||
190 | extern struct vfsmount *nfs_do_refmount(struct rpc_clnt *client, struct dentry *dentry); | ||
191 | #else | ||
192 | static inline | ||
193 | struct vfsmount *nfs_do_refmount(struct rpc_clnt *client, struct dentry *dentry) | ||
194 | { | ||
195 | return ERR_PTR(-ENOENT); | ||
196 | } | ||
197 | #endif | ||
198 | |||
199 | /* callback_xdr.c */ | 191 | /* callback_xdr.c */ |
200 | extern struct svc_version nfs4_callback_version1; | 192 | extern struct svc_version nfs4_callback_version1; |
201 | extern struct svc_version nfs4_callback_version4; | 193 | extern struct svc_version nfs4_callback_version4; |
202 | 194 | ||
195 | struct nfs_pageio_descriptor; | ||
203 | /* pagelist.c */ | 196 | /* pagelist.c */ |
204 | extern int __init nfs_init_nfspagecache(void); | 197 | extern int __init nfs_init_nfspagecache(void); |
205 | extern void nfs_destroy_nfspagecache(void); | 198 | extern void nfs_destroy_nfspagecache(void); |
@@ -210,9 +203,13 @@ extern void nfs_destroy_writepagecache(void); | |||
210 | 203 | ||
211 | extern int __init nfs_init_directcache(void); | 204 | extern int __init nfs_init_directcache(void); |
212 | extern void nfs_destroy_directcache(void); | 205 | extern void nfs_destroy_directcache(void); |
206 | extern bool nfs_pgarray_set(struct nfs_page_array *p, unsigned int pagecount); | ||
207 | extern void nfs_pgheader_init(struct nfs_pageio_descriptor *desc, | ||
208 | struct nfs_pgio_header *hdr, | ||
209 | void (*release)(struct nfs_pgio_header *hdr)); | ||
210 | void nfs_set_pgio_error(struct nfs_pgio_header *hdr, int error, loff_t pos); | ||
213 | 211 | ||
214 | /* nfs2xdr.c */ | 212 | /* nfs2xdr.c */ |
215 | extern int nfs_stat_to_errno(enum nfs_stat); | ||
216 | extern struct rpc_procinfo nfs_procedures[]; | 213 | extern struct rpc_procinfo nfs_procedures[]; |
217 | extern int nfs2_decode_dirent(struct xdr_stream *, | 214 | extern int nfs2_decode_dirent(struct xdr_stream *, |
218 | struct nfs_entry *, int); | 215 | struct nfs_entry *, int); |
@@ -237,14 +234,13 @@ extern const u32 nfs41_maxwrite_overhead; | |||
237 | extern struct rpc_procinfo nfs4_procedures[]; | 234 | extern struct rpc_procinfo nfs4_procedures[]; |
238 | #endif | 235 | #endif |
239 | 236 | ||
240 | extern int nfs4_init_ds_session(struct nfs_client *clp); | 237 | extern int nfs4_init_ds_session(struct nfs_client *, unsigned long); |
241 | 238 | ||
242 | /* proc.c */ | 239 | /* proc.c */ |
243 | void nfs_close_context(struct nfs_open_context *ctx, int is_sync); | 240 | void nfs_close_context(struct nfs_open_context *ctx, int is_sync); |
244 | extern int nfs_init_client(struct nfs_client *clp, | 241 | extern struct nfs_client *nfs_init_client(struct nfs_client *clp, |
245 | const struct rpc_timeout *timeparms, | 242 | const struct rpc_timeout *timeparms, |
246 | const char *ip_addr, rpc_authflavor_t authflavour, | 243 | const char *ip_addr, rpc_authflavor_t authflavour); |
247 | int noresvport); | ||
248 | 244 | ||
249 | /* dir.c */ | 245 | /* dir.c */ |
250 | extern int nfs_access_cache_shrinker(struct shrinker *shrink, | 246 | extern int nfs_access_cache_shrinker(struct shrinker *shrink, |
@@ -280,9 +276,10 @@ extern void nfs_sb_deactive(struct super_block *sb); | |||
280 | extern char *nfs_path(char **p, struct dentry *dentry, | 276 | extern char *nfs_path(char **p, struct dentry *dentry, |
281 | char *buffer, ssize_t buflen); | 277 | char *buffer, ssize_t buflen); |
282 | extern struct vfsmount *nfs_d_automount(struct path *path); | 278 | extern struct vfsmount *nfs_d_automount(struct path *path); |
283 | #ifdef CONFIG_NFS_V4 | 279 | struct vfsmount *nfs_submount(struct nfs_server *, struct dentry *, |
284 | rpc_authflavor_t nfs_find_best_sec(struct nfs4_secinfo_flavors *); | 280 | struct nfs_fh *, struct nfs_fattr *); |
285 | #endif | 281 | struct vfsmount *nfs_do_submount(struct dentry *, struct nfs_fh *, |
282 | struct nfs_fattr *, rpc_authflavor_t); | ||
286 | 283 | ||
287 | /* getroot.c */ | 284 | /* getroot.c */ |
288 | extern struct dentry *nfs_get_root(struct super_block *, struct nfs_fh *, | 285 | extern struct dentry *nfs_get_root(struct super_block *, struct nfs_fh *, |
@@ -294,46 +291,73 @@ extern struct dentry *nfs4_get_root(struct super_block *, struct nfs_fh *, | |||
294 | extern int nfs4_get_rootfh(struct nfs_server *server, struct nfs_fh *mntfh); | 291 | extern int nfs4_get_rootfh(struct nfs_server *server, struct nfs_fh *mntfh); |
295 | #endif | 292 | #endif |
296 | 293 | ||
297 | struct nfs_pageio_descriptor; | 294 | struct nfs_pgio_completion_ops; |
298 | /* read.c */ | 295 | /* read.c */ |
299 | extern int nfs_initiate_read(struct nfs_read_data *data, struct rpc_clnt *clnt, | 296 | extern struct nfs_read_header *nfs_readhdr_alloc(void); |
300 | const struct rpc_call_ops *call_ops); | 297 | extern void nfs_readhdr_free(struct nfs_pgio_header *hdr); |
298 | extern void nfs_pageio_init_read(struct nfs_pageio_descriptor *pgio, | ||
299 | struct inode *inode, | ||
300 | const struct nfs_pgio_completion_ops *compl_ops); | ||
301 | extern int nfs_initiate_read(struct rpc_clnt *clnt, | ||
302 | struct nfs_read_data *data, | ||
303 | const struct rpc_call_ops *call_ops, int flags); | ||
301 | extern void nfs_read_prepare(struct rpc_task *task, void *calldata); | 304 | extern void nfs_read_prepare(struct rpc_task *task, void *calldata); |
302 | extern int nfs_generic_pagein(struct nfs_pageio_descriptor *desc, | 305 | extern int nfs_generic_pagein(struct nfs_pageio_descriptor *desc, |
303 | struct list_head *head); | 306 | struct nfs_pgio_header *hdr); |
304 | |||
305 | extern void nfs_pageio_init_read_mds(struct nfs_pageio_descriptor *pgio, | 307 | extern void nfs_pageio_init_read_mds(struct nfs_pageio_descriptor *pgio, |
306 | struct inode *inode); | 308 | struct inode *inode, |
309 | const struct nfs_pgio_completion_ops *compl_ops); | ||
307 | extern void nfs_pageio_reset_read_mds(struct nfs_pageio_descriptor *pgio); | 310 | extern void nfs_pageio_reset_read_mds(struct nfs_pageio_descriptor *pgio); |
308 | extern void nfs_readdata_release(struct nfs_read_data *rdata); | 311 | extern void nfs_readdata_release(struct nfs_read_data *rdata); |
309 | 312 | ||
310 | /* write.c */ | 313 | /* write.c */ |
314 | extern void nfs_pageio_init_write(struct nfs_pageio_descriptor *pgio, | ||
315 | struct inode *inode, int ioflags, | ||
316 | const struct nfs_pgio_completion_ops *compl_ops); | ||
317 | extern struct nfs_write_header *nfs_writehdr_alloc(void); | ||
318 | extern void nfs_writehdr_free(struct nfs_pgio_header *hdr); | ||
311 | extern int nfs_generic_flush(struct nfs_pageio_descriptor *desc, | 319 | extern int nfs_generic_flush(struct nfs_pageio_descriptor *desc, |
312 | struct list_head *head); | 320 | struct nfs_pgio_header *hdr); |
313 | extern void nfs_pageio_init_write_mds(struct nfs_pageio_descriptor *pgio, | 321 | extern void nfs_pageio_init_write_mds(struct nfs_pageio_descriptor *pgio, |
314 | struct inode *inode, int ioflags); | 322 | struct inode *inode, int ioflags, |
323 | const struct nfs_pgio_completion_ops *compl_ops); | ||
315 | extern void nfs_pageio_reset_write_mds(struct nfs_pageio_descriptor *pgio); | 324 | extern void nfs_pageio_reset_write_mds(struct nfs_pageio_descriptor *pgio); |
316 | extern void nfs_writedata_release(struct nfs_write_data *wdata); | 325 | extern void nfs_writedata_release(struct nfs_write_data *wdata); |
317 | extern void nfs_commit_free(struct nfs_write_data *p); | 326 | extern void nfs_commit_free(struct nfs_commit_data *p); |
318 | extern int nfs_initiate_write(struct nfs_write_data *data, | 327 | extern int nfs_initiate_write(struct rpc_clnt *clnt, |
319 | struct rpc_clnt *clnt, | 328 | struct nfs_write_data *data, |
320 | const struct rpc_call_ops *call_ops, | 329 | const struct rpc_call_ops *call_ops, |
321 | int how); | 330 | int how, int flags); |
322 | extern void nfs_write_prepare(struct rpc_task *task, void *calldata); | 331 | extern void nfs_write_prepare(struct rpc_task *task, void *calldata); |
323 | extern int nfs_initiate_commit(struct nfs_write_data *data, | 332 | extern void nfs_commit_prepare(struct rpc_task *task, void *calldata); |
324 | struct rpc_clnt *clnt, | 333 | extern int nfs_initiate_commit(struct rpc_clnt *clnt, |
334 | struct nfs_commit_data *data, | ||
325 | const struct rpc_call_ops *call_ops, | 335 | const struct rpc_call_ops *call_ops, |
326 | int how); | 336 | int how, int flags); |
327 | extern void nfs_init_commit(struct nfs_write_data *data, | 337 | extern void nfs_init_commit(struct nfs_commit_data *data, |
328 | struct list_head *head, | 338 | struct list_head *head, |
329 | struct pnfs_layout_segment *lseg); | 339 | struct pnfs_layout_segment *lseg, |
340 | struct nfs_commit_info *cinfo); | ||
341 | int nfs_scan_commit_list(struct list_head *src, struct list_head *dst, | ||
342 | struct nfs_commit_info *cinfo, int max); | ||
343 | int nfs_scan_commit(struct inode *inode, struct list_head *dst, | ||
344 | struct nfs_commit_info *cinfo); | ||
345 | void nfs_mark_request_commit(struct nfs_page *req, | ||
346 | struct pnfs_layout_segment *lseg, | ||
347 | struct nfs_commit_info *cinfo); | ||
348 | int nfs_generic_commit_list(struct inode *inode, struct list_head *head, | ||
349 | int how, struct nfs_commit_info *cinfo); | ||
330 | void nfs_retry_commit(struct list_head *page_list, | 350 | void nfs_retry_commit(struct list_head *page_list, |
331 | struct pnfs_layout_segment *lseg); | 351 | struct pnfs_layout_segment *lseg, |
332 | void nfs_commit_clear_lock(struct nfs_inode *nfsi); | 352 | struct nfs_commit_info *cinfo); |
333 | void nfs_commitdata_release(void *data); | 353 | void nfs_commitdata_release(struct nfs_commit_data *data); |
334 | void nfs_commit_release_pages(struct nfs_write_data *data); | 354 | void nfs_request_add_commit_list(struct nfs_page *req, struct list_head *dst, |
335 | void nfs_request_add_commit_list(struct nfs_page *req, struct list_head *head); | 355 | struct nfs_commit_info *cinfo); |
336 | void nfs_request_remove_commit_list(struct nfs_page *req); | 356 | void nfs_request_remove_commit_list(struct nfs_page *req, |
357 | struct nfs_commit_info *cinfo); | ||
358 | void nfs_init_cinfo(struct nfs_commit_info *cinfo, | ||
359 | struct inode *inode, | ||
360 | struct nfs_direct_req *dreq); | ||
337 | 361 | ||
338 | #ifdef CONFIG_MIGRATION | 362 | #ifdef CONFIG_MIGRATION |
339 | extern int nfs_migrate_page(struct address_space *, | 363 | extern int nfs_migrate_page(struct address_space *, |
@@ -342,15 +366,20 @@ extern int nfs_migrate_page(struct address_space *, | |||
342 | #define nfs_migrate_page NULL | 366 | #define nfs_migrate_page NULL |
343 | #endif | 367 | #endif |
344 | 368 | ||
369 | /* direct.c */ | ||
370 | void nfs_init_cinfo_from_dreq(struct nfs_commit_info *cinfo, | ||
371 | struct nfs_direct_req *dreq); | ||
372 | static inline void nfs_inode_dio_wait(struct inode *inode) | ||
373 | { | ||
374 | inode_dio_wait(inode); | ||
375 | } | ||
376 | |||
345 | /* nfs4proc.c */ | 377 | /* nfs4proc.c */ |
346 | extern void __nfs4_read_done_cb(struct nfs_read_data *); | 378 | extern void __nfs4_read_done_cb(struct nfs_read_data *); |
347 | extern void nfs4_reset_read(struct rpc_task *task, struct nfs_read_data *data); | 379 | extern struct nfs_client *nfs4_init_client(struct nfs_client *clp, |
348 | extern int nfs4_init_client(struct nfs_client *clp, | ||
349 | const struct rpc_timeout *timeparms, | 380 | const struct rpc_timeout *timeparms, |
350 | const char *ip_addr, | 381 | const char *ip_addr, |
351 | rpc_authflavor_t authflavour, | 382 | rpc_authflavor_t authflavour); |
352 | int noresvport); | ||
353 | extern void nfs4_reset_write(struct rpc_task *task, struct nfs_write_data *data); | ||
354 | extern int _nfs4_call_sync(struct rpc_clnt *clnt, | 383 | extern int _nfs4_call_sync(struct rpc_clnt *clnt, |
355 | struct nfs_server *server, | 384 | struct nfs_server *server, |
356 | struct rpc_message *msg, | 385 | struct rpc_message *msg, |
@@ -466,3 +495,15 @@ unsigned int nfs_page_array_len(unsigned int base, size_t len) | |||
466 | PAGE_SIZE - 1) >> PAGE_SHIFT; | 495 | PAGE_SIZE - 1) >> PAGE_SHIFT; |
467 | } | 496 | } |
468 | 497 | ||
498 | /* | ||
499 | * Convert a struct timespec into a 64-bit change attribute | ||
500 | * | ||
501 | * This does approximately the same thing as timespec_to_ns(), | ||
502 | * but for calculation efficiency, we multiply the seconds by | ||
503 | * 1024*1024*1024. | ||
504 | */ | ||
505 | static inline | ||
506 | u64 nfs_timespec_to_change_attr(const struct timespec *ts) | ||
507 | { | ||
508 | return ((u64)ts->tv_sec << 30) + ts->tv_nsec; | ||
509 | } | ||