diff options
author | Stefan Metzmacher <metze@samba.org> | 2008-04-01 11:40:23 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2008-04-07 12:29:29 +0200 |
commit | 851cadba51b00b326c5f040f23f95932aec53105 (patch) | |
tree | 9f89c0c7616a455e81064cb23cdcb9f35392162b /source3/smbd/trans2.c | |
parent | 406da3a9628f7e631ad17ec3c37c841359d0ccbf (diff) | |
download | samba-851cadba51b00b326c5f040f23f95932aec53105.tar.gz samba-851cadba51b00b326c5f040f23f95932aec53105.tar.bz2 samba-851cadba51b00b326c5f040f23f95932aec53105.zip |
locking: combine get_delete_on_close_flag() and get_write_time() into get_file_infos()
This means we need to fetch the record only once.
metze
(This used to be commit 4130b873291d39e363184fe4e38dc1f24ebe5056)
Diffstat (limited to 'source3/smbd/trans2.c')
-rw-r--r-- | source3/smbd/trans2.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 06bb31622f..9e56434d5c 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -1398,8 +1398,8 @@ static bool get_lanman2_dir_entry(TALLOC_CTX *ctx, adate_ts = get_atimespec(&sbuf); create_date_ts = get_create_timespec(&sbuf,lp_fake_dir_create_times(SNUM(conn))); - write_time_ts = get_write_time( - vfs_file_id_from_sbuf(conn, &sbuf)); + get_file_infos(vfs_file_id_from_sbuf(conn, &sbuf), + NULL, &write_time_ts); if (!null_timespec(write_time_ts)) { mdate_ts = write_time_ts; } @@ -3870,8 +3870,7 @@ static void call_trans2qfilepathinfo(connection_struct *conn, } fileid = vfs_file_id_from_sbuf(conn, &sbuf); - delete_pending = get_delete_on_close_flag(fileid); - write_time_ts = get_write_time(fileid); + get_file_infos(fileid, &delete_pending, &write_time_ts); } else { /* * Original code - this is an open file. @@ -3887,8 +3886,7 @@ static void call_trans2qfilepathinfo(connection_struct *conn, } pos = fsp->fh->position_information; fileid = vfs_file_id_from_sbuf(conn, &sbuf); - delete_pending = get_delete_on_close_flag(fileid); - write_time_ts = get_write_time(fileid); + get_file_infos(fileid, &delete_pending, &write_time_ts); access_mask = fsp->access_mask; } @@ -3959,12 +3957,11 @@ static void call_trans2qfilepathinfo(connection_struct *conn, } fileid = vfs_file_id_from_sbuf(conn, &sbuf); - delete_pending = get_delete_on_close_flag(fileid); + get_file_infos(fileid, &delete_pending, &write_time_ts); if (delete_pending) { reply_nterror(req, NT_STATUS_DELETE_PENDING); return; } - write_time_ts = get_write_time(fileid); } if (INFO_LEVEL_IS_UNIX(info_level) && !lp_unix_extensions()) { |