The Samba-Bugzilla – Attachment 13982 Details for
Bug 13303
vfs_glusterfs: Add fallocate support for vfs_glusterfs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for 4.8 cherry-picked from master
bug13303-v48.patch (text/plain), 2.83 KB, created by
Ralph Böhme
on 2018-02-27 09:38:01 UTC
(
hide
)
Description:
Patch for 4.8 cherry-picked from master
Filename:
MIME Type:
Creator:
Ralph Böhme
Created:
2018-02-27 09:38:01 UTC
Size:
2.83 KB
patch
obsolete
>From 3bea4a2f111f84a453372f7124afa3ebe8d0834b Mon Sep 17 00:00:00 2001 >From: Sachin Prabhu <sprabhu@redhat.com> >Date: Tue, 14 Nov 2017 15:51:44 +0530 >Subject: [PATCH] vfs_glusterfs: Add fallocate support for vfs_glusterfs > >Adds fallocate support to the vfs glusterfs plugin. > >v2: Add check for glusterfs-api version. >RHBZ: 1478875 > >Bug: https://bugzilla.samba.org/show_bug.cgi?id=13303 > >Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> >Reviewed-by: David Disseldorp <ddiss@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> > >Autobuild-User(master): Jeremy Allison <jra@samba.org> >Autobuild-Date(master): Wed Jan 17 06:09:29 CET 2018 on sn-devel-144 > >(cherry picked from commit 0edce86e97a49f4bd79f4431015ac2b788105e46) >--- > source3/modules/vfs_glusterfs.c | 28 +++++++++++++++++++++++++++- > source3/wscript | 4 ++++ > 2 files changed, 31 insertions(+), 1 deletion(-) > >diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c >index 953c46af4cd..f9a96fa004d 100644 >--- a/source3/modules/vfs_glusterfs.c >+++ b/source3/modules/vfs_glusterfs.c >@@ -464,6 +464,10 @@ static uint32_t vfs_gluster_fs_capabilities(struct vfs_handle_struct *handle, > { > uint32_t caps = FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES; > >+#ifdef HAVE_GFAPI_VER_6 >+ caps |= FILE_SUPPORTS_SPARSE_FILES; >+#endif >+ > #ifdef STAT_HAVE_NSEC > *p_ts_res = TIMESTAMP_SET_NT_OR_BETTER; > #endif >@@ -1148,9 +1152,31 @@ static int vfs_gluster_fallocate(struct vfs_handle_struct *handle, > uint32_t mode, > off_t offset, off_t len) > { >- /* TODO: add support using glfs_fallocate() and glfs_zerofill() */ >+#ifdef HAVE_GFAPI_VER_6 >+ int keep_size, punch_hole; >+ >+ keep_size = mode & VFS_FALLOCATE_FL_KEEP_SIZE; >+ punch_hole = mode & VFS_FALLOCATE_FL_PUNCH_HOLE; >+ >+ mode &= ~(VFS_FALLOCATE_FL_KEEP_SIZE|VFS_FALLOCATE_FL_PUNCH_HOLE); >+ if (mode != 0) { >+ errno = ENOTSUP; >+ return -1; >+ } >+ >+ if (punch_hole) { >+ return glfs_discard(*(glfs_fd_t **) >+ VFS_FETCH_FSP_EXTENSION(handle, fsp), >+ offset, len); >+ } >+ >+ return glfs_fallocate(*(glfs_fd_t **) >+ VFS_FETCH_FSP_EXTENSION(handle, fsp), >+ keep_size, offset, len); >+#else > errno = ENOTSUP; > return -1; >+#endif > } > > static struct smb_filename *vfs_gluster_realpath(struct vfs_handle_struct *handle, >diff --git a/source3/wscript b/source3/wscript >index 253505c82ee..6d2d94bae87 100644 >--- a/source3/wscript >+++ b/source3/wscript >@@ -1575,6 +1575,10 @@ main() { > conf.undefine('HAVE_GLUSTERFS') > else: > conf.undefine('HAVE_GLUSTERFS') >+ >+ conf.CHECK_CFG(package='glusterfs-api', args='"glusterfs-api >= 6" --cflags --libs', >+ msg='Checking for glusterfs-api >= 6', >+ uselib_store="GFAPI_VER_6") > else: > conf.SET_TARGET_TYPE('gfapi', 'EMPTY') > conf.undefine('HAVE_GLUSTERFS') >-- >2.13.6 >
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
Flags:
asn
:
review+
Actions:
View
Attachments on
bug 13303
: 13982