Author: metze
Date: 2007-08-01 11:18:56 +0000 (Wed, 01 Aug 2007)
New Revision: 24115

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=24115

Log:
try to get the file name and share patch for printing
brlocks from the share_mode db, as the same fileid
is used.

metze
Modified:
   branches/SAMBA_3_2/source/utils/status.c


Changeset:
Modified: branches/SAMBA_3_2/source/utils/status.c
===================================================================
--- branches/SAMBA_3_2/source/utils/status.c    2007-08-01 10:06:04 UTC (rev 
24114)
+++ branches/SAMBA_3_2/source/utils/status.c    2007-08-01 11:18:56 UTC (rev 
24115)
@@ -190,23 +190,36 @@
                { UNLOCK_LOCK, "U" }
        };
        const char *desc="X";
+       const char *sharepath = "";
+       const char *fname = "";
+       struct share_mode_lock *share_mode;
+
        if (count==0) {
                d_printf("Byte range locks:\n");
-               d_printf("   Pid     dev:inode  R/W      start        size\n");
-               d_printf("------------------------------------------------\n");
+               d_printf("Pid        dev:inode       R/W  start     size      
SharePath               Name\n");
+               
d_printf("--------------------------------------------------------------------------------\n");
        }
        count++;
 
+       share_mode = fetch_share_mode_unlocked(NULL, id, "__unspecified__", 
"__unspecified__");
+       if (share_mode) {
+               sharepath = share_mode->servicepath;
+               fname = share_mode->filename;
+       }
+
        for (i=0;i<ARRAY_SIZE(lock_types);i++) {
                if (lock_type == lock_types[i].lock_type) {
                        desc = lock_types[i].desc;
                }
        }
 
-       d_printf("%8s   %s    %2s  %9.0f   %9.0f\n", 
+       d_printf("%-10s %-15s %-4s %-9.0f %-9.0f %-24s %-24s\n", 
                 procid_str_static(&pid), file_id_static_string(&id),
                 desc,
-                (double)start, (double)size);
+                (double)start, (double)size,
+                sharepath, fname);
+
+       talloc_free(share_mode);
 }
 
 static int traverse_fn1(struct db_record *rec,

Reply via email to