summaryrefslogtreecommitdiffstats
path: root/source/locking/brlock.c
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
commit9b10dbbd5de8813fc15ebbb6be9b18010ffe8139 (patch)
tree03d6399f963119ad07d2cbdbaf39698ff6a432b8 /source/locking/brlock.c
parent0153386c1a3625b2f699863991893f399c40af48 (diff)
downloadsamba-9b10dbbd5de8813fc15ebbb6be9b18010ffe8139.tar.gz
samba-9b10dbbd5de8813fc15ebbb6be9b18010ffe8139.tar.xz
samba-9b10dbbd5de8813fc15ebbb6be9b18010ffe8139.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
Diffstat (limited to 'source/locking/brlock.c')
-rw-r--r--source/locking/brlock.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/source/locking/brlock.c b/source/locking/brlock.c
index 8e2f7ce41a6..a37afbddd53 100644
--- a/source/locking/brlock.c
+++ b/source/locking/brlock.c
@@ -1455,7 +1455,7 @@ static BOOL validate_lock_entries(unsigned int *pnum_entries, struct lock_struct
static int traverse_fn(struct db_record *rec, void *state)
{
struct lock_struct *locks;
- struct lock_key *key;
+ struct file_id *key;
unsigned int i;
unsigned int num_locks = 0;
unsigned int orig_num_locks = 0;
@@ -1471,7 +1471,7 @@ static int traverse_fn(struct db_record *rec, void *state)
return -1; /* Terminate traversal. */
}
- key = (struct lock_key *)rec->key.dptr;
+ key = (struct file_id *)rec->key.dptr;
orig_num_locks = num_locks = rec->value.dsize/sizeof(*locks);
/* Ensure the lock db is clean of entries from invalid processes. */
@@ -1493,8 +1493,7 @@ static int traverse_fn(struct db_record *rec, void *state)
}
for ( i=0; i<num_locks; i++) {
- traverse_callback(key->device,
- key->inode,
+ traverse_callback(*key,
locks[i].context.pid,
locks[i].lock_type,
locks[i].lock_flav,
@@ -1529,7 +1528,7 @@ static int byte_range_lock_destructor(struct byte_range_lock *br_lck)
TDB_DATA key;
key.dptr = (uint8 *)&br_lck->key;
- key.dsize = sizeof(struct lock_key);
+ key.dsize = sizeof(struct file_id);
if (br_lck->read_only) {
SMB_ASSERT(!br_lck->modified);
@@ -1588,12 +1587,11 @@ static struct byte_range_lock *brl_get_locks_internal(TALLOC_CTX *mem_ctx,
br_lck->fsp = fsp;
br_lck->num_locks = 0;
br_lck->modified = False;
- memset(&br_lck->key, '\0', sizeof(struct lock_key));
- br_lck->key.device = fsp->dev;
- br_lck->key.inode = fsp->inode;
+ memset(&br_lck->key, '\0', sizeof(struct file_id));
+ br_lck->key = fsp->file_id;
key.dptr = (uint8 *)&br_lck->key;
- key.dsize = sizeof(struct lock_key);
+ key.dsize = sizeof(struct file_id);
if (!fsp->lockdb_clean) {
/* We must be read/write to clean
@@ -1649,9 +1647,9 @@ static struct byte_range_lock *brl_get_locks_internal(TALLOC_CTX *mem_ctx,
if (DEBUGLEVEL >= 10) {
unsigned int i;
struct lock_struct *locks = br_lck->lock_data;
- DEBUG(10,("brl_get_locks_internal: %u current locks on dev=%.0f, inode=%.0f\n",
+ DEBUG(10,("brl_get_locks_internal: %u current locks on file_id %s\n",
br_lck->num_locks,
- (double)fsp->dev, (double)fsp->inode ));
+ file_id_static_string(&fsp->file_id)));
for( i = 0; i < br_lck->num_locks; i++) {
print_lock_struct(i, &locks[i]);
}