All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: Anand Jain <anand.jain@oracle.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs-progs: traverse to backup super-block only when indicated
Date: Fri, 01 Mar 2013 11:37:09 -0600	[thread overview]
Message-ID: <5130E745.9010306@redhat.com> (raw)
In-Reply-To: <1362132800-29563-1-git-send-email-anand.jain@oracle.com>

On 3/1/13 4:13 AM, Anand Jain wrote:
> This patch adds 4th parameter to btrfs_scan_one_device()
> which when set to non-zero value will traverse to check
> backup super-block.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
> ---
>  btrfs-show.c      |  2 +-
>  btrfsctl.c        |  2 +-
>  cmds-device.c     |  4 ++--
>  cmds-filesystem.c |  4 ++--
>  cmds-replace.c    |  2 +-
>  disk-io.c         | 11 +++++++----
>  disk-io.h         |  3 ++-
>  find-root.c       |  6 +++---
>  utils.c           | 19 ++++++++++---------
>  utils.h           |  6 +++---
>  volumes.c         |  4 ++--
>  volumes.h         |  2 +-
>  12 files changed, 35 insertions(+), 30 deletions(-)
> 
> diff --git a/btrfs-show.c b/btrfs-show.c
> index 8210fd2..7b1a35f 100644
> --- a/btrfs-show.c
> +++ b/btrfs-show.c
> @@ -138,7 +138,7 @@ int main(int ac, char **av)
>  		search = av[optind];
>  	}
>  
> -	ret = btrfs_scan_one_dir("/dev", 0);
> +	ret = btrfs_scan_one_dir("/dev", 0, 1);

It might be helpful to define some self-documenting macros
for the 0/1 boolean args, which otherwise are pretty nonobvious.

i.e. BTRFS_SCAN_ALL_SB / BTRFS_SCAN_PRIMARY_SB or something
similar, also for the "run_ioctls" arg - maybe BTRFS_SCAN_REGISTER etc?

btrfs_scan_one_dir("/dev/", BTRFS_SCAN_REGISTER, BTRFS_SCAN_PRIMARY_SB)

is clearer than:

btrfs_scan_one_dir("/dev/", 1, 0);

Or maybe a flags var:

flags = BTRFS_SCAN_REGISTER | BTRFS_SCAN_PRIMARY_SB;
btrfs_scan_one_dir("/dev/", flags)

Or, depending on how things get called, maybe self-named wrappers:

btrfs_scan_one_dir_primary("/dev");

I think anything is better than a string of 0's & 1's :)

-Eric


  reply	other threads:[~2013-03-01 17:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-22  5:29 [bug] mkfs.btrfs reports device busy for ext4 mounted disk Anand Jain
2013-02-22 19:03 ` Zach Brown
2013-02-22 22:30   ` David Sterba
2013-03-01 10:18     ` Anand Jain
2013-03-01 10:13 ` [PATCH] btrfs-progs: traverse to backup super-block only when indicated Anand Jain
2013-03-01 17:37   ` Eric Sandeen [this message]
2013-03-04  5:20     ` Anand Jain
2013-03-01 18:27   ` Zach Brown
2013-03-27 10:07   ` [PATCH 0/5 v5] access to backup-sb and btrfs' multipath aware Anand Jain
2013-03-27 10:07     ` [PATCH 1/5 v5] btrfs-progs: make btrfs dev scan multi path aware Anand Jain
2013-04-11  9:57       ` [obsoleted] " Anand Jain
2013-03-27 10:07     ` [PATCH 2/5 v5] btrfs-progs: Introduce flag BTRFS_SCAN_REGISTER to replace run_ioctl Anand Jain
2013-03-27 10:07     ` [PATCH 3/5 v5] btrfs-progs: Introduce flag BTRFS_SCAN_BACKUP_SB for btrfs_read_dev_super Anand Jain
2013-03-27 10:07     ` [PATCH 4/5 v5] btrfs-progs: introduce passing flags to btrfs_scan_one_device Anand Jain
2013-03-27 10:07     ` [PATCH 5/5 v5] btrfs-progs: disable using backup superblock by default Anand Jain
2013-03-27 23:17     ` [PATCH 0/5 v5] access to backup-sb and btrfs' multipath aware anand jain
2013-04-05  5:54 ` v6: access to backup superblock Anand Jain
2013-04-05  5:54   ` [PATCH 1/5] btrfs-progs: Introduce flag BTRFS_SCAN_REGISTER to replace run_ioctl Anand Jain
2013-04-05  5:54   ` [PATCH 2/5] btrfs-progs: Introduce flag BTRFS_SCAN_BACKUP_SB for btrfs_read_dev_super Anand Jain
2013-04-05  5:54   ` [PATCH 3/5] btrfs-progs: introduce passing flags to btrfs_scan_one_device Anand Jain
2013-04-05  5:54   ` [PATCH 4/5] btrfs-progs: disable using backup superblock by default Anand Jain
2013-04-05  5:54   ` [PATCH 5/5] btrfs-progs: btrfs-find-root should scan backup-sb Anand Jain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5130E745.9010306@redhat.com \
    --to=sandeen@redhat.com \
    --cc=anand.jain@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.