Commit Graph

9 Commits

Author SHA1 Message Date
Jean-Pierre André
4163390f2b Fixed defining the request argument of ioctl()
An occurrence of changing the request from int to unsigned long was
missing.
2020-03-08 10:34:17 +01:00
Jean-Pierre André
b68c27ea74 Silenced warnings about string lengths in snprintf()
Adjust string lengths to the worst case estimated by the compiler, even
though they cannot be reached.
2020-03-08 09:29:04 +01:00
Jean-Pierre André
b9ad82ced7 Truncated SSD trimming zones to granularity supported by the device
When the trimming granularity is greater than the cluster size, the
free zones have to be truncated to match the granularity.
2019-01-23 17:43:47 +01:00
Jean-Pierre André
043b0e6e73 Allowed using full library API on systems without extended attributes support
A number of functions in libntfs-3g are generally useful, but are tied to
extended attributes support and are not included when the library is
built on platforms without extended attributes support.

This proposal updates libntfs-3g to always include these functions.

The only tricky part is dealing with the XATTR_CREATE and XATTR_REPLACE
flags.  These flags are defined in <sys/xattr.h>, so they must be
redefined on platforms without extended attributes support.

Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
2016-07-28 16:13:59 +02:00
Jean-Pierre André
cf6f265069 Switch to using the standard autoconf AC_HEADER_MAJOR macro
Switch to the standard autoconf AC_HEADER_MAJOR macro which takes care
of the ugly details like when to use mkdev.h and when to use sysmacros.h.
(requires <sys/types.h> to be included)
Also include these in all files that use major/minor/makedev funcs.

(Contributed by Mike Frysinger)
2016-05-31 08:33:10 +02:00
Jean-Pierre André
4d5ce43ab9 Fixed returning the trimming count to fstrim(8)
When used with the option -v, fstrim(8) reported the maximum trimming count
because the correct value was not returned to the ioctl call.
2015-12-01 11:00:24 +01:00
Jean-Pierre André
bbeebd5a15 Rephrased the warning for trimming not supported (cosmetic)
The initial text looked like an error message
2015-04-17 09:06:22 +02:00
Jean-Pierre André
c26a519da1 Fixed fstrim(8) applied to partitions
The new way goes via /sys/dev/block/MAJOR:MINOR to map partitions to
devices and get discard parameters of the parent device. It also ensures
that the partition is aligned to the discard block size.

Contributed by Richard W.M. Jones
2014-08-04 17:39:50 +02:00
Jean-Pierre André
f4e3f126df Implemented fstrim(8)
fstrim(8) discards unused blocks on a mounted filesystem. It is useful for
solid-state drives (SSDs) and thinly-provisioned storage.
Only trimming the full device (with no option) is supported.

Contributed by Richard W.M. Jones
2014-07-31 14:03:11 +02:00