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 1/9] btrfs-progs: btrfs_scan_for_fsid doesn't need all the arguments
Date: Mon, 10 Jun 2013 15:00:16 -0500	[thread overview]
Message-ID: <51B63050.9080808@redhat.com> (raw)
In-Reply-To: <1370876190-16520-2-git-send-email-anand.jain@oracle.com>

On 6/10/13 9:56 AM, Anand Jain wrote:
> btrfs_scan_for_fsid uses only one argument run_ioctl out of 3
> so remove the rest two of them

and run_ioctl is only ever '1' (and it's completely unobvious
at the call point what '1' means).

Why not just go with 0 args?

Then only btrfs_scan_one_dir and btrfs_scan_block_devices
will have a non-obvious 0/1 arg.... :(

-Eric


> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
> ---
>  btrfs-find-root.c | 2 +-
>  disk-io.c         | 2 +-
>  utils.c           | 5 ++---
>  utils.h           | 3 +--
>  4 files changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/btrfs-find-root.c b/btrfs-find-root.c
> index 810d835..e736cb5 100644
> --- a/btrfs-find-root.c
> +++ b/btrfs-find-root.c
> @@ -110,7 +110,7 @@ static struct btrfs_root *open_ctree_broken(int fd, const char *device)
>  	}
>  
>  	if (total_devs != 1) {
> -		ret = btrfs_scan_for_fsid(fs_devices, total_devs, 1);
> +		ret = btrfs_scan_for_fsid(1);
>  		if (ret)
>  			goto out;
>  	}
> diff --git a/disk-io.c b/disk-io.c
> index 9ffe6e4..acd5480 100644
> --- a/disk-io.c
> +++ b/disk-io.c
> @@ -838,7 +838,7 @@ static struct btrfs_fs_info *__open_ctree_fd(int fp, const char *path,
>  	}
>  
>  	if (total_devs != 1) {
> -		ret = btrfs_scan_for_fsid(fs_devices, total_devs, 1);
> +		ret = btrfs_scan_for_fsid(1);
>  		if (ret)
>  			goto out;
>  	}
> diff --git a/utils.c b/utils.c
> index 7b4cd74..25f3cb4 100644
> --- a/utils.c
> +++ b/utils.c
> @@ -928,7 +928,7 @@ int check_mounted_where(int fd, const char *file, char *where, int size,
>  
>  	/* scan other devices */
>  	if (is_btrfs && total_devs > 1) {
> -		if((ret = btrfs_scan_for_fsid(fs_devices_mnt, total_devs, 1)))
> +		if((ret = btrfs_scan_for_fsid(1)))
>  			return ret;
>  	}
>  
> @@ -1110,8 +1110,7 @@ fail:
>  	return ret;
>  }
>  
> -int btrfs_scan_for_fsid(struct btrfs_fs_devices *fs_devices, u64 total_devs,
> -			int run_ioctls)
> +int btrfs_scan_for_fsid(int run_ioctls)
>  {
>  	int ret;
>  
> diff --git a/utils.h b/utils.h
> index 3c17e14..dba37e8 100644
> --- a/utils.h
> +++ b/utils.h
> @@ -35,8 +35,7 @@ int btrfs_add_to_fsid(struct btrfs_trans_handle *trans,
>  		      struct btrfs_root *root, int fd, char *path,
>  		      u64 block_count, u32 io_width, u32 io_align,
>  		      u32 sectorsize);
> -int btrfs_scan_for_fsid(struct btrfs_fs_devices *fs_devices, u64 total_devs,
> -			int run_ioctls);
> +int btrfs_scan_for_fsid(int run_ioctls);
>  void btrfs_register_one_device(char *fname);
>  int btrfs_scan_one_dir(char *dirname, int run_ioctl);
>  int check_mounted(const char *devicename);
> 


  reply	other threads:[~2013-06-10 20:00 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-10 14:56 [PATCH 0/9] btrfs-progs: coalesce of patches Anand Jain
2013-06-10 14:56 ` [PATCH 1/9] btrfs-progs: btrfs_scan_for_fsid doesn't need all the arguments Anand Jain
2013-06-10 20:00   ` Eric Sandeen [this message]
2013-06-11 13:15     ` anand jain
2013-06-10 14:56 ` [PATCH 2/9 v2] btrfs-progs: label option in btrfs filesystem show is not coded Anand Jain
2013-06-10 14:56 ` [PATCH 3/9 v2] btrfs-progs: update device scan usage Anand Jain
2013-06-10 14:56 ` [PATCH 4/9 v3] btrfs-progs: congregate dev scan Anand Jain
2013-06-10 14:56 ` [PATCH 5/9 v2] btrfs-progs: btrfs_scan_one_dir not to skip links when /dev/mapper is provided Anand Jain
2013-06-10 14:56 ` [PATCH 6/9 v2] btrfs-progs: scan /dev/mapper in filesystem show and device scan Anand Jain
2013-06-10 14:56 ` [PATCH 7/9 v3] btrfs-progs: device delete to get errors from the kernel Anand Jain
2013-06-10 14:56 ` [PATCH 8/9] btrfs-progs: get_label_mounted to return label instead of print Anand Jain
2013-06-21  7:41   ` [PATCH 08/13 v2] " Anand Jain
2013-06-10 14:56 ` [PATCH 9/9 v2] btrfs-progs: introduce btrfs filesystem show --kernel Anand Jain
2013-06-10 14:59 ` [PATCH 0/2] btrfs: coalesce of patches Anand Jain
2013-06-10 14:59   ` [PATCH 1/2] btrfs: device delete to get errors from the kernel Anand Jain
2013-06-10 14:59   ` [PATCH 2/2 v2] btrfs: add framework to read fs info and dev info " Anand Jain
2013-06-10 19:40     ` Josef Bacik
2013-06-11 13:10       ` anand jain
2013-06-11 13:15         ` Josef Bacik
2013-06-10 20:30     ` Zach Brown
2013-06-11 14:05       ` anand jain
2013-06-11 17:50         ` Zach Brown
2013-06-11 14:24     ` Josef Bacik
2013-06-21  7:02       ` Anand Jain
2013-06-21  7:32     ` [PATCH 2/2 v3] btrfs: obtain used_bytes in BTRFS_IOC_FS_INFO ioctl Anand Jain
2013-06-24 17:03       ` Josef Bacik
2013-06-25  3:00         ` Anand Jain
2013-07-08  7:39 ` [PATCH 13/13] btrfs-progs: fix memory leaks of device_list_add() Anand Jain
2013-07-15  4:58   ` Anand Jain
2013-07-15  5:30 ` [PATCH 00/11 v2 (resend)] btrfs-progs: coalesce of patches Anand Jain
2013-07-15  5:30   ` [PATCH 01/11] btrfs-progs: btrfs_scan_for_fsid doesn't need all the arguments Anand Jain
2013-07-15  5:30   ` [PATCH 02/11] btrfs-progs: label option in btrfs filesystem show is not coded Anand Jain
2013-07-15  5:30   ` [PATCH 03/11] btrfs-progs: update device scan usage Anand Jain
2013-07-15  5:30   ` [PATCH 04/11] btrfs-progs: congregate dev scan Anand Jain
2013-07-15  5:30   ` [PATCH 05/11] btrfs-progs: btrfs_scan_one_dir not to skip links when /dev/mapper is provided Anand Jain
2013-08-05 16:53     ` David Sterba
2013-07-15  5:30   ` [PATCH 06/11] btrfs-progs: scan /dev/mapper in filesystem show and device scan Anand Jain
2013-08-05 17:04     ` David Sterba
2013-08-13  4:07       ` anand jain
2013-07-15  5:30   ` [PATCH 07/11] btrfs-progs: device delete to get errors from the kernel Anand Jain
2013-07-15  5:30   ` [PATCH 08/11] btrfs-progs: get_label_mounted to return label instead of print Anand Jain
2013-07-15  5:30   ` [PATCH 09/11] btrfs-progs: move out print in cmd_df to another function Anand Jain
2013-07-15  5:30   ` [PATCH 10/11] btrfs-progs: get string for the group profile and type Anand Jain
2013-07-15  5:30   ` [PATCH 11/11] btrfs-progs: introduce btrfs filesystem show --kernel Anand Jain
2013-08-05 17:36   ` [PATCH 00/11 v2 (resend)] btrfs-progs: coalesce of patches David Sterba
2013-08-06 15:08     ` anand jain
2013-08-08  8:07 ` [PATCH 0/2 v2] introduce btrfs filesystem show --kernel Anand Jain
2013-08-08  8:07   ` [PATCH 1/2] btrfs-progs: move out print in cmd_df to another function Anand Jain
2013-08-08  8:07   ` [PATCH 2/2] btrfs-progs: introduce btrfs filesystem show --kernel Anand Jain
2013-08-08 18:08     ` Zach Brown
2013-08-09 10:57       ` anand jain
2013-08-09 18:03         ` Zach Brown
2013-08-08  8:09 ` [PATCH 0/2] scan /dev/mapper in filesystem show and device scan Anand Jain
2013-08-08  8:09   ` [PATCH 1/2] btrfs-progs: btrfs_scan_one_dir not to skip links when /dev/mapper is provided Anand Jain
2013-08-08  8:09   ` [PATCH 2/2] btrfs-progs: scan /dev/mapper in filesystem show and device scan Anand Jain
2013-08-08  8:10   ` [PATCH 0/2] " 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=51B63050.9080808@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.