[PATCH 0/4 v5] Add btrfs ioctl support

jeffm at suse.com jeffm at suse.com
Wed May 18 22:09:38 UTC 2016


From: Jeff Mahoney <jeffm at suse.com>

Hi all -

This patch adds support for the btrfs ioctls and some generic file ioctls.

Thanks, Dmitry, for the review.

Changes since v4:
- Added test cases, including verbose and writeable cases
- Added support for FS_IOC_FIEMAP, since it was required to
  test BTRFS_IOC_LOGICAL_INO
- Fixed bugs made apparent by test cases
- Style changes as requested
- Rebased now that xlookup64 is xlookup

Changes since v3:
- Rebased on top of xval update
- Minor cleanups.

Changes since v2:
- Use print_quoted_string to print strings from the user
- Many corrections of output text
- Load elements in user-sized arrays individually to avoid arbitrary
  user-specified memory allocations
- Don't print arrays with user defined lengths in abbrev mode
- Only print max_strlen elements in arrays in verbose mode
- Added new ioctls added in the Linux 4.6 cycle
- Added file_ioctl.c to contain generic file ioctls
  - BTRFS_IOC_CLONE -> FICLONE
  - BTRFS_IOC_CLONE_RANGE -> FICLONERANGE
  - BTRFS_IOC_FILE_EXTENT_SAME -> FIDEDUPERANGE
- Proper printing of flags when none are set
- Broke out complex printing into separate routines
- Use "UINT64_MAX" instead of "-1" to print -1ULL for objectids

Changes since v1:
- Change addflags, printflags, and sprintflags to use unsigned int vals.
- Introduce 64-bit variants for all three.
- Convert all three to wrappers around the 64-bit versions
- Use pointers to uint64_ts instead of casting ints for bsearch
- Use SIZEOF_LONG instead of BITS_PER_LONG
- Fix missing comma for ioctls that return a signed int value
- Don't test for exiting(tcp) if we've already returned a nonzero value
  in entering mode
- Use stdint types when defining structs
- Don't define separate macros for testing structs
- Add UUID_STRING_SIZE macro
- Don't test for error if umove* will be called immediately afterward
- Various style fixes
- Don't assume btrfs.h will be available

Thanks,

-Jeff




More information about the Strace-devel mailing list