提交 02feae3c 编写于 作者: A Anand Jain 提交者: David Sterba

btrfs: optimize check for stale device

Optimize check for stale device to only be checked when there is device
added or changed. If there is no update to the device, there is no need
to call btrfs_free_stale_device().
Signed-off-by: NAnand Jain <anand.jain@oracle.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 6b526ed7
......@@ -699,7 +699,8 @@ static noinline int device_list_add(const char *path,
* if there is new btrfs on an already registered device,
* then remove the stale device entry.
*/
btrfs_free_stale_device(device);
if (ret > 0)
btrfs_free_stale_device(device);
*fs_devices_ret = fs_devices;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册