All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: xuw2015@gmail.com, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs-progs: fix btrfs quota rescan failed on PPC64 arch
Date: Mon, 20 Apr 2015 09:47:58 -0500	[thread overview]
Message-ID: <5535119E.3050005@redhat.com> (raw)
In-Reply-To: <1429507996-28224-1-git-send-email-xuw2015@gmail.com>

On 4/20/15 12:33 AM, xuw2015@gmail.com wrote:
> From: George Wang <xuw2015@gmail.com>
> 
> PPC64 arch use such following IOC values "
> \#define _IOC_NONE       1U
> \#define _IOC_READ       2U
> \#define _IOC_WRITE      4U
> " comparing to the default IOC values "
> \#define _IOC_NONE       0U
> \#define _IOC_READ       2U
> \#define _IOC_WRITE      1U"
> 
> This means the value "_IOW*" will be negative when we store it in the int
> variables. Such as the "BTRFS_IOC_QGROUP_CREATE", it will be "0x4010942e" on
> X86_64, but "0x8010942e" on PPC64.
> Notice that the IOC values are the "unsigned long" type, so we use the
> "unsigned long" to store it, and this can insure the comparison between the
> variable and BTRFS_IOC_* valid.

Looks good - very strange that the manpage states that the interface takes
an int.  :(  

But - an "unsigned int" would be enough, right?  I don't think it needs
to be an unsigned long.  *shrug*

Thanks,
-Eric

> Signed-off-by: George Wang <xuw2015@gmail.com>
> ---
>  cmds-quota.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/cmds-quota.c b/cmds-quota.c
> index 89cc89c..f6a1cfa 100644
> --- a/cmds-quota.c
> +++ b/cmds-quota.c
> @@ -109,7 +109,7 @@ static int cmd_quota_rescan(int argc, char **argv)
>  	int e;
>  	char *path = NULL;
>  	struct btrfs_ioctl_quota_rescan_args args;
> -	int ioctlnum = BTRFS_IOC_QUOTA_RESCAN;
> +	unsigned long ioctlnum = BTRFS_IOC_QUOTA_RESCAN;
>  	DIR *dirstream = NULL;
>  	int wait_for_completion = 0;
>  
> 


  reply	other threads:[~2015-04-20 14:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-20  5:33 [PATCH] btrfs-progs: fix btrfs quota rescan failed on PPC64 arch xuw2015
2015-04-20 14:47 ` Eric Sandeen [this message]
2015-04-21  2:26   ` 王旭
2015-04-22 16:04     ` David Sterba
2015-04-23 17:13 ` Chandan Rajendra
2015-04-24 13:42   ` David Sterba

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=5535119E.3050005@redhat.com \
    --to=sandeen@redhat.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=xuw2015@gmail.com \
    /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.