summaryrefslogtreecommitdiff
path: root/source3/smbd/close.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/smbd/close.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/smbd/close.c')
-rw-r--r--source3/smbd/close.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index 38b4988415..c4aa2e2e28 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -155,6 +155,7 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
struct share_mode_lock *lck;
SMB_STRUCT_STAT sbuf;
NTSTATUS status = NT_STATUS_OK;
+ struct file_id id;
/*
* Lock the share entries, and determine if we should delete
@@ -162,7 +163,7 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
* This prevents race conditions with the file being created. JRA.
*/
- lck = get_share_mode_lock(NULL, fsp->dev, fsp->inode, NULL, NULL);
+ lck = get_share_mode_lock(NULL, fsp->file_id, NULL, NULL);
if (lck == NULL) {
DEBUG(0, ("close_remove_share_mode: Could not get share mode "
@@ -258,15 +259,17 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
goto done;
}
- if(sbuf.st_dev != fsp->dev || sbuf.st_ino != fsp->inode) {
+ id = file_id_sbuf(&sbuf);
+
+ if (!file_id_equal(&fsp->file_id, &id)) {
DEBUG(5,("close_remove_share_mode: file %s. Delete on close "
"was set and dev and/or inode does not match\n",
fsp->fsp_name ));
- DEBUG(5,("close_remove_share_mode: file %s. stored dev = %x, "
- "inode = %.0f stat dev = %x, inode = %.0f\n",
+ DEBUG(5,("close_remove_share_mode: file %s. stored file_id %s, "
+ "stat file_id %s\n",
fsp->fsp_name,
- (unsigned int)fsp->dev, (double)fsp->inode,
- (unsigned int)sbuf.st_dev, (double)sbuf.st_ino ));
+ file_id_static_string(&fsp->file_id),
+ file_id_static_string2(&id)));
/*
* Don't save the errno here, we ignore this error
*/
@@ -405,7 +408,7 @@ static NTSTATUS close_directory(files_struct *fsp, enum file_close_type close_ty
* reference to a directory also.
*/
- lck = get_share_mode_lock(NULL, fsp->dev, fsp->inode, NULL, NULL);
+ lck = get_share_mode_lock(NULL, fsp->file_id, NULL, NULL);
if (lck == NULL) {
DEBUG(0, ("close_directory: Could not get share mode lock for %s\n", fsp->fsp_name));