diff options
Diffstat (limited to 'fs/gfs2/locking/nolock/main.c')
-rw-r--r-- | fs/gfs2/locking/nolock/main.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/gfs2/locking/nolock/main.c b/fs/gfs2/locking/nolock/main.c index b716e336c073..7ede0906b2c6 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, | |||
44 | sscanf(c, "%u", &jid); | 44 | sscanf(c, "%u", &jid); |
45 | } | 45 | } |
46 | 46 | ||
47 | nl = kmalloc(sizeof(struct nolock_lockspace), GFP_KERNEL); | 47 | nl = kzalloc(sizeof(struct nolock_lockspace), GFP_KERNEL); |
48 | if (!nl) | 48 | if (!nl) |
49 | return -ENOMEM; | 49 | return -ENOMEM; |
50 | 50 | ||
51 | memset(nl, 0, sizeof(struct nolock_lockspace)); | ||
52 | nl->nl_lvb_size = min_lvb_size; | 51 | nl->nl_lvb_size = min_lvb_size; |
53 | 52 | ||
54 | lockstruct->ls_jid = jid; | 53 | lockstruct->ls_jid = jid; |
@@ -147,10 +146,8 @@ static int nolock_hold_lvb(lm_lock_t *lock, char **lvbp) | |||
147 | struct nolock_lockspace *nl = (struct nolock_lockspace *)lock; | 146 | struct nolock_lockspace *nl = (struct nolock_lockspace *)lock; |
148 | int error = 0; | 147 | int error = 0; |
149 | 148 | ||
150 | *lvbp = kmalloc(nl->nl_lvb_size, GFP_KERNEL); | 149 | *lvbp = kzalloc(nl->nl_lvb_size, GFP_KERNEL); |
151 | if (*lvbp) | 150 | if (!*lvbp) |
152 | memset(*lvbp, 0, nl->nl_lvb_size); | ||
153 | else | ||
154 | error = -ENOMEM; | 151 | error = -ENOMEM; |
155 | 152 | ||
156 | return error; | 153 | return error; |
@@ -246,11 +243,11 @@ int __init init_nolock(void) | |||
246 | 243 | ||
247 | error = gfs_register_lockproto(&nolock_ops); | 244 | error = gfs_register_lockproto(&nolock_ops); |
248 | if (error) { | 245 | if (error) { |
249 | printk("lock_nolock: can't register protocol: %d\n", error); | 246 | printk(KERN_WARNING "lock_nolock: can't register protocol: %d\n", error); |
250 | return error; | 247 | return error; |
251 | } | 248 | } |
252 | 249 | ||
253 | printk("Lock_Nolock (built %s %s) installed\n", __DATE__, __TIME__); | 250 | printk(KERN_INFO "Lock_Nolock (built %s %s) installed\n", __DATE__, __TIME__); |
254 | return 0; | 251 | return 0; |
255 | } | 252 | } |
256 | 253 | ||