wall(1) from sysvinit supports
# wall I love this company!
semantic, This patch add this functionally to the util-linux wall.
Signed-off-by: Karel Zak <kzak@redhat.com>
Now we use LOOP_CTL_GET_FREE ioctl to ask for free device, for example
losetup -f foo.img
Unfortunately, losetup(8) allows to ask for specified device
losetup /dev/loop100 foo.img
and in this case we assume that the device already exists in the
system. This is incorrect, we should be able to use loop-control
LOOP_CTL_ADD ioctl to ask for the specified device.
Signed-off-by: Karel Zak <kzak@redhat.com>
Calling function "open(char const *, int, ...)" that uses "path" after
a check function. This can cause a time-of-check, time-of-use race
condition.
.. well, in blkdiscard context it's mostly cosmetic change.
Signed-off-by: Karel Zak <kzak@redhat.com>
The code is not paranoid enough, loopcxt_set_device() only set the
device name to loopdev struct, but it does not check if the device
really exists.
Signed-off-by: Karel Zak <kzak@redhat.com>
It's usually unnecessary as we compare devno and ino, but let's
use absolute paths for situations when it's necessary to compare
paths as strings.
Signed-off-by: Karel Zak <kzak@redhat.com>
It's usually unnecessary as we compare devno and ino, but let's
use absolute paths for situations when it's necessary to compare
paths as strings.
Signed-off-by: Karel Zak <kzak@redhat.com>
# mount foo.img /mnt
# umount foo.img
umount: foo.img: not mounted
The loopdev code (and sysfs backing_file) uses absolute paths, but
libmount does not canonicalize the path before lookup for the backing file.
References: https://bugzilla.redhat.com/show_bug.cgi?id=950497
Signed-off-by: Karel Zak <kzak@redhat.com>
Especially with large inputs the change improves performance
considerably.
old> time more /boot/vmlinuz >/dev/null
real 0m0.224s
new> more /boot/vmlinuz >/dev/null
real 0m0.009s
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Fliping a string in memory, and printing it with multibyte output
function makes the command about 1/3 quicker.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
It seems to be pointless to spend time in ./configure phase when
preprocessor has to perform #ifndef check anyway.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This change proposed in util-linux maillist by Damien Wyart in behalf of
Daniel Kahn Gillmor. Sami Kerola changed the patch to use option rather
than makign the default behavior of the command to change.
Reported-by: Damien Wyart <damien.wyart@gmail.com>
Reference: http://markmail.org/message/2z6qh5auk7wjie3l
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=495881
CC: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Use of for loop and printing a string character by character is slower
than to print whole string with single function.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>