mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
Add and use dev_open_readonly and variations.
This commit is contained in:
parent
ba7d33be9c
commit
0b70507434
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.86 -
|
Version 2.02.86 -
|
||||||
=================================
|
=================================
|
||||||
|
Add and use dev_open_readonly and variations.
|
||||||
Do not log a superfluous stack message when the lv is properly processed.
|
Do not log a superfluous stack message when the lv is properly processed.
|
||||||
Do not issue an error message when unable to remove .cache on read-only fs.
|
Do not issue an error message when unable to remove .cache on read-only fs.
|
||||||
Avoid memlock size mismatch by preallocating stdio line buffers.
|
Avoid memlock size mismatch by preallocating stdio line buffers.
|
||||||
|
@ -295,7 +295,7 @@ int read_config_file(struct config_tree *cft)
|
|||||||
if (!(c->dev = dev_create_file(c->filename, NULL, NULL, 1)))
|
if (!(c->dev = dev_create_file(c->filename, NULL, NULL, 1)))
|
||||||
return_0;
|
return_0;
|
||||||
|
|
||||||
if (!dev_open_flags(c->dev, O_RDONLY, 0, 0)) {
|
if (!dev_open_readonly_buffered(c->dev)) {
|
||||||
c->dev = 0;
|
c->dev = 0;
|
||||||
return_0;
|
return_0;
|
||||||
}
|
}
|
||||||
|
@ -556,6 +556,21 @@ int dev_open(struct device *dev)
|
|||||||
return dev_open_flags(dev, flags, 1, 0);
|
return dev_open_flags(dev, flags, 1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int dev_open_readonly(struct device *dev)
|
||||||
|
{
|
||||||
|
return dev_open_flags(dev, O_RDONLY, 1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int dev_open_readonly_buffered(struct device *dev)
|
||||||
|
{
|
||||||
|
return dev_open_flags(dev, O_RDONLY, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int dev_open_readonly_quiet(struct device *dev)
|
||||||
|
{
|
||||||
|
return dev_open_flags(dev, O_RDONLY, 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
int dev_test_excl(struct device *dev)
|
int dev_test_excl(struct device *dev)
|
||||||
{
|
{
|
||||||
int flags;
|
int flags;
|
||||||
|
@ -74,6 +74,9 @@ int dev_discard_blocks(struct device *dev, uint64_t offset_bytes, uint64_t size_
|
|||||||
int dev_open(struct device *dev);
|
int dev_open(struct device *dev);
|
||||||
int dev_open_quiet(struct device *dev);
|
int dev_open_quiet(struct device *dev);
|
||||||
int dev_open_flags(struct device *dev, int flags, int direct, int quiet);
|
int dev_open_flags(struct device *dev, int flags, int direct, int quiet);
|
||||||
|
int dev_open_readonly(struct device *dev);
|
||||||
|
int dev_open_readonly_buffered(struct device *dev);
|
||||||
|
int dev_open_readonly_quiet(struct device *dev);
|
||||||
int dev_close(struct device *dev);
|
int dev_close(struct device *dev);
|
||||||
int dev_close_immediate(struct device *dev);
|
int dev_close_immediate(struct device *dev);
|
||||||
void dev_close_all(void);
|
void dev_close_all(void);
|
||||||
|
@ -147,7 +147,7 @@ static int _passes_lvm_type_device_filter(struct dev_filter *f __attribute__((un
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check it's accessible */
|
/* Check it's accessible */
|
||||||
if (!dev_open_flags(dev, O_RDONLY, 1, 1)) {
|
if (!dev_open_readonly_quiet(dev)) {
|
||||||
log_debug("%s: Skipping: open failed", name);
|
log_debug("%s: Skipping: open failed", name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user