diff options
-rw-r--r-- | fs/nfs/inode.c | 20 | ||||
-rw-r--r-- | include/linux/nfs_fs.h | 14 |
2 files changed, 34 insertions, 0 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 50a56edca0b..0f9852ab87b 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -916,6 +916,26 @@ void nfs_fattr_init(struct nfs_fattr *fattr) | |||
916 | fattr->gencount = nfs_inc_attr_generation_counter(); | 916 | fattr->gencount = nfs_inc_attr_generation_counter(); |
917 | } | 917 | } |
918 | 918 | ||
919 | struct nfs_fattr *nfs_alloc_fattr(void) | ||
920 | { | ||
921 | struct nfs_fattr *fattr; | ||
922 | |||
923 | fattr = kmalloc(sizeof(*fattr), GFP_NOFS); | ||
924 | if (fattr != NULL) | ||
925 | nfs_fattr_init(fattr); | ||
926 | return fattr; | ||
927 | } | ||
928 | |||
929 | struct nfs_fh *nfs_alloc_fhandle(void) | ||
930 | { | ||
931 | struct nfs_fh *fh; | ||
932 | |||
933 | fh = kmalloc(sizeof(struct nfs_fh), GFP_NOFS); | ||
934 | if (fh != NULL) | ||
935 | fh->size = 0; | ||
936 | return fh; | ||
937 | } | ||
938 | |||
919 | /** | 939 | /** |
920 | * nfs_inode_attrs_need_update - check if the inode attributes need updating | 940 | * nfs_inode_attrs_need_update - check if the inode attributes need updating |
921 | * @inode - pointer to inode | 941 | * @inode - pointer to inode |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 07ce4609fe5..77c2ae53431 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -356,6 +356,20 @@ extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struc | |||
356 | extern u64 nfs_compat_user_ino64(u64 fileid); | 356 | extern u64 nfs_compat_user_ino64(u64 fileid); |
357 | extern void nfs_fattr_init(struct nfs_fattr *fattr); | 357 | extern void nfs_fattr_init(struct nfs_fattr *fattr); |
358 | 358 | ||
359 | extern struct nfs_fattr *nfs_alloc_fattr(void); | ||
360 | |||
361 | static inline void nfs_free_fattr(const struct nfs_fattr *fattr) | ||
362 | { | ||
363 | kfree(fattr); | ||
364 | } | ||
365 | |||
366 | extern struct nfs_fh *nfs_alloc_fhandle(void); | ||
367 | |||
368 | static inline void nfs_free_fhandle(const struct nfs_fh *fh) | ||
369 | { | ||
370 | kfree(fh); | ||
371 | } | ||
372 | |||
359 | /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ | 373 | /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ |
360 | extern __be32 root_nfs_parse_addr(char *name); /*__init*/ | 374 | extern __be32 root_nfs_parse_addr(char *name); /*__init*/ |
361 | extern unsigned long nfs_inc_attr_generation_counter(void); | 375 | extern unsigned long nfs_inc_attr_generation_counter(void); |