diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2011-12-21 13:24:24 +0000 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2011-12-21 13:24:24 +0000 |
commit | 5339307ca7ab1ef8fe4946040030209b17f01008 (patch) | |
tree | 9557c78df887a1e7890f8bb8aca78a3791deb60e | |
parent | 538d5e81a7679a773a3f95cfd5b191fe314ba627 (diff) | |
download | lvm2-5339307ca7ab1ef8fe4946040030209b17f01008.tar.gz lvm2-5339307ca7ab1ef8fe4946040030209b17f01008.tar.xz lvm2-5339307ca7ab1ef8fe4946040030209b17f01008.zip |
Drop extra stat before open of device
Since the !(dev->flags & DEV_REGULAR) code path just called
dev_name_confirmed() which has just called 'stat()' inside,
remove duplicate second stat() call here.
-rw-r--r-- | WHATS_NEW | 1 | ||||
-rw-r--r-- | lib/device/dev-io.c | 11 |
2 files changed, 1 insertions, 11 deletions
@@ -1,5 +1,6 @@ Version 2.02.89 - ================================== + Drop extra stat call before opening device. Reduce number of lstat calls when selecting device alias. Add function to inialize common structure device members. Always zalloc device structure during initialization. diff --git a/lib/device/dev-io.c b/lib/device/dev-io.c index 9b486a98..c6220870 100644 --- a/lib/device/dev-io.c +++ b/lib/device/dev-io.c @@ -449,17 +449,6 @@ int dev_open_flags(struct device *dev, int flags, int direct, int quiet) else if (!(name = dev_name_confirmed(dev, quiet))) return_0; - if (!(dev->flags & DEV_REGULAR)) { - if (stat(name, &buf) < 0) { - log_sys_error("%s: stat failed", name); - return 0; - } - if (buf.st_rdev != dev->dev) { - log_error("%s: device changed", name); - return 0; - } - } - #ifdef O_DIRECT_SUPPORT if (direct) { if (!(dev->flags & DEV_O_DIRECT_TESTED)) |