summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-05-29 09:30:34 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:22:52 -0500
commite8156439f24137b5418baad20a7f00f6949cfe29 (patch)
treeb2d6a876be7a2d7b763402e33e1653899430d48d /source3/utils
parentba0bce2c6f7298840e0d223a5f170b777b8c9d64 (diff)
downloadsamba-e8156439f24137b5418baad20a7f00f6949cfe29.tar.gz
samba-e8156439f24137b5418baad20a7f00f6949cfe29.tar.bz2
samba-e8156439f24137b5418baad20a7f00f6949cfe29.zip
r23183: Check in a change made by Tridge:
This replaces the internal explicit dev/ino file id representation by a "struct file_id". This is necessary as cluster file systems and NFS don't necessarily assign the same device number to the shared file system. With this structure in place we can now easily add different schemes to map a file to a unique 64-bit device node. Jeremy, you might note that I did not change the external interface of smb_share_modes.c. Volker (This used to be commit 9b10dbbd5de8813fc15ebbb6be9b18010ffe8139)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/status.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/source3/utils/status.c b/source3/utils/status.c
index a797c9c4ba..207be30912 100644
--- a/source3/utils/status.c
+++ b/source3/utils/status.c
@@ -166,8 +166,7 @@ static void print_share_mode(const struct share_mode_entry *e,
}
}
-static void print_brl(SMB_DEV_T dev,
- SMB_INO_T ino,
+static void print_brl(struct file_id id,
struct server_id pid,
enum brl_type lock_type,
enum brl_flavour lock_flav,
@@ -175,6 +174,18 @@ static void print_brl(SMB_DEV_T dev,
br_off size)
{
static int count;
+ int i;
+ static const struct {
+ enum brl_type lock_type;
+ const char *desc;
+ } lock_types[] = {
+ { READ_LOCK, "R" },
+ { WRITE_LOCK, "W" },
+ { PENDING_READ_LOCK, "PR" },
+ { PENDING_WRITE_LOCK, "PW" },
+ { UNLOCK_LOCK, "U" }
+ };
+ const char *desc="X";
if (count==0) {
d_printf("Byte range locks:\n");
d_printf(" Pid dev:inode R/W start size\n");
@@ -182,10 +193,16 @@ static void print_brl(SMB_DEV_T dev,
}
count++;
- d_printf("%8s %05x:%05x %s %9.0f %9.0f\n",
- procid_str_static(&pid), (int)dev, (int)ino,
- lock_type==READ_LOCK?"R":"W",
- (double)start, (double)size);
+ 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",
+ procid_str_static(&pid), file_id_static_string(&id),
+ desc,
+ (double)start, (double)size);
}
static int traverse_fn1(struct db_record *rec,