diff options
Diffstat (limited to 'fs/nfs')
| -rw-r--r-- | fs/nfs/delegation.c | 7 | ||||
| -rw-r--r-- | fs/nfs/direct.c | 3 | ||||
| -rw-r--r-- | fs/nfs/inode.c | 9 | ||||
| -rw-r--r-- | fs/nfs/namespace.c | 12 | ||||
| -rw-r--r-- | fs/nfs/nfs3proc.c | 2 | ||||
| -rw-r--r-- | fs/nfs/pagelist.c | 3 | ||||
| -rw-r--r-- | fs/nfs/proc.c | 2 | ||||
| -rw-r--r-- | fs/nfs/read.c | 3 | ||||
| -rw-r--r-- | fs/nfs/write.c | 3 |
9 files changed, 18 insertions, 26 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index 57133678db16..841c99a9b11c 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c | |||
| @@ -20,11 +20,6 @@ | |||
| 20 | #include "delegation.h" | 20 | #include "delegation.h" |
| 21 | #include "internal.h" | 21 | #include "internal.h" |
| 22 | 22 | ||
| 23 | static struct nfs_delegation *nfs_alloc_delegation(void) | ||
| 24 | { | ||
| 25 | return (struct nfs_delegation *)kmalloc(sizeof(struct nfs_delegation), GFP_KERNEL); | ||
| 26 | } | ||
| 27 | |||
| 28 | static void nfs_free_delegation(struct nfs_delegation *delegation) | 23 | static void nfs_free_delegation(struct nfs_delegation *delegation) |
| 29 | { | 24 | { |
| 30 | if (delegation->cred) | 25 | if (delegation->cred) |
| @@ -124,7 +119,7 @@ int nfs_inode_set_delegation(struct inode *inode, struct rpc_cred *cred, struct | |||
| 124 | if ((nfsi->cache_validity & (NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_ATTR))) | 119 | if ((nfsi->cache_validity & (NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_ATTR))) |
| 125 | __nfs_revalidate_inode(NFS_SERVER(inode), inode); | 120 | __nfs_revalidate_inode(NFS_SERVER(inode), inode); |
| 126 | 121 | ||
| 127 | delegation = nfs_alloc_delegation(); | 122 | delegation = kmalloc(sizeof(*delegation), GFP_KERNEL); |
| 128 | if (delegation == NULL) | 123 | if (delegation == NULL) |
| 129 | return -ENOMEM; | 124 | return -ENOMEM; |
| 130 | memcpy(delegation->stateid.data, res->delegation.data, | 125 | memcpy(delegation->stateid.data, res->delegation.data, |
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 76ca1cbc38f9..377839bed172 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c | |||
| @@ -855,6 +855,5 @@ int __init nfs_init_directcache(void) | |||
| 855 | */ | 855 | */ |
| 856 | void nfs_destroy_directcache(void) | 856 | void nfs_destroy_directcache(void) |
| 857 | { | 857 | { |
| 858 | if (kmem_cache_destroy(nfs_direct_cachep)) | 858 | kmem_cache_destroy(nfs_direct_cachep); |
| 859 | printk(KERN_INFO "nfs_direct_cache: not all structures were freed\n"); | ||
| 860 | } | 859 | } |
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index e8c143d182c4..bc9376ca86cd 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
| @@ -277,10 +277,8 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) | |||
| 277 | * report the blocks in 512byte units | 277 | * report the blocks in 512byte units |
| 278 | */ | 278 | */ |
| 279 | inode->i_blocks = nfs_calc_block_size(fattr->du.nfs3.used); | 279 | inode->i_blocks = nfs_calc_block_size(fattr->du.nfs3.used); |
| 280 | inode->i_blksize = inode->i_sb->s_blocksize; | ||
| 281 | } else { | 280 | } else { |
| 282 | inode->i_blocks = fattr->du.nfs2.blocks; | 281 | inode->i_blocks = fattr->du.nfs2.blocks; |
| 283 | inode->i_blksize = fattr->du.nfs2.blocksize; | ||
| 284 | } | 282 | } |
| 285 | nfsi->attrtimeo = NFS_MINATTRTIMEO(inode); | 283 | nfsi->attrtimeo = NFS_MINATTRTIMEO(inode); |
| 286 | nfsi->attrtimeo_timestamp = jiffies; | 284 | nfsi->attrtimeo_timestamp = jiffies; |
| @@ -443,7 +441,7 @@ static struct nfs_open_context *alloc_nfs_open_context(struct vfsmount *mnt, str | |||
| 443 | { | 441 | { |
| 444 | struct nfs_open_context *ctx; | 442 | struct nfs_open_context *ctx; |
| 445 | 443 | ||
| 446 | ctx = (struct nfs_open_context *)kmalloc(sizeof(*ctx), GFP_KERNEL); | 444 | ctx = kmalloc(sizeof(*ctx), GFP_KERNEL); |
| 447 | if (ctx != NULL) { | 445 | if (ctx != NULL) { |
| 448 | atomic_set(&ctx->count, 1); | 446 | atomic_set(&ctx->count, 1); |
| 449 | ctx->dentry = dget(dentry); | 447 | ctx->dentry = dget(dentry); |
| @@ -969,10 +967,8 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
| 969 | * report the blocks in 512byte units | 967 | * report the blocks in 512byte units |
| 970 | */ | 968 | */ |
| 971 | inode->i_blocks = nfs_calc_block_size(fattr->du.nfs3.used); | 969 | inode->i_blocks = nfs_calc_block_size(fattr->du.nfs3.used); |
| 972 | inode->i_blksize = inode->i_sb->s_blocksize; | ||
| 973 | } else { | 970 | } else { |
| 974 | inode->i_blocks = fattr->du.nfs2.blocks; | 971 | inode->i_blocks = fattr->du.nfs2.blocks; |
| 975 | inode->i_blksize = fattr->du.nfs2.blocksize; | ||
| 976 | } | 972 | } |
| 977 | 973 | ||
| 978 | if ((fattr->valid & NFS_ATTR_FATTR_V4) != 0 && | 974 | if ((fattr->valid & NFS_ATTR_FATTR_V4) != 0 && |
| @@ -1134,8 +1130,7 @@ static int __init nfs_init_inodecache(void) | |||
| 1134 | 1130 | ||
| 1135 | static void nfs_destroy_inodecache(void) | 1131 | static void nfs_destroy_inodecache(void) |
| 1136 | { | 1132 | { |
| 1137 | if (kmem_cache_destroy(nfs_inode_cachep)) | 1133 | kmem_cache_destroy(nfs_inode_cachep); |
| 1138 | printk(KERN_INFO "nfs_inode_cache: not all structures were freed\n"); | ||
| 1139 | } | 1134 | } |
| 1140 | 1135 | ||
| 1141 | /* | 1136 | /* |
diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c index 77b00684894d..60408646176b 100644 --- a/fs/nfs/namespace.c +++ b/fs/nfs/namespace.c | |||
| @@ -26,6 +26,11 @@ LIST_HEAD(nfs_automount_list); | |||
| 26 | static DECLARE_WORK(nfs_automount_task, nfs_expire_automounts, &nfs_automount_list); | 26 | static DECLARE_WORK(nfs_automount_task, nfs_expire_automounts, &nfs_automount_list); |
| 27 | int nfs_mountpoint_expiry_timeout = 500 * HZ; | 27 | int nfs_mountpoint_expiry_timeout = 500 * HZ; |
| 28 | 28 | ||
| 29 | static struct vfsmount *nfs_do_submount(const struct vfsmount *mnt_parent, | ||
| 30 | const struct dentry *dentry, | ||
| 31 | struct nfs_fh *fh, | ||
| 32 | struct nfs_fattr *fattr); | ||
| 33 | |||
| 29 | /* | 34 | /* |
| 30 | * nfs_path - reconstruct the path given an arbitrary dentry | 35 | * nfs_path - reconstruct the path given an arbitrary dentry |
| 31 | * @base - arbitrary string to prepend to the path | 36 | * @base - arbitrary string to prepend to the path |
| @@ -209,9 +214,10 @@ static struct vfsmount *nfs_do_clone_mount(struct nfs_server *server, | |||
| 209 | * @fattr - attributes for new root inode | 214 | * @fattr - attributes for new root inode |
| 210 | * | 215 | * |
| 211 | */ | 216 | */ |
| 212 | struct vfsmount *nfs_do_submount(const struct vfsmount *mnt_parent, | 217 | static struct vfsmount *nfs_do_submount(const struct vfsmount *mnt_parent, |
| 213 | const struct dentry *dentry, struct nfs_fh *fh, | 218 | const struct dentry *dentry, |
| 214 | struct nfs_fattr *fattr) | 219 | struct nfs_fh *fh, |
| 220 | struct nfs_fattr *fattr) | ||
| 215 | { | 221 | { |
| 216 | struct nfs_clone_mount mountdata = { | 222 | struct nfs_clone_mount mountdata = { |
| 217 | .sb = mnt_parent->mnt_sb, | 223 | .sb = mnt_parent->mnt_sb, |
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index f8688eaa0001..3b234d4601e7 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c | |||
| @@ -449,7 +449,7 @@ nfs3_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, struct qstr | |||
| 449 | struct nfs_fattr res; | 449 | struct nfs_fattr res; |
| 450 | } *ptr; | 450 | } *ptr; |
| 451 | 451 | ||
| 452 | ptr = (struct unlinkxdr *)kmalloc(sizeof(*ptr), GFP_KERNEL); | 452 | ptr = kmalloc(sizeof(*ptr), GFP_KERNEL); |
| 453 | if (!ptr) | 453 | if (!ptr) |
| 454 | return -ENOMEM; | 454 | return -ENOMEM; |
| 455 | ptr->arg.fh = NFS_FH(dir->d_inode); | 455 | ptr->arg.fh = NFS_FH(dir->d_inode); |
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index 36e902a88ca1..829af323f288 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c | |||
| @@ -392,7 +392,6 @@ int __init nfs_init_nfspagecache(void) | |||
| 392 | 392 | ||
| 393 | void nfs_destroy_nfspagecache(void) | 393 | void nfs_destroy_nfspagecache(void) |
| 394 | { | 394 | { |
| 395 | if (kmem_cache_destroy(nfs_page_cachep)) | 395 | kmem_cache_destroy(nfs_page_cachep); |
| 396 | printk(KERN_INFO "nfs_page: not all structures were freed\n"); | ||
| 397 | } | 396 | } |
| 398 | 397 | ||
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c index 630e50647bbb..4529cc4f3f8f 100644 --- a/fs/nfs/proc.c +++ b/fs/nfs/proc.c | |||
| @@ -352,7 +352,7 @@ nfs_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, struct qstr * | |||
| 352 | { | 352 | { |
| 353 | struct nfs_diropargs *arg; | 353 | struct nfs_diropargs *arg; |
| 354 | 354 | ||
| 355 | arg = (struct nfs_diropargs *)kmalloc(sizeof(*arg), GFP_KERNEL); | 355 | arg = kmalloc(sizeof(*arg), GFP_KERNEL); |
| 356 | if (!arg) | 356 | if (!arg) |
| 357 | return -ENOMEM; | 357 | return -ENOMEM; |
| 358 | arg->fh = NFS_FH(dir->d_inode); | 358 | arg->fh = NFS_FH(dir->d_inode); |
diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 69f1549da2b9..c2e49c397a27 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c | |||
| @@ -737,6 +737,5 @@ int __init nfs_init_readpagecache(void) | |||
| 737 | void nfs_destroy_readpagecache(void) | 737 | void nfs_destroy_readpagecache(void) |
| 738 | { | 738 | { |
| 739 | mempool_destroy(nfs_rdata_mempool); | 739 | mempool_destroy(nfs_rdata_mempool); |
| 740 | if (kmem_cache_destroy(nfs_rdata_cachep)) | 740 | kmem_cache_destroy(nfs_rdata_cachep); |
| 741 | printk(KERN_INFO "nfs_read_data: not all structures were freed\n"); | ||
| 742 | } | 741 | } |
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index c12effb46fe5..b674462793d3 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
| @@ -1565,7 +1565,6 @@ void nfs_destroy_writepagecache(void) | |||
| 1565 | { | 1565 | { |
| 1566 | mempool_destroy(nfs_commit_mempool); | 1566 | mempool_destroy(nfs_commit_mempool); |
| 1567 | mempool_destroy(nfs_wdata_mempool); | 1567 | mempool_destroy(nfs_wdata_mempool); |
| 1568 | if (kmem_cache_destroy(nfs_wdata_cachep)) | 1568 | kmem_cache_destroy(nfs_wdata_cachep); |
| 1569 | printk(KERN_INFO "nfs_write_data: not all structures were freed\n"); | ||
| 1570 | } | 1569 | } |
| 1571 | 1570 | ||
