diff options
author | Jeremy Allison <jra@samba.org> | 2005-12-12 22:07:36 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:05:49 -0500 |
commit | 7d2771e758d4e8ef0adb45e55775b524de4dba9a (patch) | |
tree | f9886027f65a557ce7d76659f638591c55f17fdf /source3/smbd | |
parent | 3f6d9a7b9d35331992fdd069b7752f3082fe0b1b (diff) | |
download | samba-7d2771e758d4e8ef0adb45e55775b524de4dba9a.tar.gz samba-7d2771e758d4e8ef0adb45e55775b524de4dba9a.tar.bz2 samba-7d2771e758d4e8ef0adb45e55775b524de4dba9a.zip |
r12203: Add the share path into the sharemode db. This involves
revving the minor version number for libsmbsharemodes (we
now have a new _ex interface that takes the share path
as well as the filename). Needed for #3303. Some code written
by SATOH Fumiyasu <fumiya@samba.gr.jp> included in the changes
to locking/locking.c. The smbstatus output is a bit of a mess
and needs overhauling...
Jeremy.
(This used to be commit 9d93af713f8520ca506730dd32aa2b994937eaba)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/close.c | 4 | ||||
-rw-r--r-- | source3/smbd/open.c | 15 | ||||
-rw-r--r-- | source3/smbd/oplock.c | 6 | ||||
-rw-r--r-- | source3/smbd/trans2.c | 14 |
4 files changed, 18 insertions, 21 deletions
diff --git a/source3/smbd/close.c b/source3/smbd/close.c index 43049a46a4..d84b9f925b 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -192,7 +192,7 @@ static int close_normal_file(files_struct *fsp, BOOL normal_close) * This prevents race conditions with the file being created. JRA. */ - lck = get_share_mode_lock(NULL, fsp->dev, fsp->inode, NULL); + lck = get_share_mode_lock(NULL, fsp->dev, fsp->inode, NULL, NULL); if (lck == NULL) { DEBUG(0, ("close_file: Could not get share mode lock for file %s\n", fsp->fsp_name)); @@ -305,7 +305,7 @@ static int close_directory(files_struct *fsp, BOOL normal_close) * reference to a directory also. */ - lck = get_share_mode_lock(NULL, fsp->dev, fsp->inode, NULL); + lck = get_share_mode_lock(NULL, fsp->dev, fsp->inode, NULL, NULL); if (lck == NULL) { DEBUG(0, ("close_directory: Could not get share mode lock for %s\n", fsp->fsp_name)); diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 42e1da839f..b3f0589dc7 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -1123,8 +1123,7 @@ files_struct *open_file_ntcreate(connection_struct *conn, spurious oplock break. */ /* Now remove the deferred open entry under lock. */ - lck = get_share_mode_lock(NULL, state->dev, state->inode, - fname); + lck = get_share_mode_lock(NULL, state->dev, state->inode, NULL, NULL); if (lck == NULL) { DEBUG(0, ("could not get share mode lock\n")); } else { @@ -1334,7 +1333,9 @@ files_struct *open_file_ntcreate(connection_struct *conn, dev = psbuf->st_dev; inode = psbuf->st_ino; - lck = get_share_mode_lock(NULL, dev, inode, fname); + lck = get_share_mode_lock(NULL, dev, inode, + conn->connectpath, + fname); if (lck == NULL) { DEBUG(0, ("Could not get share mode lock\n")); @@ -1533,7 +1534,9 @@ files_struct *open_file_ntcreate(connection_struct *conn, dev = fsp->dev; inode = fsp->inode; - lck = get_share_mode_lock(NULL, dev, inode, fname); + lck = get_share_mode_lock(NULL, dev, inode, + conn->connectpath, + fname); if (lck == NULL) { DEBUG(0, ("open_file_ntcreate: Could not get share mode lock for %s\n", fname)); @@ -1940,7 +1943,9 @@ files_struct *open_directory(connection_struct *conn, fsp->is_stat = False; string_set(&fsp->fsp_name,fname); - lck = get_share_mode_lock(NULL, fsp->dev, fsp->inode, fname); + lck = get_share_mode_lock(NULL, fsp->dev, fsp->inode, + conn->connectpath, + fname); if (lck == NULL) { DEBUG(0, ("open_directory: Could not get share mode lock for %s\n", fname)); diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index 385f998b1c..f6c97c3df4 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -182,7 +182,7 @@ BOOL remove_oplock(files_struct *fsp) struct share_mode_lock *lck; /* Remove the oplock flag from the sharemode. */ - lck = get_share_mode_lock(NULL, fsp->dev, fsp->inode, NULL); + lck = get_share_mode_lock(NULL, fsp->dev, fsp->inode, NULL, NULL); if (lck == NULL) { DEBUG(0,("remove_oplock: failed to lock share entry for " "file %s\n", fsp->fsp_name )); @@ -210,7 +210,7 @@ BOOL downgrade_oplock(files_struct *fsp) BOOL ret; struct share_mode_lock *lck; - lck = get_share_mode_lock(NULL, fsp->dev, fsp->inode, NULL); + lck = get_share_mode_lock(NULL, fsp->dev, fsp->inode, NULL, NULL); if (lck == NULL) { DEBUG(0,("downgrade_oplock: failed to lock share entry for " "file %s\n", fsp->fsp_name )); @@ -627,7 +627,7 @@ void release_level_2_oplocks_on_change(files_struct *fsp) if (!LEVEL_II_OPLOCK_TYPE(fsp->oplock_type)) return; - lck = get_share_mode_lock(NULL, fsp->dev, fsp->inode, NULL); + lck = get_share_mode_lock(NULL, fsp->dev, fsp->inode, NULL, NULL); if (lck == NULL) { DEBUG(0,("release_level_2_oplocks_on_change: failed to lock " "share mode entry for file %s.\n", fsp->fsp_name )); diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index ee6bed9afd..c165ea1862 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -2824,10 +2824,7 @@ static int call_trans2qfilepathinfo(connection_struct *conn, char *inbuf, char * return set_bad_path_error(errno, bad_path, outbuf, ERRDOS,ERRbadpath); } - delete_pending = - get_delete_on_close_flag(sbuf.st_dev, - sbuf.st_ino, - fname); + delete_pending = get_delete_on_close_flag(sbuf.st_dev, sbuf.st_ino); } else { /* * Original code - this is an open file. @@ -2840,10 +2837,7 @@ static int call_trans2qfilepathinfo(connection_struct *conn, char *inbuf, char * return(UNIXERROR(ERRDOS,ERRbadfid)); } pos = fsp->fh->position_information; - delete_pending = - get_delete_on_close_flag(sbuf.st_dev, - sbuf.st_ino, - fname); + delete_pending = get_delete_on_close_flag(sbuf.st_dev, sbuf.st_ino); access_mask = fsp->access_mask; } } else { @@ -2885,9 +2879,7 @@ static int call_trans2qfilepathinfo(connection_struct *conn, char *inbuf, char * return set_bad_path_error(errno, bad_path, outbuf, ERRDOS,ERRbadpath); } - delete_pending = get_delete_on_close_flag(sbuf.st_dev, - sbuf.st_ino, - fname); + delete_pending = get_delete_on_close_flag(sbuf.st_dev, sbuf.st_ino); if (delete_pending) { return ERROR_NT(NT_STATUS_DELETE_PENDING); } |