diff options
author | Volker Lendecke <vlendec@samba.org> | 2007-05-29 09:30:34 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:22:52 -0500 |
commit | e8156439f24137b5418baad20a7f00f6949cfe29 (patch) | |
tree | b2d6a876be7a2d7b763402e33e1653899430d48d /source3/include | |
parent | ba0bce2c6f7298840e0d223a5f170b777b8c9d64 (diff) | |
download | samba-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/include')
-rw-r--r-- | source3/include/locking.h | 19 | ||||
-rw-r--r-- | source3/include/smb.h | 11 |
2 files changed, 14 insertions, 16 deletions
diff --git a/source3/include/locking.h b/source3/include/locking.h index e675755839..f02d817133 100644 --- a/source3/include/locking.h +++ b/source3/include/locking.h @@ -42,33 +42,34 @@ struct lock_context { struct server_id pid; }; -/* The key used in the brlock database. */ +struct files_struct; -struct lock_key { - SMB_DEV_T device; - SMB_INO_T inode; +struct file_id { + /* we don't use SMB_DEV_T and SMB_INO_T as we want a fixed size here, + and we may be using file system specific code to fill in something + other than a dev_t for the device */ + uint64_t devid; + uint64_t inode; }; -struct files_struct; - struct byte_range_lock { struct files_struct *fsp; unsigned int num_locks; BOOL modified; BOOL read_only; - struct lock_key key; + struct file_id key; struct lock_struct *lock_data; struct db_record *record; }; #define BRLOCK_FN_CAST() \ - void (*)(SMB_DEV_T dev, SMB_INO_T ino, struct server_id pid, \ + void (*)(struct file_id id, struct server_id pid, \ enum brl_type lock_type, \ enum brl_flavour lock_flav, \ br_off start, br_off size) #define BRLOCK_FN(fn) \ - void (*fn)(SMB_DEV_T dev, SMB_INO_T ino, struct server_id pid, \ + void (*fn)(struct file_id id, struct server_id pid, \ enum brl_type lock_type, \ enum brl_flavour lock_flav, \ br_off start, br_off size) diff --git a/source3/include/smb.h b/source3/include/smb.h index 2375d47fdc..abdb3f37ba 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -422,7 +422,7 @@ struct fd_handle { * DELETE_ON_CLOSE is not stored in the share * mode database. */ - unsigned long file_id; + unsigned long gen_id; }; struct event_context; @@ -486,8 +486,7 @@ typedef struct files_struct { struct fd_handle *fh; unsigned int num_smb_operations; uint16 rap_print_jobid; - SMB_DEV_T dev; - SMB_INO_T inode; + struct file_id file_id; SMB_BIG_UINT initial_allocation_size; /* Faked up initial allocation on disk. */ mode_t mode; uint16 file_pid; @@ -756,8 +755,7 @@ struct share_mode_entry { * NTCREATEX_OPTIONS_PRIVATE_DENY_FCB for * smbstatus and swat */ struct timeval time; - SMB_DEV_T dev; - SMB_INO_T inode; + struct file_id id; unsigned long share_file_id; uint32 uid; /* uid of file opener. */ uint16 flags; /* See SHARE_MODE_XX above. */ @@ -787,8 +785,7 @@ Offset Data length. struct share_mode_lock { const char *servicepath; /* canonicalized. */ const char *filename; - SMB_DEV_T dev; - SMB_INO_T ino; + struct file_id id; int num_share_modes; struct share_mode_entry *share_modes; UNIX_USER_TOKEN *delete_token; |