1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 11:55:55 +03:00
Commit Graph

11 Commits

Author SHA1 Message Date
Zdenek Kabelac
c595b20e56 dev-swap: use SECTOR_SHIFT 2014-03-22 20:43:05 +01:00
Zdenek Kabelac
936bfeb8de dev-swap: detect swap signature on devices smaller then 2MB
Smallest supported size for swap device is 40KB, however current
test skipped devices smaller then 4096 sectors (2MB).

Since page is in bytes, convert it to sectors before comparing
with device size (in sectors).
2014-03-22 20:36:14 +01:00
Peter Rajnoha
03c941a4ca device: cleanup signature wiping functions
The wipe_known_signatures fn now wraps the _wipe_signature fn that is called
for each known signature (currently md, swap and luks). This patch makes the
code more readable, not repeating the same sequence when used anywhere in the
code. We're going to reuse this code later...
2013-11-27 12:56:58 +01:00
Alasdair G Kergon
527db4645f gcc: replace #ifdef linux with __linux__ 2013-11-13 13:56:29 +00:00
Zdenek Kabelac
17a3ddf89e cleanup: drop unused headers
Drop heades which do not provide any used symbols.
2013-06-16 00:07:32 +02:00
Peter Rajnoha
c6f48b7c1a refactor: make device type recognition code common for general use
Changes:

- move device type registration out of "type filter" (filter.c)
to a separate and new dev-type.[ch] for common use throughout the code

- the structure for keeping the major numbers detected for available
device types and available partitioning available is stored in
"dev_types" structure now

- move common partitioning detection code to dev-type.[ch] as well
together with other device-related functions bound to dev_types
(see dev-type.h for the interface)

The dev-type interface contains all common functions used to detect
subsystems/device types, signature/superblock recognition code,
type-specific device properties and other common device properties
(bound to dev_types), including partitioning support.

- add dev_types instance to cmd context as cmd->dev_types for common use

- use cmd->dev_types throughout as a central point for providing
information about device types
2013-06-12 12:08:56 +02:00
Zdenek Kabelac
286cd2006b cleanup: drop unneeded included header files
This headers were not resolving anything used for compiled .c files.
Remove unused util.c file.
2012-08-23 14:37:20 +02:00
Peter Rajnoha
c08c564e21 Use new dev_open_readonly fn to prevent opening devices for read-write when not necessary.
Before, we used vg_write_lock_held call to determnine the way a device is
opened. Unfortunately, this opened many devices in RW mode when it was not
really necessary. With the OPTIONS+="watch" rule used in the udev rules,
this could fire numerous events while closing such devices (and it caused
useless scans from within udev rules in return).

A common bug we hit with this was with the lvremove command which was unable
to remove the LV since it was being opened from within the udev rules. This
patch should minimize such situations (at least with respect to LVM handling
of devices).

Though there's still a possibility someone will open a device 'outside' in
parallel and fire the event based on the watch rule when closing a device
once opened for RW.
2011-05-28 09:48:14 +00:00
Zdenek Kabelac
a1eba521e3 Fix some unmatching sign comparation gcc warnings
Simple replacement for unsigned type - usually in for() loops.
2011-04-08 14:40:18 +00:00
Milan Broz
c37a14506a Fix file descriptor leak in swap signature detection 2010-08-19 23:05:45 +00:00
Petr Rockai
1b2e147cc8 Missed file from previous checkin. 2009-03-17 14:40:00 +00:00