[PATCH] extend sparse file support

David Disseldorp ddiss at suse.de
Wed Feb 25 17:40:09 MST 2015


This patch-set adds support for the SMB2 FSCTL_QUERY_ALLOCATED_RANGES and
FSCTL_SET_ZERO_DATA ioctls.

FSCTL_SET_ZERO_DATA offers a mechanism for clients to request that the
server zero a range within a file. On a sparse file this range can be
deallocated by the underlying filesystem. This ioctl is implemented in
Samba using falloc() with the FALLOC_FL_PUNCH_HOLE flag.

Clients can discover allocated and sparse file ranges using the
FSCTL_QUERY_ALLOCATED_RANGES ioctl. This ioctl is implemented in Samba
using the SEEK_DATA / SEEK_HOLE lseek() whence values.

Feedback appreciated.

Cheers, David

--

https://git.samba.org/?p=ddiss/samba.git;a=shortlog;h=refs/heads/viel_sparse

The following changes since commit 1b39c688cc2c7f57147e45faedc4509d0da2f2b4:

  vfs: Add a brief vfs_ceph manpage. (2015-02-25 20:56:01 +0100)

are available in the git repository at:

  git://git.samba.org/ddiss/samba.git viel_sparse

for you to fetch changes up to e30af89237719f771de8bd664d8b267004fb2cd8:

  torture/ioctl: add multi-range QAR test (2015-02-26 01:19:06 +0100)

----------------------------------------------------------------
David Disseldorp (19):
      lib/system: remove useless HAVE_LINUX_FALLOCATE64 logic
      s3/vfs: change fallocate mode flags from enum->uint32_t
      build: check for fallocate hole-punch support
      system: add hole punch support to sys_fallocate()
      smbd/ioctl: add FSCTL_SET_ZERO_DATA support
      idl/ioctl: change QAR response array to a DATA_BLOB
      build: check for SEEK_HOLE and SEEK_DATA support
      smbd/ioctl: add FSCTL_QUERY_ALLOCATED_RANGES support
      s3/statvfs: expose FILE_SUPPORTS_SPARSE_FILES capability
      torture/ioctl: remove 64K chunk size assumptions
      torture/ioctl: remove FS specific sparse punch check
      torture/ioctl: remove FS specific sparse copy-chunk expectations
      torture/ioctl: add sparse_punch_invalid test
      torture/ioctl: rework and reduce pattern helper IO sizes
      torture/ioctl: add ioctl_sparse_perms test
      s3/smbd: fix FSCTL_SET_SPARSE permission checks
      torture/ioctl: test sparse file operation locking
      torture/ioctl: add QAR off-by-one bug paranoia test
      torture/ioctl: add multi-range QAR test

 examples/VFS/skel_opaque.c          |   2 +-
 examples/VFS/skel_transparent.c     |   2 +-
 librpc/idl/ioctl.idl                |   6 +-
 source3/include/proto.h             |   2 +-
 source3/include/vfs.h               |  17 +-
 source3/lib/system.c                |  36 +-
 source3/modules/vfs_ceph.c          |   3 +-
 source3/modules/vfs_default.c       |  13 +-
 source3/modules/vfs_fruit.c         |   2 +-
 source3/modules/vfs_full_audit.c    |   2 +-
 source3/modules/vfs_glusterfs.c     |   3 +-
 source3/modules/vfs_gpfs.c          |   7 +-
 source3/modules/vfs_streams_xattr.c |   2 +-
 source3/modules/vfs_time_audit.c    |   2 +-
 source3/smbd/dosmode.c              |   9 +-
 source3/smbd/smb2_ioctl_filesys.c   | 302 +++++++++-
 source3/smbd/statvfs.c              |   9 +
 source3/smbd/vfs.c                  |  14 +-
 source3/wscript                     |  13 +
 source4/torture/smb2/ioctl.c        | 880 ++++++++++++++++++++++++++--
 20 files changed, 1211 insertions(+), 115 deletions(-)


More information about the samba-technical mailing list