The Samba-Bugzilla – Attachment 5359 Details for
Bug 6942
Avoid fragmentation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Patch relative to v3-4-test
0001-handle-strict-allocation-with-async-i-o-too-Fall-ba.patch (text/plain), 1.96 KB, created by
Olaf Flebbe
on 2010-02-17 02:30:27 UTC
(
hide
)
Description:
Patch relative to v3-4-test
Filename:
MIME Type:
Creator:
Olaf Flebbe
Created:
2010-02-17 02:30:27 UTC
Size:
1.96 KB
patch
obsolete
>From bbe55d953e8db49a56779ad24b428d03ffa8ce83 Mon Sep 17 00:00:00 2001 >From: Olaf Flebbe <o.flebbe@science-computing.de> >Date: Tue, 16 Feb 2010 14:00:18 +0100 >Subject: [PATCH] handle strict allocation with async i/o too: Fall back to synchronous. > >--- > source3/smbd/aio.c | 30 +++++++++++++++++++++++++++++- > 1 files changed, 29 insertions(+), 1 deletions(-) > >diff --git a/source3/smbd/aio.c b/source3/smbd/aio.c >index 406ec1b..bacaf7c 100644 >--- a/source3/smbd/aio.c >+++ b/source3/smbd/aio.c >@@ -211,8 +211,10 @@ bool schedule_aio_write_and_X(connection_struct *conn, > { > struct aio_extra *aio_ex; > SMB_STRUCT_AIOCB *a; >+ SMB_STRUCT_STAT st; > size_t bufsize; > bool write_through = BITSETW(req->vwv+7,0); >+ bool other_aio_found; > size_t min_aio_write_size = lp_aio_write_size(SNUM(conn)); > int ret; > >@@ -233,7 +235,7 @@ bool schedule_aio_write_and_X(connection_struct *conn, > } > > /* Only do this on non-chained and non-chaining reads not using the >- * write cache. */ >+ write cache. */ > if (req_is_in_chain(req) || (lp_write_cache_size(SNUM(conn)) != 0)) { > return False; > } >@@ -251,6 +253,32 @@ bool schedule_aio_write_and_X(connection_struct *conn, > return False; > } > >+ other_aio_found = false; >+ /* Make sure there are no outstanding aio writes on same fsp */ >+ for( aio_ex = aio_list_head; aio_ex; aio_ex = aio_ex->next) { >+ if (fsp == aio_ex->fsp) { >+ /* Don't do preallocate detection if other */ >+ /* aio statements are outstanding */ >+ /* this should not happen! */ >+ other_aio_found = true; >+ break; >+ } >+ } >+ >+ if (!other_aio_found) { >+ ret = SMB_VFS_FSTAT(fsp, &st); >+ if (ret == -1) { >+ /* This should not happen, fall back to synchronous */ >+ return False; >+ } >+ >+ if (startpos > st.st_size) { >+ /* let a synchronous write handle allocating */ >+ if (lp_strict_allocate(SNUM(fsp->conn))) >+ return False; >+ } >+ } >+ > bufsize = smb_size + 6*2; > > if (!(aio_ex = create_aio_extra(fsp, bufsize))) { >-- >1.6.0.2 >
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 6942
:
5027
|
5028
|
5032
|
5033
|
5065
|
5066
|
5312
|
5313
|
5314
|
5315
|
5317
| 5359 |
5360