From d92a8d48085df863032110d9ccb221cde98d14e1 Mon Sep 17 00:00:00 2001 From: Steven Whitehouse Date: Mon, 27 Feb 2006 10:57:14 -0500 Subject: [GFS2] Audit printk and kmalloc All printk calls now have KERN_ set where required and a couple of kmalloc(), memset(.., 0, ...) calls changed to kzalloc(). This is in response to comments from: Pekka Enberg and Eric Sesterhenn Signed-off-by: Steven Whitehouse --- fs/gfs2/locking/nolock/main.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'fs/gfs2/locking/nolock/main.c') diff --git a/fs/gfs2/locking/nolock/main.c b/fs/gfs2/locking/nolock/main.c index b716e336c07..7ede0906b2c 100644 --- a/fs/gfs2/locking/nolock/main.c +++ b/fs/gfs2/locking/nolock/main.c @@ -44,11 +44,10 @@ static int nolock_mount(char *table_name, char *host_data, sscanf(c, "%u", &jid); } - nl = kmalloc(sizeof(struct nolock_lockspace), GFP_KERNEL); + nl = kzalloc(sizeof(struct nolock_lockspace), GFP_KERNEL); if (!nl) return -ENOMEM; - memset(nl, 0, sizeof(struct nolock_lockspace)); nl->nl_lvb_size = min_lvb_size; lockstruct->ls_jid = jid; @@ -147,10 +146,8 @@ static int nolock_hold_lvb(lm_lock_t *lock, char **lvbp) struct nolock_lockspace *nl = (struct nolock_lockspace *)lock; int error = 0; - *lvbp = kmalloc(nl->nl_lvb_size, GFP_KERNEL); - if (*lvbp) - memset(*lvbp, 0, nl->nl_lvb_size); - else + *lvbp = kzalloc(nl->nl_lvb_size, GFP_KERNEL); + if (!*lvbp) error = -ENOMEM; return error; @@ -246,11 +243,11 @@ int __init init_nolock(void) error = gfs_register_lockproto(&nolock_ops); if (error) { - printk("lock_nolock: can't register protocol: %d\n", error); + printk(KERN_WARNING "lock_nolock: can't register protocol: %d\n", error); return error; } - printk("Lock_Nolock (built %s %s) installed\n", __DATE__, __TIME__); + printk(KERN_INFO "Lock_Nolock (built %s %s) installed\n", __DATE__, __TIME__); return 0; } -- cgit v1.2.3