diff options
Diffstat (limited to 'fs/nfs/internal.h')
| -rw-r--r-- | fs/nfs/internal.h | 56 |
1 files changed, 47 insertions, 9 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index efaa31c70fbe..212b8c883d22 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | #include <linux/mount.h> | 6 | #include <linux/mount.h> |
| 7 | #include <linux/security.h> | 7 | #include <linux/security.h> |
| 8 | #include <linux/crc32.h> | 8 | #include <linux/crc32.h> |
| 9 | #include <linux/nfs_page.h> | ||
| 9 | 10 | ||
| 10 | #define NFS_MS_MASK (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_SYNCHRONOUS) | 11 | #define NFS_MS_MASK (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_SYNCHRONOUS) |
| 11 | 12 | ||
| @@ -31,8 +32,6 @@ static inline int nfs_attr_use_mounted_on_fileid(struct nfs_fattr *fattr) | |||
| 31 | (((fattr->valid & NFS_ATTR_FATTR_MOUNTPOINT) == 0) && | 32 | (((fattr->valid & NFS_ATTR_FATTR_MOUNTPOINT) == 0) && |
| 32 | ((fattr->valid & NFS_ATTR_FATTR_V4_REFERRAL) == 0))) | 33 | ((fattr->valid & NFS_ATTR_FATTR_V4_REFERRAL) == 0))) |
| 33 | return 0; | 34 | return 0; |
| 34 | |||
| 35 | fattr->fileid = fattr->mounted_on_fileid; | ||
| 36 | return 1; | 35 | return 1; |
| 37 | } | 36 | } |
| 38 | 37 | ||
| @@ -189,9 +188,15 @@ extern struct nfs_client *nfs4_set_ds_client(struct nfs_client* mds_clp, | |||
| 189 | const struct sockaddr *ds_addr, | 188 | const struct sockaddr *ds_addr, |
| 190 | int ds_addrlen, int ds_proto, | 189 | int ds_addrlen, int ds_proto, |
| 191 | unsigned int ds_timeo, | 190 | unsigned int ds_timeo, |
| 192 | unsigned int ds_retrans); | 191 | unsigned int ds_retrans, |
| 192 | u32 minor_version, | ||
| 193 | rpc_authflavor_t au_flavor); | ||
| 193 | extern struct rpc_clnt *nfs4_find_or_create_ds_client(struct nfs_client *, | 194 | extern struct rpc_clnt *nfs4_find_or_create_ds_client(struct nfs_client *, |
| 194 | struct inode *); | 195 | struct inode *); |
| 196 | extern struct nfs_client *nfs3_set_ds_client(struct nfs_client *mds_clp, | ||
| 197 | const struct sockaddr *ds_addr, int ds_addrlen, | ||
| 198 | int ds_proto, unsigned int ds_timeo, | ||
| 199 | unsigned int ds_retrans, rpc_authflavor_t au_flavor); | ||
| 195 | #ifdef CONFIG_PROC_FS | 200 | #ifdef CONFIG_PROC_FS |
| 196 | extern int __init nfs_fs_proc_init(void); | 201 | extern int __init nfs_fs_proc_init(void); |
| 197 | extern void nfs_fs_proc_exit(void); | 202 | extern void nfs_fs_proc_exit(void); |
| @@ -244,9 +249,12 @@ struct nfs_pgio_header *nfs_pgio_header_alloc(const struct nfs_rw_ops *); | |||
| 244 | void nfs_pgio_header_free(struct nfs_pgio_header *); | 249 | void nfs_pgio_header_free(struct nfs_pgio_header *); |
| 245 | void nfs_pgio_data_destroy(struct nfs_pgio_header *); | 250 | void nfs_pgio_data_destroy(struct nfs_pgio_header *); |
| 246 | int nfs_generic_pgio(struct nfs_pageio_descriptor *, struct nfs_pgio_header *); | 251 | int nfs_generic_pgio(struct nfs_pageio_descriptor *, struct nfs_pgio_header *); |
| 247 | int nfs_initiate_pgio(struct rpc_clnt *, struct nfs_pgio_header *, | 252 | int nfs_initiate_pgio(struct rpc_clnt *clnt, struct nfs_pgio_header *hdr, |
| 248 | const struct rpc_call_ops *, int, int); | 253 | struct rpc_cred *cred, const struct nfs_rpc_ops *rpc_ops, |
| 254 | const struct rpc_call_ops *call_ops, int how, int flags); | ||
| 249 | void nfs_free_request(struct nfs_page *req); | 255 | void nfs_free_request(struct nfs_page *req); |
| 256 | struct nfs_pgio_mirror * | ||
| 257 | nfs_pgio_current_mirror(struct nfs_pageio_descriptor *desc); | ||
| 250 | 258 | ||
| 251 | static inline void nfs_iocounter_init(struct nfs_io_counter *c) | 259 | static inline void nfs_iocounter_init(struct nfs_io_counter *c) |
| 252 | { | 260 | { |
| @@ -254,6 +262,12 @@ static inline void nfs_iocounter_init(struct nfs_io_counter *c) | |||
| 254 | atomic_set(&c->io_count, 0); | 262 | atomic_set(&c->io_count, 0); |
| 255 | } | 263 | } |
| 256 | 264 | ||
| 265 | static inline bool nfs_pgio_has_mirroring(struct nfs_pageio_descriptor *desc) | ||
| 266 | { | ||
| 267 | WARN_ON_ONCE(desc->pg_mirror_count < 1); | ||
| 268 | return desc->pg_mirror_count > 1; | ||
| 269 | } | ||
| 270 | |||
| 257 | /* nfs2xdr.c */ | 271 | /* nfs2xdr.c */ |
| 258 | extern struct rpc_procinfo nfs_procedures[]; | 272 | extern struct rpc_procinfo nfs_procedures[]; |
| 259 | extern int nfs2_decode_dirent(struct xdr_stream *, | 273 | extern int nfs2_decode_dirent(struct xdr_stream *, |
| @@ -377,7 +391,7 @@ extern struct rpc_stat nfs_rpcstat; | |||
| 377 | 391 | ||
| 378 | extern int __init register_nfs_fs(void); | 392 | extern int __init register_nfs_fs(void); |
| 379 | extern void __exit unregister_nfs_fs(void); | 393 | extern void __exit unregister_nfs_fs(void); |
| 380 | extern void nfs_sb_active(struct super_block *sb); | 394 | extern bool nfs_sb_active(struct super_block *sb); |
| 381 | extern void nfs_sb_deactive(struct super_block *sb); | 395 | extern void nfs_sb_deactive(struct super_block *sb); |
| 382 | 396 | ||
| 383 | /* namespace.c */ | 397 | /* namespace.c */ |
| @@ -416,7 +430,6 @@ int nfs_show_options(struct seq_file *, struct dentry *); | |||
| 416 | int nfs_show_devname(struct seq_file *, struct dentry *); | 430 | int nfs_show_devname(struct seq_file *, struct dentry *); |
| 417 | int nfs_show_path(struct seq_file *, struct dentry *); | 431 | int nfs_show_path(struct seq_file *, struct dentry *); |
| 418 | int nfs_show_stats(struct seq_file *, struct dentry *); | 432 | int nfs_show_stats(struct seq_file *, struct dentry *); |
| 419 | void nfs_put_super(struct super_block *); | ||
| 420 | int nfs_remount(struct super_block *sb, int *flags, char *raw_data); | 433 | int nfs_remount(struct super_block *sb, int *flags, char *raw_data); |
| 421 | 434 | ||
| 422 | /* write.c */ | 435 | /* write.c */ |
| @@ -429,6 +442,7 @@ extern void nfs_write_prepare(struct rpc_task *task, void *calldata); | |||
| 429 | extern void nfs_commit_prepare(struct rpc_task *task, void *calldata); | 442 | extern void nfs_commit_prepare(struct rpc_task *task, void *calldata); |
| 430 | extern int nfs_initiate_commit(struct rpc_clnt *clnt, | 443 | extern int nfs_initiate_commit(struct rpc_clnt *clnt, |
| 431 | struct nfs_commit_data *data, | 444 | struct nfs_commit_data *data, |
| 445 | const struct nfs_rpc_ops *nfs_ops, | ||
| 432 | const struct rpc_call_ops *call_ops, | 446 | const struct rpc_call_ops *call_ops, |
| 433 | int how, int flags); | 447 | int how, int flags); |
| 434 | extern void nfs_init_commit(struct nfs_commit_data *data, | 448 | extern void nfs_init_commit(struct nfs_commit_data *data, |
| @@ -442,13 +456,15 @@ int nfs_scan_commit(struct inode *inode, struct list_head *dst, | |||
| 442 | struct nfs_commit_info *cinfo); | 456 | struct nfs_commit_info *cinfo); |
| 443 | void nfs_mark_request_commit(struct nfs_page *req, | 457 | void nfs_mark_request_commit(struct nfs_page *req, |
| 444 | struct pnfs_layout_segment *lseg, | 458 | struct pnfs_layout_segment *lseg, |
| 445 | struct nfs_commit_info *cinfo); | 459 | struct nfs_commit_info *cinfo, |
| 460 | u32 ds_commit_idx); | ||
| 446 | int nfs_write_need_commit(struct nfs_pgio_header *); | 461 | int nfs_write_need_commit(struct nfs_pgio_header *); |
| 447 | int nfs_generic_commit_list(struct inode *inode, struct list_head *head, | 462 | int nfs_generic_commit_list(struct inode *inode, struct list_head *head, |
| 448 | int how, struct nfs_commit_info *cinfo); | 463 | int how, struct nfs_commit_info *cinfo); |
| 449 | void nfs_retry_commit(struct list_head *page_list, | 464 | void nfs_retry_commit(struct list_head *page_list, |
| 450 | struct pnfs_layout_segment *lseg, | 465 | struct pnfs_layout_segment *lseg, |
| 451 | struct nfs_commit_info *cinfo); | 466 | struct nfs_commit_info *cinfo, |
| 467 | u32 ds_commit_idx); | ||
| 452 | void nfs_commitdata_release(struct nfs_commit_data *data); | 468 | void nfs_commitdata_release(struct nfs_commit_data *data); |
| 453 | void nfs_request_add_commit_list(struct nfs_page *req, struct list_head *dst, | 469 | void nfs_request_add_commit_list(struct nfs_page *req, struct list_head *dst, |
| 454 | struct nfs_commit_info *cinfo); | 470 | struct nfs_commit_info *cinfo); |
| @@ -459,6 +475,7 @@ void nfs_init_cinfo(struct nfs_commit_info *cinfo, | |||
| 459 | struct nfs_direct_req *dreq); | 475 | struct nfs_direct_req *dreq); |
| 460 | int nfs_key_timeout_notify(struct file *filp, struct inode *inode); | 476 | int nfs_key_timeout_notify(struct file *filp, struct inode *inode); |
| 461 | bool nfs_ctx_key_to_expire(struct nfs_open_context *ctx); | 477 | bool nfs_ctx_key_to_expire(struct nfs_open_context *ctx); |
| 478 | void nfs_pageio_stop_mirroring(struct nfs_pageio_descriptor *pgio); | ||
| 462 | 479 | ||
| 463 | #ifdef CONFIG_MIGRATION | 480 | #ifdef CONFIG_MIGRATION |
| 464 | extern int nfs_migrate_page(struct address_space *, | 481 | extern int nfs_migrate_page(struct address_space *, |
| @@ -482,6 +499,7 @@ static inline void nfs_inode_dio_wait(struct inode *inode) | |||
| 482 | inode_dio_wait(inode); | 499 | inode_dio_wait(inode); |
| 483 | } | 500 | } |
| 484 | extern ssize_t nfs_dreq_bytes_left(struct nfs_direct_req *dreq); | 501 | extern ssize_t nfs_dreq_bytes_left(struct nfs_direct_req *dreq); |
| 502 | extern void nfs_direct_set_resched_writes(struct nfs_direct_req *dreq); | ||
| 485 | 503 | ||
| 486 | /* nfs4proc.c */ | 504 | /* nfs4proc.c */ |
| 487 | extern void __nfs4_read_done_cb(struct nfs_pgio_header *); | 505 | extern void __nfs4_read_done_cb(struct nfs_pgio_header *); |
| @@ -495,6 +513,26 @@ extern int nfs41_walk_client_list(struct nfs_client *clp, | |||
| 495 | struct nfs_client **result, | 513 | struct nfs_client **result, |
| 496 | struct rpc_cred *cred); | 514 | struct rpc_cred *cred); |
| 497 | 515 | ||
| 516 | static inline struct inode *nfs_igrab_and_active(struct inode *inode) | ||
| 517 | { | ||
| 518 | inode = igrab(inode); | ||
| 519 | if (inode != NULL && !nfs_sb_active(inode->i_sb)) { | ||
| 520 | iput(inode); | ||
| 521 | inode = NULL; | ||
| 522 | } | ||
| 523 | return inode; | ||
| 524 | } | ||
| 525 | |||
| 526 | static inline void nfs_iput_and_deactive(struct inode *inode) | ||
| 527 | { | ||
| 528 | if (inode != NULL) { | ||
| 529 | struct super_block *sb = inode->i_sb; | ||
| 530 | |||
| 531 | iput(inode); | ||
| 532 | nfs_sb_deactive(sb); | ||
| 533 | } | ||
| 534 | } | ||
| 535 | |||
| 498 | /* | 536 | /* |
| 499 | * Determine the device name as a string | 537 | * Determine the device name as a string |
| 500 | */ | 538 | */ |
