aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/locking
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-02-27 10:57:14 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2006-02-27 10:57:14 -0500
commitd92a8d48085df863032110d9ccb221cde98d14e1 (patch)
treefaf03d9c10e104f3ab3fb8264e70b4662bae5d33 /fs/gfs2/locking
parent2fcb4a1278ec41508d76786f4c5d23bff3b378ee (diff)
[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 <penberg@cs.helsinki.fi> and Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/locking')
-rw-r--r--fs/gfs2/locking/dlm/lock.c7
-rw-r--r--fs/gfs2/locking/dlm/main.c4
-rw-r--r--fs/gfs2/locking/dlm/plock.c13
-rw-r--r--fs/gfs2/locking/nolock/main.c13
4 files changed, 18 insertions, 19 deletions
diff --git a/fs/gfs2/locking/dlm/lock.c b/fs/gfs2/locking/dlm/lock.c
index 666d696dc8ce..1799d2237e7e 100644
--- a/fs/gfs2/locking/dlm/lock.c
+++ b/fs/gfs2/locking/dlm/lock.c
@@ -34,7 +34,7 @@ static inline void gdlm_bast(void *astarg, int mode)
34 struct gdlm_ls *ls = lp->ls; 34 struct gdlm_ls *ls = lp->ls;
35 35
36 if (!mode) { 36 if (!mode) {
37 printk("lock_dlm: bast mode zero %x,%llx\n", 37 printk(KERN_INFO "lock_dlm: bast mode zero %x,%llx\n",
38 lp->lockname.ln_type, lp->lockname.ln_number); 38 lp->lockname.ln_type, lp->lockname.ln_number);
39 return; 39 return;
40 } 40 }
@@ -408,7 +408,7 @@ static int hold_null_lock(struct gdlm_lock *lp)
408 int error; 408 int error;
409 409
410 if (lp->hold_null) { 410 if (lp->hold_null) {
411 printk("lock_dlm: lvb already held\n"); 411 printk(KERN_INFO "lock_dlm: lvb already held\n");
412 return 0; 412 return 0;
413 } 413 }
414 414
@@ -429,7 +429,8 @@ static int hold_null_lock(struct gdlm_lock *lp)
429 wait_for_completion(&lpn->ast_wait); 429 wait_for_completion(&lpn->ast_wait);
430 error = lp->lksb.sb_status; 430 error = lp->lksb.sb_status;
431 if (error) { 431 if (error) {
432 printk("lock_dlm: hold_null_lock dlm error %d\n", error); 432 printk(KERN_INFO "lock_dlm: hold_null_lock dlm error %d\n",
433 error);
433 gdlm_delete_lp(lpn); 434 gdlm_delete_lp(lpn);
434 lpn = NULL; 435 lpn = NULL;
435 } 436 }
diff --git a/fs/gfs2/locking/dlm/main.c b/fs/gfs2/locking/dlm/main.c
index 2c13c916a352..1c0943de9408 100644
--- a/fs/gfs2/locking/dlm/main.c
+++ b/fs/gfs2/locking/dlm/main.c
@@ -22,7 +22,7 @@ int __init init_lock_dlm(void)
22 22
23 error = gfs_register_lockproto(&gdlm_ops); 23 error = gfs_register_lockproto(&gdlm_ops);
24 if (error) { 24 if (error) {
25 printk("lock_dlm: can't register protocol: %d\n", error); 25 printk(KERN_WARNING "lock_dlm: can't register protocol: %d\n", error);
26 return error; 26 return error;
27 } 27 }
28 28
@@ -42,7 +42,7 @@ int __init init_lock_dlm(void)
42 gdlm_drop_count = GDLM_DROP_COUNT; 42 gdlm_drop_count = GDLM_DROP_COUNT;
43 gdlm_drop_period = GDLM_DROP_PERIOD; 43 gdlm_drop_period = GDLM_DROP_PERIOD;
44 44
45 printk("Lock_DLM (built %s %s) installed\n", __DATE__, __TIME__); 45 printk(KERN_INFO "Lock_DLM (built %s %s) installed\n", __DATE__, __TIME__);
46 return 0; 46 return 0;
47} 47}
48 48
diff --git a/fs/gfs2/locking/dlm/plock.c b/fs/gfs2/locking/dlm/plock.c
index 382847205bc1..f7ac5821def9 100644
--- a/fs/gfs2/locking/dlm/plock.c
+++ b/fs/gfs2/locking/dlm/plock.c
@@ -83,7 +83,7 @@ int gdlm_plock(lm_lockspace_t *lockspace, struct lm_lockname *name,
83 83
84 spin_lock(&ops_lock); 84 spin_lock(&ops_lock);
85 if (!list_empty(&op->list)) { 85 if (!list_empty(&op->list)) {
86 printk("plock op on list\n"); 86 printk(KERN_INFO "plock op on list\n");
87 list_del(&op->list); 87 list_del(&op->list);
88 } 88 }
89 spin_unlock(&ops_lock); 89 spin_unlock(&ops_lock);
@@ -127,7 +127,7 @@ int gdlm_punlock(lm_lockspace_t *lockspace, struct lm_lockname *name,
127 127
128 spin_lock(&ops_lock); 128 spin_lock(&ops_lock);
129 if (!list_empty(&op->list)) { 129 if (!list_empty(&op->list)) {
130 printk("punlock op on list\n"); 130 printk(KERN_INFO "punlock op on list\n");
131 list_del(&op->list); 131 list_del(&op->list);
132 } 132 }
133 spin_unlock(&ops_lock); 133 spin_unlock(&ops_lock);
@@ -162,7 +162,7 @@ int gdlm_plock_get(lm_lockspace_t *lockspace, struct lm_lockname *name,
162 162
163 spin_lock(&ops_lock); 163 spin_lock(&ops_lock);
164 if (!list_empty(&op->list)) { 164 if (!list_empty(&op->list)) {
165 printk("plock_get op on list\n"); 165 printk(KERN_INFO "plock_get op on list\n");
166 list_del(&op->list); 166 list_del(&op->list);
167 } 167 }
168 spin_unlock(&ops_lock); 168 spin_unlock(&ops_lock);
@@ -242,7 +242,7 @@ static ssize_t dev_write(struct file *file, const char __user *u, size_t count,
242 if (found) 242 if (found)
243 wake_up(&recv_wq); 243 wake_up(&recv_wq);
244 else 244 else
245 printk("gdlm dev_write no op %x %llx\n", info.fsid, 245 printk(KERN_INFO "gdlm dev_write no op %x %llx\n", info.fsid,
246 info.number); 246 info.number);
247 return count; 247 return count;
248} 248}
@@ -285,13 +285,14 @@ int gdlm_plock_init(void)
285 285
286 rv = misc_register(&plock_dev_misc); 286 rv = misc_register(&plock_dev_misc);
287 if (rv) 287 if (rv)
288 printk("gdlm_plock_init: misc_register failed %d", rv); 288 printk(KERN_INFO "gdlm_plock_init: misc_register failed %d",
289 rv);
289 return rv; 290 return rv;
290} 291}
291 292
292void gdlm_plock_exit(void) 293void gdlm_plock_exit(void)
293{ 294{
294 if (misc_deregister(&plock_dev_misc) < 0) 295 if (misc_deregister(&plock_dev_misc) < 0)
295 printk("gdlm_plock_exit: misc_deregister failed"); 296 printk(KERN_INFO "gdlm_plock_exit: misc_deregister failed");
296} 297}
297 298
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