From 5910e397d3f2d49c3ec13e064f402137205031a8 Mon Sep 17 00:00:00 2001 From: James Peach Date: Fri, 5 May 2006 02:06:37 +0000 Subject: r15446: Tidy up the formatting of locking debug messages and make it more consistent. Bring oplocks withing the purview of the locking debug channel. (This used to be commit e817cfd7d3a42d141198122eada58b5a7ba90e9c) --- source3/lib/util.c | 6 ++++-- source3/smbd/oplock.c | 40 ++++++++++++++++++++++------------------ source3/smbd/oplock_irix.c | 1 + source3/smbd/oplock_linux.c | 1 + 4 files changed, 28 insertions(+), 20 deletions(-) diff --git a/source3/lib/util.c b/source3/lib/util.c index c023df0b01..a9aebd0822 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -1948,7 +1948,8 @@ BOOL fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type) SMB_STRUCT_FLOCK lock; int ret; - DEBUG(8,("fcntl_lock %d %d %.0f %.0f %d\n",fd,op,(double)offset,(double)count,type)); + DEBUG(8,("fcntl_lock fd=%d op=%d offset=%.0f count=%.0f type=%d\n", + fd,op,(double)offset,(double)count,type)); lock.l_type = type; lock.l_whence = SEEK_SET; @@ -1982,7 +1983,8 @@ BOOL fcntl_getlock(int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pi SMB_STRUCT_FLOCK lock; int ret; - DEBUG(8,("fcntl_getlock %d %.0f %.0f %d\n",fd,(double)*poffset,(double)*pcount,*ptype)); + DEBUG(8,("fcntl_getlock fd=%d offset=%.0f count=%.0f type=%d\n", + fd,(double)*poffset,(double)*pcount,*ptype)); lock.l_type = *ptype; lock.l_whence = SEEK_SET; diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index 70e5bf4d72..8254e77e1b 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -20,6 +20,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#define DBGC_CLASS DBGC_LOCKING #include "includes.h" /* Current number of oplocks we have outstanding. */ @@ -118,10 +119,11 @@ BOOL set_file_oplock(files_struct *fsp, int oplock_type) exclusive_oplocks_open++; } - DEBUG(5,("set_file_oplock: granted oplock on file %s, dev = %x, inode = %.0f, file_id = %lu, \ -tv_sec = %x, tv_usec = %x\n", - fsp->fsp_name, (unsigned int)fsp->dev, (double)fsp->inode, fsp->file_id, - (int)fsp->open_time.tv_sec, (int)fsp->open_time.tv_usec )); + DEBUG(5,("set_file_oplock: granted oplock on file %s, 0x%x/%.0f/%lu, " + "tv_sec = %x, tv_usec = %x\n", + fsp->fsp_name, (unsigned int)fsp->dev, (double)fsp->inode, + fsp->file_id, (int)fsp->open_time.tv_sec, + (int)fsp->open_time.tv_usec )); return True; } @@ -191,7 +193,7 @@ BOOL remove_oplock(files_struct *fsp) ret = remove_share_oplock(lck, fsp); if (!ret) { DEBUG(0,("remove_oplock: failed to remove share oplock for " - "file %s fnum %d, dev = %x, inode = %.0f\n", + "file %s fnum %d, 0x%x/%.0f\n", fsp->fsp_name, fsp->fnum, (unsigned int)dev, (double)inode)); } @@ -292,8 +294,8 @@ static files_struct *initial_break_processing(SMB_DEV_T dev, SMB_INO_T inode, un files_struct *fsp = NULL; if( DEBUGLVL( 3 ) ) { - dbgtext( "initial_break_processing: called for dev = 0x%x, inode = %.0f file_id = %lu\n", - (unsigned int)dev, (double)inode, file_id); + dbgtext( "initial_break_processing: called for 0x%x/%.0f/%u\n", + (unsigned int)dev, (double)inode, (int)file_id); dbgtext( "Current oplocks_open (exclusive = %d, levelII = %d)\n", exclusive_oplocks_open, level_II_oplocks_open ); } @@ -403,9 +405,9 @@ static void process_oplock_async_level2_break_message(int msg_type, struct proce /* De-linearize incoming message. */ message_to_share_mode_entry(&msg, buf); - DEBUG(10, ("Got oplock async level 2 break message from pid %d: 0x%x/%.0f/%d\n", - (int)procid_to_pid(&src), (unsigned int)msg.dev, (double)msg.inode, - (int)msg.share_file_id)); + DEBUG(10, ("Got oplock async level 2 break message from pid %d: 0x%x/%.0f/%lu\n", + (int)procid_to_pid(&src), (unsigned int)msg.dev, + (double)msg.inode, msg.share_file_id)); fsp = initial_break_processing(msg.dev, msg.inode, msg.share_file_id); @@ -490,9 +492,9 @@ static void process_oplock_break_message(int msg_type, struct process_id src, /* De-linearize incoming message. */ message_to_share_mode_entry(&msg, buf); - DEBUG(10, ("Got oplock break message from pid %d: 0x%x/%.0f/%d\n", - (int)procid_to_pid(&src), (unsigned int)msg.dev, (double)msg.inode, - (int)msg.share_file_id)); + DEBUG(10, ("Got oplock break message from pid %d: 0x%x/%.0f/%lu\n", + (int)procid_to_pid(&src), (unsigned int)msg.dev, + (double)msg.inode, msg.share_file_id)); fsp = initial_break_processing(msg.dev, msg.inode, msg.share_file_id); @@ -693,9 +695,10 @@ static void process_oplock_break_response(int msg_type, struct process_id src, /* De-linearize incoming message. */ message_to_share_mode_entry(&msg, buf); - DEBUG(10, ("Got oplock break response from pid %d: 0x%x/%.0f/%u mid %u\n", - (int)procid_to_pid(&src), (unsigned int)msg.dev, (double)msg.inode, - (unsigned int)msg.share_file_id, (unsigned int)msg.op_mid)); + DEBUG(10, ("Got oplock break response from pid %d: 0x%x/%.0f/%lu mid %u\n", + (int)procid_to_pid(&src), (unsigned int)msg.dev, + (double)msg.inode, msg.share_file_id, + (unsigned int)msg.op_mid)); /* Here's the hack from open.c, store the mid in the 'port' field */ schedule_deferred_open_smb_message(msg.op_mid); @@ -719,8 +722,9 @@ static void process_open_retry_message(int msg_type, struct process_id src, /* De-linearize incoming message. */ message_to_share_mode_entry(&msg, buf); - DEBUG(10, ("Got open retry msg from pid %d: 0x%x/%.0f mid %u\n", - (int)procid_to_pid(&src), (unsigned int)msg.dev, (double)msg.inode, + DEBUG(10, ("Got open retry msg from pid %d: 0x%x/%.0f/%lu mid %u\n", + (int)procid_to_pid(&src), (unsigned int)msg.dev, + (double)msg.inode, msg.share_file_id, (unsigned int)msg.op_mid)); schedule_deferred_open_smb_message(msg.op_mid); diff --git a/source3/smbd/oplock_irix.c b/source3/smbd/oplock_irix.c index 83883444a7..73d582157d 100644 --- a/source3/smbd/oplock_irix.c +++ b/source3/smbd/oplock_irix.c @@ -18,6 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#define DBGC_CLASS DBGC_LOCKING #include "includes.h" #if HAVE_KERNEL_OPLOCKS_IRIX diff --git a/source3/smbd/oplock_linux.c b/source3/smbd/oplock_linux.c index ab0c08f7fc..9a5eb52e61 100644 --- a/source3/smbd/oplock_linux.c +++ b/source3/smbd/oplock_linux.c @@ -18,6 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#define DBGC_CLASS DBGC_LOCKING #include "includes.h" #if HAVE_KERNEL_OPLOCKS_LINUX -- cgit