1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib/device
Peter Rajnoha 65d0089c64 dev-type: dev_get_primary_dev fn: use dev_types and provide better return codes
The dev_get_primary_dev fn now returns:

  0 if the dev is already a primary dev
  1 if the dev is a partition, primary dev is returned in "result" (output arg)
  -1 on error

This way, we can better differentiate between the error state
and the state in which the dev supplied is not a partition
in the caller (this was same return value before).

Also, if we already have information about the device type,
we can check its major number against the list of known device
types (cmd->dev_types) directly, so we don't need to go through
the sysfs - we only check the major:minor pair which is a bit
more straightforward and faster. If the dev_types does not have
any info about this device type, the code just fallbacks to
the original sysfs interface to get the partition info.
2013-06-12 12:14:11 +02:00
..
dev-cache.c refactor: make device type recognition code common for general use 2013-06-12 12:08:56 +02:00
dev-cache.h filters: dump filter returns error code 2013-06-03 08:42:25 +02:00
dev-io.c cleanup: test for -1 value for lseek error 2013-05-30 17:26:42 +02:00
dev-luks.c refactor: make device type recognition code common for general use 2013-06-12 12:08:56 +02:00
dev-md.c dev-type: dev_get_primary_dev fn: use dev_types and provide better return codes 2013-06-12 12:14:11 +02:00
dev-swap.c refactor: make device type recognition code common for general use 2013-06-12 12:08:56 +02:00
dev-type.c dev-type: dev_get_primary_dev fn: use dev_types and provide better return codes 2013-06-12 12:14:11 +02:00
dev-type.h refactor: make device type recognition code common for general use 2013-06-12 12:08:56 +02:00
device-types.h refactor: make device type recognition code common for general use 2013-06-12 12:08:56 +02:00
device.h refactor: make device type recognition code common for general use 2013-06-12 12:08:56 +02:00