aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs/main.c
diff options
context:
space:
mode:
authorRobert P. J. Day <rpjday@mindspring.com>2007-02-10 04:45:03 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 13:51:27 -0500
commitc376222960ae91d5ffb9197ee36771aaed1d9f90 (patch)
tree7f431c42529fec77433d33490bd9f2a8c47ba091 /fs/ecryptfs/main.c
parent1b135431abf5ea92e61bf4e91d93726c7b96da5f (diff)
[PATCH] Transform kmem_cache_alloc()+memset(0) -> kmem_cache_zalloc().
Replace appropriate pairs of "kmem_cache_alloc()" + "memset(0)" with the corresponding "kmem_cache_zalloc()" call. Signed-off-by: Robert P. J. Day <rpjday@mindspring.com> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: Andi Kleen <ak@muc.de> Cc: Roland McGrath <roland@redhat.com> Cc: James Bottomley <James.Bottomley@steeleye.com> Cc: Greg KH <greg@kroah.com> Acked-by: Joel Becker <Joel.Becker@oracle.com> Cc: Steven Whitehouse <swhiteho@redhat.com> Cc: Jan Kara <jack@ucw.cz> Cc: Michael Halcrow <mhalcrow@us.ibm.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Stephen Smalley <sds@tycho.nsa.gov> Cc: James Morris <jmorris@namei.org> Cc: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ecryptfs/main.c')
-rw-r--r--fs/ecryptfs/main.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index d0541ae8faba..fe41ab1566ee 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -378,15 +378,13 @@ ecryptfs_fill_super(struct super_block *sb, void *raw_data, int silent)
378 378
379 /* Released in ecryptfs_put_super() */ 379 /* Released in ecryptfs_put_super() */
380 ecryptfs_set_superblock_private(sb, 380 ecryptfs_set_superblock_private(sb,
381 kmem_cache_alloc(ecryptfs_sb_info_cache, 381 kmem_cache_zalloc(ecryptfs_sb_info_cache,
382 GFP_KERNEL)); 382 GFP_KERNEL));
383 if (!ecryptfs_superblock_to_private(sb)) { 383 if (!ecryptfs_superblock_to_private(sb)) {
384 ecryptfs_printk(KERN_WARNING, "Out of memory\n"); 384 ecryptfs_printk(KERN_WARNING, "Out of memory\n");
385 rc = -ENOMEM; 385 rc = -ENOMEM;
386 goto out; 386 goto out;
387 } 387 }
388 memset(ecryptfs_superblock_to_private(sb), 0,
389 sizeof(struct ecryptfs_sb_info));
390 sb->s_op = &ecryptfs_sops; 388 sb->s_op = &ecryptfs_sops;
391 /* Released through deactivate_super(sb) from get_sb_nodev */ 389 /* Released through deactivate_super(sb) from get_sb_nodev */
392 sb->s_root = d_alloc(NULL, &(const struct qstr) { 390 sb->s_root = d_alloc(NULL, &(const struct qstr) {
@@ -402,7 +400,7 @@ ecryptfs_fill_super(struct super_block *sb, void *raw_data, int silent)
402 /* Released in d_release when dput(sb->s_root) is called */ 400 /* Released in d_release when dput(sb->s_root) is called */
403 /* through deactivate_super(sb) from get_sb_nodev() */ 401 /* through deactivate_super(sb) from get_sb_nodev() */
404 ecryptfs_set_dentry_private(sb->s_root, 402 ecryptfs_set_dentry_private(sb->s_root,
405 kmem_cache_alloc(ecryptfs_dentry_info_cache, 403 kmem_cache_zalloc(ecryptfs_dentry_info_cache,
406 GFP_KERNEL)); 404 GFP_KERNEL));
407 if (!ecryptfs_dentry_to_private(sb->s_root)) { 405 if (!ecryptfs_dentry_to_private(sb->s_root)) {
408 ecryptfs_printk(KERN_ERR, 406 ecryptfs_printk(KERN_ERR,
@@ -410,8 +408,6 @@ ecryptfs_fill_super(struct super_block *sb, void *raw_data, int silent)
410 rc = -ENOMEM; 408 rc = -ENOMEM;
411 goto out; 409 goto out;
412 } 410 }
413 memset(ecryptfs_dentry_to_private(sb->s_root), 0,
414 sizeof(struct ecryptfs_dentry_info));
415 rc = 0; 411 rc = 0;
416out: 412out:
417 /* Should be able to rely on deactivate_super called from 413 /* Should be able to rely on deactivate_super called from