linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Btrfs-progs: save us an unnecessary ioctl call
@ 2014-05-13  9:05 Wang Shilong
  2014-05-13  9:05 ` [PATCH] Btrfs: set right total device count for seeding support Wang Shilong
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Wang Shilong @ 2014-05-13  9:05 UTC (permalink / raw)
  To: linux-btrfs

Btrfs device id start from 1, not 0.

Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
---
 utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils.c b/utils.c
index 560c557..d480353 100644
--- a/utils.c
+++ b/utils.c
@@ -1765,7 +1765,7 @@ int get_fs_info(char *path, struct btrfs_ioctl_fs_info_args *fi_args,
 		goto out;
 	}
 
-	for (; i <= fi_args->max_id; ++i) {
+	for (i = 1; i <= fi_args->max_id; ++i) {
 		BUG_ON(ndevs >= fi_args->num_devices);
 		ret = get_device_info(fd, i, &di_args[ndevs]);
 		if (ret == -ENODEV)
-- 
1.8.2.1


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

end of thread, other threads:[~2014-05-16 15:03 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-13  9:05 [PATCH] Btrfs-progs: save us an unnecessary ioctl call Wang Shilong
2014-05-13  9:05 ` [PATCH] Btrfs: set right total device count for seeding support Wang Shilong
2014-05-16 14:14   ` Anand Jain
2014-05-16 14:44     ` Anand Jain
2014-05-16 14:50       ` Shilong Wang
2014-05-16 15:06         ` Anand Jain
2014-05-16 14:45     ` Shilong Wang
2014-05-13 10:48 ` [PATCH] Btrfs-progs: save us an unnecessary ioctl call Stefan Behrens
2014-05-13 11:26   ` Wang Shilong
2014-05-14  5:32 ` Anand Jain
2014-05-15 17:06 ` David Sterba
2014-05-16  4:32   ` Anand Jain
2014-05-16  4:58     ` Wang Shilong
2014-05-16 12:14       ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).