All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Btrfs: optimize check for stale device
@ 2015-10-05  8:57 Anand Jain
  2015-10-07  8:59 ` Anand Jain
  2015-10-07  9:01 ` David Sterba
  0 siblings, 2 replies; 4+ messages in thread
From: Anand Jain @ 2015-10-05  8:57 UTC (permalink / raw)
  To: linux-btrfs

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>
---
 fs/btrfs/volumes.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index b8b1171..ec1fcfa 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -620,7 +620,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;
 
-- 
2.4.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-10-07  9:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-05  8:57 [PATCH] Btrfs: optimize check for stale device Anand Jain
2015-10-07  8:59 ` Anand Jain
2015-10-07  9:08   ` David Sterba
2015-10-07  9:01 ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.