mirror of
git://sourceware.org/git/lvm2.git
synced 2025-04-18 02:51:49 +03:00
dev_cache: remove the lvmcache check when closing fd
This is no longer used since devices are not held open in dev_cache.
This commit is contained in:
parent
3e3cb22f2a
commit
73578e36fa
9
lib/cache/lvmcache.c
vendored
9
lib/cache/lvmcache.c
vendored
@ -2456,15 +2456,6 @@ void lvmcache_destroy(struct cmd_context *cmd, int retain_orphans, int reset)
|
||||
}
|
||||
}
|
||||
|
||||
int lvmcache_pvid_is_locked(const char *pvid) {
|
||||
struct lvmcache_info *info;
|
||||
info = lvmcache_info_from_pvid(pvid, NULL, 0);
|
||||
if (!info || !info->vginfo)
|
||||
return 0;
|
||||
|
||||
return lvmcache_vgname_is_locked(info->vginfo->vgname);
|
||||
}
|
||||
|
||||
int lvmcache_fid_add_mdas(struct lvmcache_info *info, struct format_instance *fid,
|
||||
const char *id, int id_len)
|
||||
{
|
||||
|
1
lib/cache/lvmcache.h
vendored
1
lib/cache/lvmcache.h
vendored
@ -132,7 +132,6 @@ struct dm_list *lvmcache_get_pvids(struct cmd_context *cmd, const char *vgname,
|
||||
void lvmcache_drop_metadata(const char *vgname, int drop_precommitted);
|
||||
void lvmcache_commit_metadata(const char *vgname);
|
||||
|
||||
int lvmcache_pvid_is_locked(const char *pvid);
|
||||
int lvmcache_fid_add_mdas(struct lvmcache_info *info, struct format_instance *fid,
|
||||
const char *id, int id_len);
|
||||
int lvmcache_fid_add_mdas_pv(struct lvmcache_info *info, struct format_instance *fid);
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include "lib.h"
|
||||
#include "device.h"
|
||||
#include "metadata.h"
|
||||
#include "lvmcache.h"
|
||||
#include "memlock.h"
|
||||
#include "locking.h"
|
||||
|
||||
@ -674,9 +673,7 @@ static int _dev_close(struct device *dev, int immediate)
|
||||
log_debug_devs("%s: Immediate close attempt while still referenced",
|
||||
dev_name(dev));
|
||||
|
||||
/* Close unless device is known to belong to a locked VG */
|
||||
if (immediate ||
|
||||
(dev->open_count < 1 && !lvmcache_pvid_is_locked(dev->pvid)))
|
||||
if (immediate || (dev->open_count < 1))
|
||||
_close(dev);
|
||||
|
||||
return 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user