summaryrefslogtreecommitdiff
path: root/source3/locking/posix.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
commite8156439f24137b5418baad20a7f00f6949cfe29 (patch)
treeb2d6a876be7a2d7b763402e33e1653899430d48d /source3/locking/posix.c
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/locking/posix.c')
-rw-r--r--source3/locking/posix.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/source3/locking/posix.c b/source3/locking/posix.c
index 338ee0416b..73fc2c7bd0 100644
--- a/source3/locking/posix.c
+++ b/source3/locking/posix.c
@@ -318,28 +318,19 @@ BOOL is_posix_locked(files_struct *fsp,
/* The key used in the in-memory POSIX databases. */
struct lock_ref_count_key {
- SMB_DEV_T device;
- SMB_INO_T inode;
+ struct file_id id;
char r;
};
-struct fd_key {
- SMB_DEV_T device;
- SMB_INO_T inode;
-};
-
/*******************************************************************
Form a static locking key for a dev/inode pair for the fd array.
******************************************************************/
-static TDB_DATA fd_array_key(SMB_DEV_T dev, SMB_INO_T inode)
+static TDB_DATA fd_array_key(struct file_id id)
{
- static struct fd_key key;
+ static struct file_id key;
TDB_DATA kbuf;
-
- memset(&key, '\0', sizeof(key));
- key.device = dev;
- key.inode = inode;
+ key = id;
kbuf.dptr = (uint8 *)&key;
kbuf.dsize = sizeof(key);
return kbuf;
@@ -349,14 +340,13 @@ static TDB_DATA fd_array_key(SMB_DEV_T dev, SMB_INO_T inode)
Form a static locking key for a dev/inode pair for the lock ref count
******************************************************************/
-static TDB_DATA locking_ref_count_key(SMB_DEV_T dev, SMB_INO_T inode)
+static TDB_DATA locking_ref_count_key(struct file_id id)
{
static struct lock_ref_count_key key;
TDB_DATA kbuf;
memset(&key, '\0', sizeof(key));
- key.device = dev;
- key.inode = inode;
+ key.id = id;
key.r = 'r';
kbuf.dptr = (uint8 *)&key;
kbuf.dsize = sizeof(key);
@@ -369,7 +359,7 @@ static TDB_DATA locking_ref_count_key(SMB_DEV_T dev, SMB_INO_T inode)
static TDB_DATA fd_array_key_fsp(files_struct *fsp)
{
- return fd_array_key(fsp->dev, fsp->inode);
+ return fd_array_key(fsp->file_id);
}
/*******************************************************************
@@ -378,7 +368,7 @@ static TDB_DATA fd_array_key_fsp(files_struct *fsp)
static TDB_DATA locking_ref_count_key_fsp(files_struct *fsp)
{
- return locking_ref_count_key(fsp->dev, fsp->inode);
+ return locking_ref_count_key(fsp->file_id);
}
/*******************************************************************