From: Volker Lendecke Date: Fri, 26 Jul 2019 14:20:17 +0000 (+0200) Subject: smbd: Slightly optimize reply_open_and_X() X-Git-Tag: tdb-1.4.2~290 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e94ebc705542ffca536d15e28fc99e023f4748bc;p=thirdparty%2Fsamba.git smbd: Slightly optimize reply_open_and_X() Well, this is just a drive-by patch: We don't use "mtime" if we exit early. So it's not really a worthwhile optimization, to me it's more a code clarity thing. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index d01b39a5538..946acb130d5 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -2525,12 +2525,12 @@ void reply_open_and_X(struct smb_request *req) } fattr = dos_mode(conn, fsp->fsp_name); - mtime = convert_timespec_to_time_t(fsp->fsp_name->st.st_ex_mtime); if (fattr & FILE_ATTRIBUTE_DIRECTORY) { close_file(req, fsp, ERROR_CLOSE); reply_nterror(req, NT_STATUS_ACCESS_DENIED); goto out; } + mtime = convert_timespec_to_time_t(fsp->fsp_name->st.st_ex_mtime); /* If the caller set the extended oplock request bit and we granted one (by whatever means) - set the