Commit Graph

3285 Commits

Author SHA1 Message Date
Sami Kerola 02ad010012 taskset: coding style fixes
Reindentation and deletion of few empty lines etc. There is no
actual code changes in this patch.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-21 17:30:24 +02:00
Sami Kerola 6f45c0e9ff taskset: include-what-you-use header check
taskset.c should add these lines:
 #include <sched.h>   for sched_getaffinity, etc
 #include <stddef.h>  for size_t
 #include <string.h>  for memset

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-21 17:29:38 +02:00
Sami Kerola 4033fbe3e6 docs: mention long options in ionice.1
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-21 17:28:32 +02:00
Sami Kerola a5e9b75fac ionice: coding style fixes
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-21 17:09:28 +02:00
Sami Kerola abd57eb3e3 ionice: fix -V output
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-21 17:04:36 +02:00
Karel Zak 7ab08ba3e5 ionice: fix -p
$ ionice 123
 none: prio 4
 none: prio 4

It calls ioprio_get(0x1, 0) and ioprio_get(0x1, 123), because the
code does not check it the "-p" options was specified.

The proper command line syntax is:

  $ ionice -p 123

and the ioprio_get() should be called only once.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-21 17:02:52 +02:00
Karel Zak 560cdabbfa ionice: IOPRIO_PRIO_* macros
* make the code more robust
 * follow kernel conventions for variable names
   (data = classdata, ioprio = classdata | class)

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-21 16:33:20 +02:00
Sami Kerola 976b7580e0 ionice: add long options
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-21 16:03:35 +02:00
Sami Kerola 110d680af8 chrt: coding style fix
Make horizontal list vertical and few other enhancements to
readability.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-21 15:53:44 +02:00
Sami Kerola 90b7d261b9 chrt: data type compiler warning fixed
chrt.c:158:16: warning: comparison of integers of different
	signs: 'int' and 'unsigned long' [-Wsign-compare]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-21 15:52:25 +02:00
Karel Zak 06c0375ce3 fsck.minix: fix "array subscript is above array bounds"
fsck.minix.c: In function ‘map_block2’:
fsck.minix.c:486:9: warning: array subscript is above array bounds [-Warray-bounds]

The 'blknr' has to be bigger than 7 + 256 + (256 * 256) for i_zone[9].

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-21 13:00:40 +02:00
Karel Zak 0dca7bd54a minix: remove unnecessary initializations
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-21 12:41:25 +02:00
Karel Zak c1d26b1981 minix: add MINIX_ prefix to some global macros
... and remove some tailing whitespaces.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-21 12:23:01 +02:00
Karel Zak 058cda4c1d minix: cleanup global variables and macros
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-21 12:13:33 +02:00
Karel Zak e844147d17 Merge branch 'minix' of https://github.com/kerolasa/lelux-utiliteetit
* 'minix' of https://github.com/kerolasa/lelux-utiliteetit:
  libblkid: move MINIX_MAXPARTITIONS to minix.h
  minix: move globals and inline functions to minix_programs.h
  libblkid: use MINIX_BLOCK_SIZE from minix.h
  libblkid: use superblock structure from minix.h
  include: move minix.h to include directory
  include: remove kernel headers from minix.h
  include: minix.h: use data types from stdint.h

Conflicts:
	disk-utils/Makefile.am

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-21 11:26:42 +02:00
Karel Zak b5962110d2 libmount: fix mtab update for "none" source
tab_parse.c:mnt_parse_mountinfo_line parses "none" in src as NULL,

tab_update.c:fprintf_mtab_fs sets m1 to NULL instead of "none" and
returns -ENOMEM
tab_update.c:update_table says "write entry failed: Success", as errno
hasn't been set, and gotos to leave, leaving mtab not updated.

Addresses-debian-bug: 634871
Reported-by: Tomas Janousek <tomi@nomi.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-20 21:24:20 +02:00
Karel Zak 5af0769de6 libmount: cleanup code for "none" source and fstype, fix mem leak
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-20 21:15:43 +02:00
Sami Kerola e9ab36a73a libblkid: move MINIX_MAXPARTITIONS to minix.h
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-20 20:43:40 +02:00
Sami Kerola 7cc112d927 minix: move globals and inline functions to minix_programs.h
Global variables and inline functions are moved from minix.h to
minix_programs.h which is included in mkfs.minix and fsck.minix.
The minix.h will have only struct definitions etc generic
contents which is reasonable to share with utilities and
libraries.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-20 20:43:16 +02:00
Sami Kerola 63883af765 libblkid: use MINIX_BLOCK_SIZE from minix.h
In the minix.h two definitions where renamed, so that the single
definition is reusable in fsck.minix, mkfs.minix and libblkid.

BLOCK_SIZE_BITS -> MINIX_BLOCK_SIZE_BITS
BLOCK_SIZE      -> MINIX_BLOCK_SIZE

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-20 20:13:08 +02:00
Sami Kerola a38887352a libblkid: use superblock structure from minix.h
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-20 19:58:51 +02:00
Sami Kerola 532055e2e6 include: move minix.h to include directory
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-20 19:58:51 +02:00
Sami Kerola d997b7ef5e include: remove kernel headers from minix.h
This clean up is purely cosmetic. Perprocessor could never use
the includes as KERNEL_INCLUDES_ARE_CLEAN variable does not get
set anywhere.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-20 19:58:51 +02:00
Sami Kerola 2788d8417b include: minix.h: use data types from stdint.h
The kernel types (e.g. u32, s64) are unexpected in util-linux.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-20 19:58:49 +02:00
Karel Zak 608d45015f dmesg: allow to print time delta without timestamp
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-20 17:03:24 +02:00
Karel Zak 641986cf92 dmesg: mark some options mutually exclusive
Reported-by: "Voelker, Bernhard" <bernhard.voelker@siemens-enterprise.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-20 15:50:34 +02:00
Karel Zak 42fac79a21 dmesg: add --ctime to print human readable timestamps
Based on patch from "corentin.labbe" <corentin.labbe@geomatys.fr>.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-20 14:26:45 +02:00
Karel Zak bd304d92ff dmesg: add --show-delta option
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-20 12:52:15 +02:00
Karel Zak a7ee94f220 dmesg: print_buffer() refactoring
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-19 21:37:34 +02:00
Karel Zak aca1633a3e dmesg: variables refactoring
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-19 20:00:54 +02:00
Karel Zak 7ef8c5bc9e docs: update TODO
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-19 00:30:42 +02:00
Marc-Antoine Perennou 730d5e7761 dmesg: fix segfault
An element declared as size_t cannot be detected as negative (len < 0)
is always false.
This can lead to an infinite loop causing a segmentation fault.
Check if len is equal to -1 or -2 instead

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2011-07-18 23:46:45 +02:00
Karel Zak 7148256802 mkfs.bfs: cleanu p --version output
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-18 17:15:00 +02:00
Karel Zak e5794f549d mkfs.bfs: use err() instead of errx()
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-18 17:08:45 +02:00
Karel Zak 853ffe21a5 Merge remote-tracking branch 'sami/mkfs.bfs'
* sami/mkfs.bfs:
  docs: add long options to mkfs.bfs.8
  mkfs.bfs: coding style fix
  mkfs.bfs: include-what-you-use header check
  mkfs.bfs: validate numeric user inputs
  mkfs.bfs: use xstrdup from xalloc.h
  mkfs.bfs: add long options
  mkfs.bfs: use libc error facilities
2011-07-18 17:00:52 +02:00
Karel Zak 3160fcf326 fdformat: cleanup error messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-18 16:57:55 +02:00
Karel Zak 117d15a936 Merge remote-tracking branch 'sami/fdformat'
* sami/fdformat:
  docs: add long options to fdformat.8
  fdformat: coding style
  fdformat: include-what-you-use header check
  fdformat: use xalloc.h
  fdformat: integer comparisons & unused parameter
  fdformat: use long options
  fdformat: use libc error printing facilities
2011-07-18 16:48:22 +02:00
Karel Zak e55beb56b1 Merge remote-tracking branch 'sami/isosize'
* sami/isosize:
  docs: isosize.8 add long options
  isosize: fix coding style
  isosize: include-what-you-use header check
  isosize: check user input to be numeric
  isosize: use long options
  isosize: remove global variables
2011-07-18 16:43:51 +02:00
Karel Zak d74b8dfc70 dmesg: add -t option to suppress timestamps
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-18 11:48:41 +02:00
Karel Zak 2500018011 dmesg: add -u and -k options
-u  : print kernel messages
 -k  : print userspace message

The options could be mixed together or with --facility option too.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-18 11:28:15 +02:00
Heiko Carstens 56baaa4e1f lscpu: add support for books
This patch adds support for books in cpu topology output. Books are
currently only present on the s390 architecture, however it looks like
others will follow to use the extra scheduling domain of the kernel.

Books are logically between sockets and nodes. In order to not break
any existing tools that might parse the output of lscpu the output
is changed so that books will follow nodes:
CPU,Core,Socket,Node,Book

In addition the readable output is changed from
"CPU socket(s):" to "Socket(s) per book:" or simply "Socket(s):" in the
absence of books.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-07-18 10:46:35 +02:00
Milan Broz 64c9e22aa4 lsblk: add queue request size attribute
Add queue request size parameter.

Very useful for tuning multipath performance.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-15 15:41:22 +02:00
Karel Zak 24563aea02 include: [tt.c] always truncate if TT_FL_TRUNC
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-15 15:35:48 +02:00
Milan Broz 01e487c020 lsblk: add state attribute
Add device state column. For normal disk it could be running or offline,
for device-mapper devices running or suspended.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-15 15:35:10 +02:00
Karel Zak 872a1575e8 dmesg: fix typo in usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-14 13:46:13 +02:00
Karel Zak b7271b68ec docs: update TODO file
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-14 13:32:31 +02:00
Karel Zak 5ef053699b dmesg: reorder options, add comments
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-14 13:31:53 +02:00
Karel Zak 0e24df3b10 dmesg: add --facility option
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-14 12:48:07 +02:00
Karel Zak 85f3cc55f7 dmesg: add --decode to print readable facility and level
# dmesg --decode
 ...
 kern  :info  : [53335.743185] PM: resume of devices complete after 2496.795 msecs
 kern  :debug : [53335.743593] PM: Finishing wakeup.
 kern  :warn  : [53335.743595] Restarting tasks ... done.
 kern  :info  : [53335.790452] video LNXVIDEO:00: Restoring backlight state
 kern  :debug : [53336.418576] e1000e 0000:00:19.0: irq 45 for MSI/MSI-X

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-14 12:30:18 +02:00
Davidlohr Bueso 3ca43386bd minix: remove fs state
For v3 minix superblocks the state flag (s_state) has been removed, so drop it
from the structure in accordance with the kernel's representation.

Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2011-07-14 11:15:55 +02:00