The Samba-Bugzilla – Attachment 5314 Details for
Bug 6942
Avoid fragmentation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
cherrypick for 3-4-test 3
0003-s3-allocate-only-new-space-not-old-sparse-spac.patch (text/x-patch), 1.75 KB, created by
Olaf Flebbe
on 2010-02-10 04:19:32 UTC
(
hide
)
Description:
cherrypick for 3-4-test 3
Filename:
MIME Type:
Creator:
Olaf Flebbe
Created:
2010-02-10 04:19:32 UTC
Size:
1.75 KB
patch
obsolete
>From 6a6f16d1c60149e661d23a77d6de040fe622f19e Mon Sep 17 00:00:00 2001 >From: =?utf-8?q?Bj=C3=B6rn=20Jacke?= <bj@sernet.de> >Date: Tue, 8 Dec 2009 10:30:03 +0100 >Subject: [PATCH] s3: allocate only "new" space, not "old" sparse space in the posix_fallocate path > >this makes the posix_fallocate path work analogous to the manual allocate path. > >cherry-picked from commit e9fb2807037919a598e17d24def4897e0cbfe19c >--- > source3/modules/vfs_default.c | 5 +++-- > 1 files changed, 3 insertions(+), 2 deletions(-) > >diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c >index 4c14e08..39f027d 100644 >--- a/source3/modules/vfs_default.c >+++ b/source3/modules/vfs_default.c >@@ -837,6 +837,8 @@ static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fs > if (st.st_size > len) > return sys_ftruncate(fsp->fh->fd, len); > >+ space_to_write = len - st.st_size; >+ > /* for allocation try posix_fallocate first. This can fail on some > platforms e.g. when the filesystem doesn't support it and no > emulation is being done by the libc (like on AIX with JFS1). In that >@@ -844,7 +846,7 @@ static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fs > return ENOTSUP or EINVAL in cases like that. */ > #if defined(HAVE_POSIX_FALLOCATE) > { >- int ret = sys_posix_fallocate(fsp->fh->fd, 0, len); >+ int ret = sys_posix_fallocate(fsp->fh->fd, st.st_size, space_to_write); > if (ret == ENOSPC) { > errno = ENOSPC; > return -1; >@@ -858,7 +860,6 @@ static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fs > } > #endif > /* available disk space is enough or not? */ >- space_to_write = len - st.st_size; > if (lp_strict_allocate(SNUM(fsp->conn))){ > uint64_t space_avail; > uint64_t bsize,dfree,dsize; >-- >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