fallocate: use SEEK_DATA on already sparse files

It's more efficient to skip already known holes by SEEK_DATA (seek to
the next area with data).

Thanks to Pádraig Brady.

Signed-off-by: Karel Zak <kzak@redhat.com>
fallocate: use POSIX_FADV_DONTNEED to discard cached data

The patch discard cached data in 1MiB (or bigger) steps.

Thanks to Pádraig Brady.

Signed-off-by: Karel Zak <kzak@redhat.com>
fallocate: code optimalizations

Based on Pádraig Brady review:

 * use is_nul() from coreutils rather then memcmp()

 * always call skip_hole() (SEEK_DATA)

 * fix possible overflows

Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid: add extra checks to XFS prober

The current code rely on XFS magic string only. It seems too fragile.

Signed-off-by: Karel Zak <kzak@redhat.com>
fallocate: fix missing sentinel for is_nul()

Signed-off-by: Karel Zak <kzak@redhat.com>
libmount: FS id and parent ID could be zero

It seems that linux 3.14 is able to produce things like:

  19 0 8:3 / / rw,relatime - ext4 /dev/sda3 rw,data=ordered
     ^

Reported-by: Mantas Mikulėnas <grawity@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
more: improve formatting and wording of man page and help text

Also, slice up the usage text for ease of translation.

Reported-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
mkfs: mark this wrapper as DEPRECATED

Theodore Ts'o:

 I'll add that I've never been convinced that the mkfs front end is all
 that useful.  It's probably better for people to explicitly run
 /sbin/mkfs.xfs, /sbin/mkfs.ext4, etc.., so you don't have to worry
 about which options get passed down to the file system specific mkfs
 program, and which ones are interpreted by /sbin/mkfs --- and I don't
 believe /sbin/mkfs adds enough (err, any?) value that using
 "/sbin/mkfs -t xxx" vs "/sbin/mkfs.xxx" makes any sense whatsoever.

... and I absolutely agree.

Reported-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Karel Zak <kzak@redhat.com>
findmnt: add --bytes to print sizes in bytes

Signed-off-by: Karel Zak <kzak@redhat.com>
script: Also flush writes to timing file.

If both -f and -t are given, flush the timing fd on each write, similar
to the behavior on the script fd. This allows playback of still-running
sessions, and reduces the risk of ending up with empty timing files when
script(1) exits abnormally.

Signed-off-by: Jesper Dahl Nyerup <nyerup@one.com>
script: clean up files usage

 * don't initialize timingfd (to stderr) when -t not specified

 * care about timingfd dooutput() rather in main()

 * make timingdf gloval like fscript FILE

 * close all in done()

 * close irrelevant things in subshell and input processes

Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
more: fix double free crash

Commit b9579f1f44b46c9f12f1e01b01c02d82ae1cf728 moved fclose() to
checkf(), but missed removing file closure in magic().  Ironically the
cause of regression is in previous commit message.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>