PATCH - 2.6.6-bk3 autofs4 DPRINTK cleanup
fs/autofs4/autofs_i.h +2 -2
@@ -33,9 +33,9 @@/* #define DEBUG */ #ifdef DEBUG -#define DPRINTK (D ) do{ printk("pid %d: ", current->pid); printk D; } while(0) +#define DPRINTK(fmt,args...) do { printk(KERN_DEBUG "pid %d: %s: " fmt "\n" , current->pid , __FUNCTION__ , ##args); } while(0)#else -#define DPRINTK (D ) do {} while(0) +#define DPRINTK(fmt,args...) do {} while(0)#endif #define AUTOFS_SUPER_MAGIC 0x0187
fs/autofs4/expire.c +15 -15
@@ -50,8 +50,8 @@ {int status =0 ; -DPRINTK (("autofs4_check_mount: dentry %p %.*s\n" , - dentry, (int )dentry->d_name.len, dentry->d_name.name)); +DPRINTK ("dentry %p %.*s" , + dentry, (int )dentry->d_name.len, dentry->d_name.name);mntget (mnt);dget (dentry);
@@ -70,7 +70,7 @@if (may_umount_tree (mnt) ==0 ) status =1 ; done: -DPRINTK (("autofs4_check_mount: returning = %d\n" , status)); +DPRINTK ("returning = %d" , status);mntput (mnt);dput (dentry);return status;
@@ -88,8 +88,8 @@struct dentry *this_parent = top;struct list_head *next; -DPRINTK (("autofs4_check_tree: parent %p %.*s\n" , - top, (int )top->d_name.len, top->d_name.name)); +DPRINTK ("parent %p %.*s" , + top, (int )top->d_name.len, top->d_name.name);/* Negative dentry - give up */ if (!simple_positive (top))
@@ -112,8 +112,8 @@continue ; } -DPRINTK (("autofs4_check_tree: dentry %p %.*s\n" , - dentry, (int )dentry->d_name.len, dentry->d_name.name)); +DPRINTK ("dentry %p %.*s" , + dentry, (int )dentry->d_name.len, dentry->d_name.name);if (!simple_empty_nolock (dentry)) { this_parent = dentry;
@@ -154,8 +154,8 @@struct dentry *this_parent = parent;struct list_head *next; -DPRINTK (("autofs4_check_leaves: parent %p %.*s\n" , - parent, (int )parent->d_name.len, parent->d_name.name)); +DPRINTK ("parent %p %.*s" , + parent, (int )parent->d_name.len, parent->d_name.name);spin_lock (&dcache_lock); repeat:
@@ -170,8 +170,8 @@continue ; } -DPRINTK (("autofs4_check_leaves: dentry %p %.*s\n" , - dentry, (int )dentry->d_name.len, dentry->d_name.name)); +DPRINTK ("dentry %p %.*s" , + dentry, (int )dentry->d_name.len, dentry->d_name.name);if (!list_empty (&dentry->d_subdirs)) { this_parent = dentry;
@@ -250,8 +250,8 @@/* Case 1: indirect mount or top level direct mount */ if (d_mountpoint (dentry)) { -DPRINTK (("autofs4_expire: checking mountpoint %p %.*s\n" , - dentry, (int )dentry->d_name.len, dentry->d_name.name)); +DPRINTK ("checking mountpoint %p %.*s" , + dentry, (int )dentry->d_name.len, dentry->d_name.name);/* Can we expire this guy */ if (!autofs4_can_expire (dentry, timeout, do_now))
@@ -289,8 +289,8 @@ }if ( expired ) { -DPRINTK (("autofs4_expire: returning %p %.*s\n" , - expired, (int )expired->d_name.len, expired->d_name.name)); +DPRINTK ("returning %p %.*s" , + expired, (int )expired->d_name.len, expired->d_name.name);spin_lock (&dcache_lock);list_del (&expired->d_parent->d_subdirs);list_add (&expired->d_parent->d_subdirs, &expired->d_child);
fs/autofs4/inode.c +3 -3
@@ -87,7 +87,7 @@kfree (sbi); -DPRINTK (("autofs: shutting down\n" )); +DPRINTK ("shutting down" ); }static struct super_operations autofs4_sops = {
@@ -193,7 +193,7 @@ sbi = (struct autofs_sb_info *)kmalloc (sizeof (*sbi),GFP_KERNEL );if ( !sbi ) goto fail_unlock; -DPRINTK (("autofs: starting up, sbi = %p\n" ,sbi)); +DPRINTK ("starting up, sbi = %p" ,sbi);memset (sbi,0 ,sizeof (*sbi));
@@ -253,7 +253,7 @@ sbi->version = maxproto >AUTOFS_MAX_PROTO_VERSION ?AUTOFS_MAX_PROTO_VERSION : maxproto; sbi->sub_version =AUTOFS_PROTO_SUBVERSION ; -DPRINTK (("autofs: pipe fd = %d, pgrp = %u\n" , pipefd, sbi->oz_pgrp)); +DPRINTK ("pipe fd = %d, pgrp = %u" , pipefd, sbi->oz_pgrp); pipe =fget (pipefd);if ( !pipe ) {
fs/autofs4/root.c +40 -42
225 lines not on this page · raw message
fs/autofs4/waitq.c +8 -8
@@ -28,7 +28,7 @@ {struct autofs_wait_queue *wq, *nwq; -DPRINTK (("autofs: entering catatonic mode\n" )); +DPRINTK ("entering catatonic mode" ); sbi->catatonic =1 ; wq = sbi->queues;
@@ -91,8 +91,8 @@union autofs_packet_union pkt;size_t pktsz; -DPRINTK (("autofs4_notify_daemon: wait id = 0x%08lx, name = %.*s, type=%d\n" , - wq->wait_queue_token, wq->len, wq->name, type)); +DPRINTK ("wait id = 0x%08lx, name = %.*s, type=%d" , + wq->wait_queue_token, wq->len, wq->name, type);memset (&pkt,0 ,sizeof pkt);/* For security reasons */
@@ -212,8 +212,8 @@atomic_set (&wq->wait_ctr,2 );up (&sbi->wq_sem); -DPRINTK (("autofs4_wait: new wait id = 0x%08lx, name = %.*s, nfy=%d\n" , - (unsigned long ) wq->wait_queue_token, wq->len, wq->name, notify)); +DPRINTK ("new wait id = 0x%08lx, name = %.*s, nfy=%d" , + (unsigned long ) wq->wait_queue_token, wq->len, wq->name, notify);/* autofs4_notify_daemon() may block */ if (notify !=NFY_NONE ) { autofs4_notify_daemon(sbi,wq,
@@ -224,8 +224,8 @@ }else {atomic_inc (&wq->wait_ctr);up (&sbi->wq_sem); -DPRINTK (("autofs4_wait: existing wait id = 0x%08lx, name = %.*s, nfy=%d\n" , - (unsigned long ) wq->wait_queue_token, wq->len, wq->name, notify)); +DPRINTK ("existing wait id = 0x%08lx, name = %.*s, nfy=%d" , + (unsigned long ) wq->wait_queue_token, wq->len, wq->name, notify); }/* wq->name is NULL if and only if the lock is already released */
@@ -257,7 +257,7 @@recalc_sigpending ();spin_unlock_irqrestore (¤t->sighand->siglock, irqflags); }else { -DPRINTK (("autofs4_wait: skipped sleeping\n" )); +DPRINTK ("skipped sleeping" ); } status = wq->status;
Ian Kent
maintainerHi Joe,
Why are you removing the function names from the printks?
Since I'm the one that receives the bug reports and works through them I think I have the say in what I need to make it easier for me.
The function names are an essential debuging aid for me, please put them back!
btw the code looks a bit out of date. So you're likely wasting you time as well.
If you would like to help with autofs4 then you can find the latest patches at http://www.kernel.org/pub/linux/daemons/autofs/v4.
Ian
Ian Kent
maintainerQuoted 3 lines · Ian Kent
btw the code looks a bit out of date. So you're likely wasting you time as well.
Sorry. That's garbage. This is in fact my current code.
Ian
Quoted 3 lines · Ian Kent
Hi Joe,
Why are you removing the function names from the printks?
Hi Kent.
The function names were moved to the DPRINTK macro itself so they can't be out of date again.
Regards, Joe
#ifdef DEBUG
-#define DPRINTK(D) do{ printk("pid %d: ", current->pid); printk D; } while(0)
+#define DPRINTK(fmt,args...) do { printk(KERN_DEBUG "pid %d: %s: " fmt "\n" , current->pid , __FUNCTION__ , ##args); } while(0)
#else
-#define DPRINTK(D) do {} while(0)
+#define DPRINTK(fmt,args...) do {} while(0)
#endif
[email protected]
maintainerQuoted 6 lines · Joe Perches
Quoted 3 lines · Ian Kent
Hi Joe,
Why are you removing the function names from the printks?
Hi Kent.
That's Ian please.
Quoted 3 lines
The function names were moved to the DPRINTK macro itself so they can't be out of date again.
Cool. I stand corrected.
Ian