The Samba-Bugzilla – Attachment 8697 Details for
Bug 9748
Remove unneeded fstat system call from hot read path.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am fix for 4.0.next that went into master.
0001-Optimization-suggested-by-Volker.-Don-t-do-a-stat-sy.patch (text/plain), 2.33 KB, created by
Jeremy Allison
on 2013-03-28 18:16:34 UTC
(
hide
)
Description:
git-am fix for 4.0.next that went into master.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2013-03-28 18:16:34 UTC
Size:
2.33 KB
patch
obsolete
>From 3dbf33a30c05af00178d70bedef20cff760cd59e Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Mon, 25 Mar 2013 09:54:50 -0700 >Subject: [PATCH] Optimization suggested by Volker. Don't do a stat system call > on normal read path. > >Only do it if we need it in the sendfile() path. > >Signed-off-by: Jeremy Allison <jra@samba.org> >Reviewed-by: Volker Lendecke <vl@samba.org> > >Autobuild-User(master): Volker Lendecke <vl@samba.org> >Autobuild-Date(master): Thu Mar 28 17:51:22 CET 2013 on sn-devel-104 >--- > source3/smbd/reply.c | 30 +++++++++++++++--------------- > 1 file changed, 15 insertions(+), 15 deletions(-) > >diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c >index 2326015..d7b3199 100644 >--- a/source3/smbd/reply.c >+++ b/source3/smbd/reply.c >@@ -3666,11 +3666,6 @@ static void send_file_readX(connection_struct *conn, struct smb_request *req, > struct lock_struct lock; > int saved_errno = 0; > >- if(fsp_stat(fsp) == -1) { >- reply_nterror(req, map_nt_error_from_unix(errno)); >- return; >- } >- > init_strict_lock_struct(fsp, (uint64_t)req->smbpid, > (uint64_t)startpos, (uint64_t)smb_maxcnt, READ_LOCK, > &lock); >@@ -3680,16 +3675,6 @@ static void send_file_readX(connection_struct *conn, struct smb_request *req, > return; > } > >- if (!S_ISREG(fsp->fsp_name->st.st_ex_mode) || >- (startpos > fsp->fsp_name->st.st_ex_size) >- || (smb_maxcnt > (fsp->fsp_name->st.st_ex_size - startpos))) { >- /* >- * We already know that we would do a short read, so don't >- * try the sendfile() path. >- */ >- goto nosendfile_read; >- } >- > /* > * We can only use sendfile on a non-chained packet > * but we can use on a non-oplocked file. tridge proved this >@@ -3704,6 +3689,21 @@ static void send_file_readX(connection_struct *conn, struct smb_request *req, > uint8 headerbuf[smb_size + 12 * 2]; > DATA_BLOB header; > >+ if(fsp_stat(fsp) == -1) { >+ reply_nterror(req, map_nt_error_from_unix(errno)); >+ goto strict_unlock; >+ } >+ >+ if (!S_ISREG(fsp->fsp_name->st.st_ex_mode) || >+ (startpos > fsp->fsp_name->st.st_ex_size) || >+ (smb_maxcnt > (fsp->fsp_name->st.st_ex_size - startpos))) { >+ /* >+ * We already know that we would do a short read, so don't >+ * try the sendfile() path. >+ */ >+ goto nosendfile_read; >+ } >+ > /* > * Set up the packet header before send. We > * assume here the sendfile will work (get the >-- >1.8.1.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 9748
: 8697 |
8698