diff mbox

[2/5] Btrfs: don't return btrfs_fs_devices if the caller doesn't want it

Message ID 1409751393-5403-3-git-send-email-miaox@cn.fujitsu.com (mailing list archive)
State Rejected
Headers show

Commit Message

Miao Xie Sept. 3, 2014, 1:36 p.m. UTC
We will implement the function that the filesystem scan all the devices
in the system and build the device set for btrfs. In this case, we needn't
get btrfs_fs_devices when adding a device into list. This patch changes
device_add_list and implement this feature.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
---
 fs/btrfs/volumes.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 1aacf5f..740a4f9 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -568,7 +568,8 @@  static noinline int device_list_add(const char *path,
 	if (!fs_devices->opened)
 		device->generation = found_transid;
 
-	*fs_devices_ret = fs_devices;
+	if (fs_devices_ret)
+		*fs_devices_ret = fs_devices;
 
 	return ret;
 }