diff options
Diffstat (limited to 'fs/nfs/internal.h')
-rw-r--r-- | fs/nfs/internal.h | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 3c8373f90ab3..d388302c005f 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include "nfs4_fs.h" | 5 | #include "nfs4_fs.h" |
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 | 9 | ||
9 | #define NFS_MS_MASK (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_SYNCHRONOUS) | 10 | #define NFS_MS_MASK (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_SYNCHRONOUS) |
10 | 11 | ||
@@ -185,6 +186,8 @@ extern struct nfs_client *nfs4_set_ds_client(struct nfs_client* mds_clp, | |||
185 | int ds_addrlen, int ds_proto, | 186 | int ds_addrlen, int ds_proto, |
186 | unsigned int ds_timeo, | 187 | unsigned int ds_timeo, |
187 | unsigned int ds_retrans); | 188 | unsigned int ds_retrans); |
189 | extern struct rpc_clnt *nfs4_find_or_create_ds_client(struct nfs_client *, | ||
190 | struct inode *); | ||
188 | #ifdef CONFIG_PROC_FS | 191 | #ifdef CONFIG_PROC_FS |
189 | extern int __init nfs_fs_proc_init(void); | 192 | extern int __init nfs_fs_proc_init(void); |
190 | extern void nfs_fs_proc_exit(void); | 193 | extern void nfs_fs_proc_exit(void); |
@@ -267,7 +270,7 @@ extern struct rpc_procinfo nfs4_procedures[]; | |||
267 | void nfs_close_context(struct nfs_open_context *ctx, int is_sync); | 270 | void nfs_close_context(struct nfs_open_context *ctx, int is_sync); |
268 | extern struct nfs_client *nfs_init_client(struct nfs_client *clp, | 271 | extern struct nfs_client *nfs_init_client(struct nfs_client *clp, |
269 | const struct rpc_timeout *timeparms, | 272 | const struct rpc_timeout *timeparms, |
270 | const char *ip_addr, rpc_authflavor_t authflavour); | 273 | const char *ip_addr); |
271 | 274 | ||
272 | /* dir.c */ | 275 | /* dir.c */ |
273 | extern int nfs_access_cache_shrinker(struct shrinker *shrink, | 276 | extern int nfs_access_cache_shrinker(struct shrinker *shrink, |
@@ -355,7 +358,7 @@ extern struct dentry *nfs_get_root(struct super_block *, struct nfs_fh *, | |||
355 | extern struct dentry *nfs4_get_root(struct super_block *, struct nfs_fh *, | 358 | extern struct dentry *nfs4_get_root(struct super_block *, struct nfs_fh *, |
356 | const char *); | 359 | const char *); |
357 | 360 | ||
358 | extern int nfs4_get_rootfh(struct nfs_server *server, struct nfs_fh *mntfh); | 361 | extern int nfs4_get_rootfh(struct nfs_server *server, struct nfs_fh *mntfh, bool); |
359 | #endif | 362 | #endif |
360 | 363 | ||
361 | struct nfs_pgio_completion_ops; | 364 | struct nfs_pgio_completion_ops; |
@@ -430,6 +433,8 @@ void nfs_request_remove_commit_list(struct nfs_page *req, | |||
430 | void nfs_init_cinfo(struct nfs_commit_info *cinfo, | 433 | void nfs_init_cinfo(struct nfs_commit_info *cinfo, |
431 | struct inode *inode, | 434 | struct inode *inode, |
432 | struct nfs_direct_req *dreq); | 435 | struct nfs_direct_req *dreq); |
436 | int nfs_key_timeout_notify(struct file *filp, struct inode *inode); | ||
437 | bool nfs_ctx_key_to_expire(struct nfs_open_context *ctx); | ||
433 | 438 | ||
434 | #ifdef CONFIG_MIGRATION | 439 | #ifdef CONFIG_MIGRATION |
435 | extern int nfs_migrate_page(struct address_space *, | 440 | extern int nfs_migrate_page(struct address_space *, |
@@ -451,8 +456,7 @@ extern ssize_t nfs_dreq_bytes_left(struct nfs_direct_req *dreq); | |||
451 | extern void __nfs4_read_done_cb(struct nfs_read_data *); | 456 | extern void __nfs4_read_done_cb(struct nfs_read_data *); |
452 | extern struct nfs_client *nfs4_init_client(struct nfs_client *clp, | 457 | extern struct nfs_client *nfs4_init_client(struct nfs_client *clp, |
453 | const struct rpc_timeout *timeparms, | 458 | const struct rpc_timeout *timeparms, |
454 | const char *ip_addr, | 459 | const char *ip_addr); |
455 | rpc_authflavor_t authflavour); | ||
456 | extern int nfs40_walk_client_list(struct nfs_client *clp, | 460 | extern int nfs40_walk_client_list(struct nfs_client *clp, |
457 | struct nfs_client **result, | 461 | struct nfs_client **result, |
458 | struct rpc_cred *cred); | 462 | struct rpc_cred *cred); |
@@ -575,3 +579,22 @@ u64 nfs_timespec_to_change_attr(const struct timespec *ts) | |||
575 | { | 579 | { |
576 | return ((u64)ts->tv_sec << 30) + ts->tv_nsec; | 580 | return ((u64)ts->tv_sec << 30) + ts->tv_nsec; |
577 | } | 581 | } |
582 | |||
583 | #ifdef CONFIG_CRC32 | ||
584 | /** | ||
585 | * nfs_fhandle_hash - calculate the crc32 hash for the filehandle | ||
586 | * @fh - pointer to filehandle | ||
587 | * | ||
588 | * returns a crc32 hash for the filehandle that is compatible with | ||
589 | * the one displayed by "wireshark". | ||
590 | */ | ||
591 | static inline u32 nfs_fhandle_hash(const struct nfs_fh *fh) | ||
592 | { | ||
593 | return ~crc32_le(0xFFFFFFFF, &fh->data[0], fh->size); | ||
594 | } | ||
595 | #else | ||
596 | static inline u32 nfs_fhandle_hash(const struct nfs_fh *fh) | ||
597 | { | ||
598 | return 0; | ||
599 | } | ||
600 | #endif | ||