diff options
author | Volker Lendecke <vl@samba.org> | 2013-11-22 16:24:42 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2013-11-23 00:40:49 +0100 |
commit | a793ac016db95290470515d89c187365bfcb4f18 (patch) | |
tree | 54143fc0e151b1a16ec11ca7d27480363260844d /source3/smbd/nttrans.c | |
parent | 4e344aba4e66e2e4f59f407f305072bfbb82dc7d (diff) | |
download | samba-a793ac016db95290470515d89c187365bfcb4f18.tar.gz samba-a793ac016db95290470515d89c187365bfcb4f18.tar.xz samba-a793ac016db95290470515d89c187365bfcb4f18.zip |
smbd: Pull mtime handling into open_file_ntcreate
This is a performance improvement for heavily contended files, in
particular in a cluster. The separate call to get_file_infos makes us
pull the locking.tdb record twice per open. For a contended file this
can be a performance penalty, this gets the # of record accesses for
the open/close cycle down from 3 to 2.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Nov 23 00:40:49 CET 2013 on sn-devel-104
Diffstat (limited to 'source3/smbd/nttrans.c')
-rw-r--r-- | source3/smbd/nttrans.c | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 94be9f6d8d0..e901ff27971 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -457,7 +457,6 @@ void reply_ntcreate_and_X(struct smb_request *req) struct timespec c_timespec; struct timespec a_timespec; struct timespec m_timespec; - struct timespec write_time_ts; NTSTATUS status; int oplock_request; uint8_t oplock_granted = NO_OPLOCK_RETURN; @@ -657,14 +656,6 @@ void reply_ntcreate_and_X(struct smb_request *req) fattr = FILE_ATTRIBUTE_NORMAL; } - /* Deal with other possible opens having a modified - write time. JRA. */ - ZERO_STRUCT(write_time_ts); - get_file_infos(fsp->file_id, 0, NULL, &write_time_ts); - if (!null_timespec(write_time_ts)) { - update_stat_ex_mtime(&smb_fname->st, write_time_ts); - } - /* Create time. */ create_timespec = get_create_timespec(conn, fsp, smb_fname); a_timespec = smb_fname->st.st_ex_atime; @@ -1001,7 +992,6 @@ static void call_nt_transact_create(connection_struct *conn, struct timespec c_timespec; struct timespec a_timespec; struct timespec m_timespec; - struct timespec write_time_ts; struct ea_list *ea_list = NULL; NTSTATUS status; size_t param_len; @@ -1270,14 +1260,6 @@ static void call_nt_transact_create(connection_struct *conn, fattr = FILE_ATTRIBUTE_NORMAL; } - /* Deal with other possible opens having a modified - write time. JRA. */ - ZERO_STRUCT(write_time_ts); - get_file_infos(fsp->file_id, 0, NULL, &write_time_ts); - if (!null_timespec(write_time_ts)) { - update_stat_ex_mtime(&smb_fname->st, write_time_ts); - } - /* Create time. */ create_timespec = get_create_timespec(conn, fsp, smb_fname); a_timespec = smb_fname->st.st_ex_atime; |