[SCM] Samba Shared Repository - branch master updated
Volker Lendecke
vlendec at samba.org
Sun Feb 19 11:17:02 MST 2012
The branch, master has been updated
via f217fae s3: get_share_mode_lock_fresh->get_share_mode_lock
via e5c8484 s3: get_share_mode_lock->get_existing_share_mode_lock
from da84242 Revert 42d4152ed4255f22ff0718d450f181468d7fb827.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit f217faef1a7d55f24265181889df36bf868d7abd
Author: Volker Lendecke <vl at samba.org>
Date: Sun Feb 19 14:27:49 2012 +0100
s3: get_share_mode_lock_fresh->get_share_mode_lock
get_share_mode_lock_fresh is just a confusing name
Autobuild-User: Volker Lendecke <vl at samba.org>
Autobuild-Date: Sun Feb 19 19:16:41 CET 2012 on sn-devel-104
commit e5c84840737692b6c445e4ed316d869f6d0394bf
Author: Volker Lendecke <vl at samba.org>
Date: Sun Feb 19 14:23:56 2012 +0100
s3: get_share_mode_lock->get_existing_share_mode_lock
-----------------------------------------------------------------------
Summary of changes:
source3/locking/locking.c | 12 ++++++------
source3/locking/proto.h | 6 +++---
source3/locking/share_mode_lock.c | 2 +-
source3/smbd/close.c | 6 +++---
source3/smbd/open.c | 21 +++++++++++----------
source3/smbd/oplock.c | 6 +++---
source3/smbd/reply.c | 2 +-
source3/smbd/trans2.c | 2 +-
8 files changed, 29 insertions(+), 28 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index 7063b54..149a79d 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -453,10 +453,10 @@ char *share_mode_str(TALLOC_CTX *ctx, int num, const struct share_mode_entry *e)
counts it internally to allow for nested lock fetches.
********************************************************************/
-struct share_mode_lock *get_share_mode_lock(TALLOC_CTX *mem_ctx,
- const struct file_id id)
+struct share_mode_lock *get_existing_share_mode_lock(TALLOC_CTX *mem_ctx,
+ const struct file_id id)
{
- return get_share_mode_lock_fresh(mem_ctx, id, NULL, NULL, NULL);
+ return get_share_mode_lock(mem_ctx, id, NULL, NULL, NULL);
}
/*******************************************************************
@@ -953,7 +953,7 @@ bool set_delete_on_close(files_struct *fsp, bool delete_on_close, const struct s
delete_on_close ? "Adding" : "Removing", fsp->fnum,
fsp_str_dbg(fsp)));
- lck = get_share_mode_lock(talloc_tos(), fsp->file_id);
+ lck = get_existing_share_mode_lock(talloc_tos(), fsp->file_id);
if (lck == NULL) {
return False;
}
@@ -1006,7 +1006,7 @@ bool set_sticky_write_time(struct file_id fileid, struct timespec write_time)
convert_timespec_to_time_t(write_time)),
file_id_string_tos(&fileid)));
- lck = get_share_mode_lock(talloc_tos(), fileid);
+ lck = get_existing_share_mode_lock(talloc_tos(), fileid);
if (lck == NULL) {
return False;
}
@@ -1029,7 +1029,7 @@ bool set_write_time(struct file_id fileid, struct timespec write_time)
convert_timespec_to_time_t(write_time)),
file_id_string_tos(&fileid)));
- lck = get_share_mode_lock(talloc_tos(), fileid);
+ lck = get_existing_share_mode_lock(talloc_tos(), fileid);
if (lck == NULL) {
return False;
}
diff --git a/source3/locking/proto.h b/source3/locking/proto.h
index 25f3d19..3a6df37 100644
--- a/source3/locking/proto.h
+++ b/source3/locking/proto.h
@@ -146,9 +146,9 @@ bool locking_init(void);
bool locking_init_readonly(void);
bool locking_end(void);
char *share_mode_str(TALLOC_CTX *ctx, int num, const struct share_mode_entry *e);
-struct share_mode_lock *get_share_mode_lock(TALLOC_CTX *mem_ctx,
- const struct file_id id);
-struct share_mode_lock *get_share_mode_lock_fresh(
+struct share_mode_lock *get_existing_share_mode_lock(TALLOC_CTX *mem_ctx,
+ const struct file_id id);
+struct share_mode_lock *get_share_mode_lock(
TALLOC_CTX *mem_ctx,
const struct file_id id,
const char *servicepath,
diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c
index 6bc055f..2152591 100644
--- a/source3/locking/share_mode_lock.c
+++ b/source3/locking/share_mode_lock.c
@@ -388,7 +388,7 @@ static int the_lock_destructor(struct share_mode_lock *l)
Get a share_mode_lock, Reference counted to allow nexted calls.
********************************************************************/
-struct share_mode_lock *get_share_mode_lock_fresh(
+struct share_mode_lock *get_share_mode_lock(
TALLOC_CTX *mem_ctx,
const struct file_id id,
const char *servicepath,
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index 42e88d8..1a123b4 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -347,7 +347,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(talloc_tos(), fsp->file_id);
+ lck = get_existing_share_mode_lock(talloc_tos(), fsp->file_id);
if (lck == NULL) {
DEBUG(0, ("close_remove_share_mode: Could not get share mode "
"lock for file %s\n", fsp_str_dbg(fsp)));
@@ -615,7 +615,7 @@ static NTSTATUS update_write_time_on_close(struct files_struct *fsp)
* must update it in the open file db too. */
(void)set_write_time(fsp->file_id, fsp->close_write_time);
- lck = get_share_mode_lock(talloc_tos(), fsp->file_id);
+ lck = get_existing_share_mode_lock(talloc_tos(), fsp->file_id);
if (lck) {
/* Close write times overwrite sticky write times
so we must replace any sticky write time here. */
@@ -1017,7 +1017,7 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp,
* reference to a directory also.
*/
- lck = get_share_mode_lock(talloc_tos(), fsp->file_id);
+ lck = get_existing_share_mode_lock(talloc_tos(), fsp->file_id);
if (lck == NULL) {
DEBUG(0, ("close_directory: Could not get share mode lock for "
"%s\n", fsp_str_dbg(fsp)));
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index daa9bb9..e9637c8 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1594,7 +1594,8 @@ NTSTATUS smbd_calculate_access_mask(connection_struct *conn,
void remove_deferred_open_entry(struct file_id id, uint64_t mid,
struct server_id pid)
{
- struct share_mode_lock *lck = get_share_mode_lock(talloc_tos(), id);
+ struct share_mode_lock *lck = get_existing_share_mode_lock(
+ talloc_tos(), id);
if (lck == NULL) {
DEBUG(0, ("could not get share mode lock\n"));
return;
@@ -1948,9 +1949,9 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
struct timespec old_write_time = smb_fname->st.st_ex_mtime;
id = vfs_file_id_from_sbuf(conn, &smb_fname->st);
- lck = get_share_mode_lock_fresh(talloc_tos(), id,
- conn->connectpath,
- smb_fname, &old_write_time);
+ lck = get_share_mode_lock(talloc_tos(), id,
+ conn->connectpath,
+ smb_fname, &old_write_time);
if (lck == NULL) {
DEBUG(0, ("Could not get share mode lock\n"));
return NT_STATUS_SHARING_VIOLATION;
@@ -2190,9 +2191,9 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
id = fsp->file_id;
- lck = get_share_mode_lock_fresh(talloc_tos(), id,
- conn->connectpath,
- smb_fname, &old_write_time);
+ lck = get_share_mode_lock(talloc_tos(), id,
+ conn->connectpath,
+ smb_fname, &old_write_time);
if (lck == NULL) {
DEBUG(0, ("open_file_ntcreate: Could not get share "
@@ -2877,9 +2878,9 @@ static NTSTATUS open_directory(connection_struct *conn,
return NT_STATUS_ACCESS_DENIED;
}
- lck = get_share_mode_lock_fresh(talloc_tos(), fsp->file_id,
- conn->connectpath, smb_dname,
- &mtimespec);
+ lck = get_share_mode_lock(talloc_tos(), fsp->file_id,
+ conn->connectpath, smb_dname,
+ &mtimespec);
if (lck == NULL) {
DEBUG(0, ("open_directory: Could not get share mode lock for "
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index 0c4155d..f760171 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -162,7 +162,7 @@ bool remove_oplock(files_struct *fsp)
struct share_mode_lock *lck;
/* Remove the oplock flag from the sharemode. */
- lck = get_share_mode_lock(talloc_tos(), fsp->file_id);
+ lck = get_existing_share_mode_lock(talloc_tos(), fsp->file_id);
if (lck == NULL) {
DEBUG(0,("remove_oplock: failed to lock share entry for "
"file %s\n", fsp_str_dbg(fsp)));
@@ -188,7 +188,7 @@ bool downgrade_oplock(files_struct *fsp)
bool ret;
struct share_mode_lock *lck;
- lck = get_share_mode_lock(talloc_tos(), fsp->file_id);
+ lck = get_existing_share_mode_lock(talloc_tos(), fsp->file_id);
if (lck == NULL) {
DEBUG(0,("downgrade_oplock: failed to lock share entry for "
"file %s\n", fsp_str_dbg(fsp)));
@@ -804,7 +804,7 @@ static void do_break_to_none(struct tevent_req *req)
DEBUG(1, ("tevent_wakeup_recv failed\n"));
goto done;
}
- lck = get_share_mode_lock(talloc_tos(), state->id);
+ lck = get_existing_share_mode_lock(talloc_tos(), state->id);
if (lck == NULL) {
DEBUG(1, ("release_level_2_oplocks_on_change: failed to lock "
"share mode entry for file %s.\n",
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index b026d34..eebd77d 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -6205,7 +6205,7 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
status = NT_STATUS_ACCESS_DENIED;
}
- lck = get_share_mode_lock(talloc_tos(), fsp->file_id);
+ lck = get_existing_share_mode_lock(talloc_tos(), fsp->file_id);
/*
* We have the file open ourselves, so not being able to get the
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 336e76e..d2eff4d 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -7565,7 +7565,7 @@ static NTSTATUS smb_posix_unlink(connection_struct *conn,
* non-POSIX opens return SHARING_VIOLATION.
*/
- lck = get_share_mode_lock(talloc_tos(), fsp->file_id);
+ lck = get_existing_share_mode_lock(talloc_tos(), fsp->file_id);
if (lck == NULL) {
DEBUG(0, ("smb_posix_unlink: Could not get share mode "
"lock for file %s\n", fsp_str_dbg(fsp)));
--
Samba Shared Repository
More information about the samba-cvs
mailing list