From fb399a13013889c9dc91ba75d4d6ce549500d2f2 Mon Sep 17 00:00:00 2001 From: George Wang Date: Mon, 20 Apr 2015 13:33:16 +0800 Subject: btrfs-progs: fix btrfs quota rescan failed on PPC64 arch 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. Signed-off-by: George Wang Reviewed-by: Eric Sandeen [manpage states that it's int, kernel uses unsigned int, glibc wants unsigned long int] Tested-by: Chandan Rajendra Signed-off-by: David Sterba --- cmds-quota.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmds-quota.c') diff --git a/cmds-quota.c b/cmds-quota.c index 89cc89cc..f6a1cfa7 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; -- cgit v1.2.3