mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 02:19:51 +00:00
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: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
6b526ed70c
commit
02feae3c55
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue