Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1581617 > unrolled thread

[PATCH] uapi: fix linux/btrfs.h userspace compilation error

Started by"Dmitry V. Levin" <ldv@altlinux.org>
First post2017-02-15 21:10 +0100
Last post2017-03-02 20:50 +0100
Articles 11 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] uapi: fix linux/btrfs.h userspace compilation error "Dmitry V. Levin" <ldv@altlinux.org> - 2017-02-15 21:10 +0100
    Re: [PATCH] uapi: fix linux/btrfs.h userspace compilation error Joe Perches <joe@perches.com> - 2017-02-15 21:40 +0100
    Re: [PATCH] uapi: fix linux/btrfs.h userspace compilation error Jeff Mahoney <jeffm@suse.com> - 2017-02-15 22:30 +0100
      [PATCH v2] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h "Dmitry V. Levin" <ldv@altlinux.org> - 2017-02-16 00:00 +0100
        Re: [PATCH v2] btrfs: remove btrfs_err_str function from  uapi/linux/btrfs.h David Sterba <dsterba@suse.cz> - 2017-02-16 15:20 +0100
        [PATCH v3] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h "Dmitry V. Levin" <ldv@altlinux.org> - 2017-03-01 00:20 +0100
          Re: [PATCH v3] btrfs: remove btrfs_err_str function from  uapi/linux/btrfs.h David Sterba <dsterba@suse.cz> - 2017-03-01 16:50 +0100
            Re: [PATCH v3] btrfs: remove btrfs_err_str function from  uapi/linux/btrfs.h David Sterba <dsterba@suse.cz> - 2017-03-02 14:40 +0100
              Re: [PATCH v3] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h "Dmitry V. Levin" <ldv@altlinux.org> - 2017-03-02 15:00 +0100
                Re: [PATCH v3] btrfs: remove btrfs_err_str function from  uapi/linux/btrfs.h David Sterba <dsterba@suse.cz> - 2017-03-02 20:10 +0100
                  [PATCH] MAINTAINERS: add btrfs file entries "Dmitry V. Levin" <ldv@altlinux.org> - 2017-03-02 20:50 +0100

#1581617 — [PATCH] uapi: fix linux/btrfs.h userspace compilation error

From"Dmitry V. Levin" <ldv@altlinux.org>
Date2017-02-15 21:10 +0100
Subject[PATCH] uapi: fix linux/btrfs.h userspace compilation error
Message-ID<tbe3L-4vL-5@gated-at.bofh.it>
Stop using NULL to fix the following linux/btrfs.h userspace compilation
error:

/usr/include/linux/btrfs.h: In function 'btrfs_err_str':
/usr/include/linux/btrfs.h:740:11: error: 'NULL' undeclared (first use in this function)
    return NULL;

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---
 include/uapi/linux/btrfs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
index db4c253..01c612f 100644
--- a/include/uapi/linux/btrfs.h
+++ b/include/uapi/linux/btrfs.h
@@ -737,7 +737,7 @@ static inline char *btrfs_err_str(enum btrfs_err_code err_code)
 			return "add/delete/balance/replace/resize operation "\
 				"in progress";
 		default:
-			return NULL;
+			return 0;
 	}
 }
 
-- 
ldv

[toc] | [next] | [standalone]


#1581646

FromJoe Perches <joe@perches.com>
Date2017-02-15 21:40 +0100
Message-ID<tbewO-4G5-21@gated-at.bofh.it>
In reply to#1581617
On Wed, 2017-02-15 at 23:02 +0300, Dmitry V. Levin wrote:
> Stop using NULL to fix the following linux/btrfs.h userspace compilation
> error:
> 
> /usr/include/linux/btrfs.h: In function 'btrfs_err_str':
> /usr/include/linux/btrfs.h:740:11: error: 'NULL' undeclared (first use in this function)
>     return NULL;
> 
> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
> ---
>  include/uapi/linux/btrfs.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
[]
> @@ -737,7 +737,7 @@ static inline char *btrfs_err_str(enum btrfs_err_code err_code)
>  			return "add/delete/balance/replace/resize operation "\
>  				"in progress";
>  		default:
> -			return NULL;
> +			return 0;

Perhaps to avoid some other warnings this might be better

	return (void *)0;

[toc] | [prev] | [next] | [standalone]


#1581680

FromJeff Mahoney <jeffm@suse.com>
Date2017-02-15 22:30 +0100
Message-ID<tbfjc-5cF-13@gated-at.bofh.it>
In reply to#1581617

[Multipart message — attachments visible in raw view] — view raw

On 2/15/17 3:02 PM, Dmitry V. Levin wrote:
> Stop using NULL to fix the following linux/btrfs.h userspace compilation
> error:
> 
> /usr/include/linux/btrfs.h: In function 'btrfs_err_str':
> /usr/include/linux/btrfs.h:740:11: error: 'NULL' undeclared (first use in this function)
>     return NULL;
> 
> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
> ---
>  include/uapi/linux/btrfs.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
> index db4c253..01c612f 100644
> --- a/include/uapi/linux/btrfs.h
> +++ b/include/uapi/linux/btrfs.h
> @@ -737,7 +737,7 @@ static inline char *btrfs_err_str(enum btrfs_err_code err_code)
>  			return "add/delete/balance/replace/resize operation "\
>  				"in progress";
>  		default:
> -			return NULL;
> +			return 0;
>  	}
>  }
>  
> 

Hi Dmitry -

Just remove the whole routine.  It's not called from anywhere and is
replicated in the userspace headers for btrfsprogs.

-Jeff

-- 
Jeff Mahoney
SUSE Labs

[toc] | [prev] | [next] | [standalone]


#1581748 — [PATCH v2] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h

From"Dmitry V. Levin" <ldv@altlinux.org>
Date2017-02-16 00:00 +0100
Subject[PATCH v2] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h
Message-ID<tbgIj-5XZ-43@gated-at.bofh.it>
In reply to#1581680
btrfs_err_str function is not called from anywhere and is replicated
in the userspace headers for btrfs-progs.

It's removal also fixes the following linux/btrfs.h userspace
compilation error:

/usr/include/linux/btrfs.h: In function 'btrfs_err_str':
/usr/include/linux/btrfs.h:740:11: error: 'NULL' undeclared (first use in this function)
    return NULL;

Suggested-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---
v2: remove btrfs_err_str rather than fix it

 include/uapi/linux/btrfs.h | 27 ---------------------------
 1 file changed, 27 deletions(-)

diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
index db4c253..dcfc3a5 100644
--- a/include/uapi/linux/btrfs.h
+++ b/include/uapi/linux/btrfs.h
@@ -713,33 +713,6 @@ enum btrfs_err_code {
 	BTRFS_ERROR_DEV_ONLY_WRITABLE,
 	BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS
 };
-/* An error code to error string mapping for the kernel
-*  error codes
-*/
-static inline char *btrfs_err_str(enum btrfs_err_code err_code)
-{
-	switch (err_code) {
-		case BTRFS_ERROR_DEV_RAID1_MIN_NOT_MET:
-			return "unable to go below two devices on raid1";
-		case BTRFS_ERROR_DEV_RAID10_MIN_NOT_MET:
-			return "unable to go below four devices on raid10";
-		case BTRFS_ERROR_DEV_RAID5_MIN_NOT_MET:
-			return "unable to go below two devices on raid5";
-		case BTRFS_ERROR_DEV_RAID6_MIN_NOT_MET:
-			return "unable to go below three devices on raid6";
-		case BTRFS_ERROR_DEV_TGT_REPLACE:
-			return "unable to remove the dev_replace target dev";
-		case BTRFS_ERROR_DEV_MISSING_NOT_FOUND:
-			return "no missing devices found to remove";
-		case BTRFS_ERROR_DEV_ONLY_WRITABLE:
-			return "unable to remove the only writeable device";
-		case BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS:
-			return "add/delete/balance/replace/resize operation "\
-				"in progress";
-		default:
-			return NULL;
-	}
-}
 
 #define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \
 				   struct btrfs_ioctl_vol_args)
-- 
ldv

[toc] | [prev] | [next] | [standalone]


#1582604 — Re: [PATCH v2] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h

FromDavid Sterba <dsterba@suse.cz>
Date2017-02-16 15:20 +0100
SubjectRe: [PATCH v2] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h
Message-ID<tbv4B-7ic-3@gated-at.bofh.it>
In reply to#1581748
On Thu, Feb 16, 2017 at 01:55:03AM +0300, Dmitry V. Levin wrote:
> btrfs_err_str function is not called from anywhere and is replicated
> in the userspace headers for btrfs-progs.
> 
> It's removal also fixes the following linux/btrfs.h userspace
> compilation error:
> 
> /usr/include/linux/btrfs.h: In function 'btrfs_err_str':
> /usr/include/linux/btrfs.h:740:11: error: 'NULL' undeclared (first use in this function)
>     return NULL;
> 
> Suggested-by: Jeff Mahoney <jeffm@suse.com>
> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>

Reviewed-by: David Sterba <dsterba@suse.com>

[toc] | [prev] | [next] | [standalone]


#1589861 — [PATCH v3] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h

From"Dmitry V. Levin" <ldv@altlinux.org>
Date2017-03-01 00:20 +0100
Subject[PATCH v3] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h
Message-ID<tfZdM-2BN-25@gated-at.bofh.it>
In reply to#1581748
btrfs_err_str function is not called from anywhere and is replicated
in the userspace headers for btrfs-progs.

It's removal also fixes the following linux/btrfs.h userspace
compilation error:

/usr/include/linux/btrfs.h: In function 'btrfs_err_str':
/usr/include/linux/btrfs.h:740:11: error: 'NULL' undeclared (first use in this function)
    return NULL;

Suggested-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Reviewed-by: David Sterba <dsterba@suse.com>
---
v3: the patch seems to be lost, resending with updated list of addressees

v2: remove btrfs_err_str rather than fix it

 include/uapi/linux/btrfs.h | 27 ---------------------------
 1 file changed, 27 deletions(-)

diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
index db4c253..dcfc3a5 100644
--- a/include/uapi/linux/btrfs.h
+++ b/include/uapi/linux/btrfs.h
@@ -713,33 +713,6 @@ enum btrfs_err_code {
 	BTRFS_ERROR_DEV_ONLY_WRITABLE,
 	BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS
 };
-/* An error code to error string mapping for the kernel
-*  error codes
-*/
-static inline char *btrfs_err_str(enum btrfs_err_code err_code)
-{
-	switch (err_code) {
-		case BTRFS_ERROR_DEV_RAID1_MIN_NOT_MET:
-			return "unable to go below two devices on raid1";
-		case BTRFS_ERROR_DEV_RAID10_MIN_NOT_MET:
-			return "unable to go below four devices on raid10";
-		case BTRFS_ERROR_DEV_RAID5_MIN_NOT_MET:
-			return "unable to go below two devices on raid5";
-		case BTRFS_ERROR_DEV_RAID6_MIN_NOT_MET:
-			return "unable to go below three devices on raid6";
-		case BTRFS_ERROR_DEV_TGT_REPLACE:
-			return "unable to remove the dev_replace target dev";
-		case BTRFS_ERROR_DEV_MISSING_NOT_FOUND:
-			return "no missing devices found to remove";
-		case BTRFS_ERROR_DEV_ONLY_WRITABLE:
-			return "unable to remove the only writeable device";
-		case BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS:
-			return "add/delete/balance/replace/resize operation "\
-				"in progress";
-		default:
-			return NULL;
-	}
-}
 
 #define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \
 				   struct btrfs_ioctl_vol_args)
-- 
ldv

[toc] | [prev] | [next] | [standalone]


#1590429 — Re: [PATCH v3] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h

FromDavid Sterba <dsterba@suse.cz>
Date2017-03-01 16:50 +0100
SubjectRe: [PATCH v3] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h
Message-ID<tgeFQ-55d-19@gated-at.bofh.it>
In reply to#1589861
On Wed, Mar 01, 2017 at 02:12:50AM +0300, Dmitry V. Levin wrote:
> btrfs_err_str function is not called from anywhere and is replicated
> in the userspace headers for btrfs-progs.
> 
> It's removal also fixes the following linux/btrfs.h userspace
> compilation error:
> 
> /usr/include/linux/btrfs.h: In function 'btrfs_err_str':
> /usr/include/linux/btrfs.h:740:11: error: 'NULL' undeclared (first use in this function)
>     return NULL;
> 
> Suggested-by: Jeff Mahoney <jeffm@suse.com>
> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
> Reviewed-by: David Sterba <dsterba@suse.com>
> ---
> v3: the patch seems to be lost, resending with updated list of addressees

Indeed, I can't find how or where it got lost, sorry. Added to 4.11
again.

[toc] | [prev] | [next] | [standalone]


#1591076 — Re: [PATCH v3] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h

FromDavid Sterba <dsterba@suse.cz>
Date2017-03-02 14:40 +0100
SubjectRe: [PATCH v3] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h
Message-ID<tgz7A-2SA-3@gated-at.bofh.it>
In reply to#1590429
On Wed, Mar 01, 2017 at 03:54:35PM +0100, David Sterba wrote:
> On Wed, Mar 01, 2017 at 02:12:50AM +0300, Dmitry V. Levin wrote:
> > btrfs_err_str function is not called from anywhere and is replicated
> > in the userspace headers for btrfs-progs.
> > 
> > It's removal also fixes the following linux/btrfs.h userspace
> > compilation error:
> > 
> > /usr/include/linux/btrfs.h: In function 'btrfs_err_str':
> > /usr/include/linux/btrfs.h:740:11: error: 'NULL' undeclared (first use in this function)
> >     return NULL;
> > 
> > Suggested-by: Jeff Mahoney <jeffm@suse.com>
> > Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
> > Reviewed-by: David Sterba <dsterba@suse.com>
> > ---
> > v3: the patch seems to be lost, resending with updated list of addressees
> 
> Indeed, I can't find how or where it got lost, sorry. Added to 4.11
> again.

So it's because you did not CC linux-btrfs@ , I have the mails in my
inbox but haven't found it in the other folder while picking patches.

[toc] | [prev] | [next] | [standalone]


#1591102 — Re: [PATCH v3] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h

From"Dmitry V. Levin" <ldv@altlinux.org>
Date2017-03-02 15:00 +0100
SubjectRe: [PATCH v3] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h
Message-ID<tgzqW-2ZE-33@gated-at.bofh.it>
In reply to#1591076
On Thu, Mar 02, 2017 at 12:42:12PM +0100, David Sterba wrote:
> On Wed, Mar 01, 2017 at 03:54:35PM +0100, David Sterba wrote:
> > On Wed, Mar 01, 2017 at 02:12:50AM +0300, Dmitry V. Levin wrote:
> > > btrfs_err_str function is not called from anywhere and is replicated
> > > in the userspace headers for btrfs-progs.
> > > 
> > > It's removal also fixes the following linux/btrfs.h userspace
> > > compilation error:
> > > 
> > > /usr/include/linux/btrfs.h: In function 'btrfs_err_str':
> > > /usr/include/linux/btrfs.h:740:11: error: 'NULL' undeclared (first use in this function)
> > >     return NULL;
> > > 
> > > Suggested-by: Jeff Mahoney <jeffm@suse.com>
> > > Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
> > > Reviewed-by: David Sterba <dsterba@suse.com>
> > > ---
> > > v3: the patch seems to be lost, resending with updated list of addressees
> > 
> > Indeed, I can't find how or where it got lost, sorry. Added to 4.11
> > again.
> 
> So it's because you did not CC linux-btrfs@ , I have the mails in my
> inbox but haven't found it in the other folder while picking patches.

Thanks, I though so when Cc'ed linux-btrfs@ the last time.

Consider updating MAINTAINERS file so that scripts/get_maintainer.pl
would be able to print the right addressees for btrfs header files:

diff --git a/MAINTAINERS b/MAINTAINERS
index 0001835..04a758f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2905,4 +2905,6 @@ S:	Maintained
 F:	Documentation/filesystems/btrfs.txt
 F:	fs/btrfs/
+F:	include/linux/btrfs*
+F:	include/uapi/linux/btrfs*
 
 BTTV VIDEO4LINUX DRIVER

-- 
ldv

[toc] | [prev] | [next] | [standalone]


#1591401 — Re: [PATCH v3] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h

FromDavid Sterba <dsterba@suse.cz>
Date2017-03-02 20:10 +0100
SubjectRe: [PATCH v3] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h
Message-ID<tgEgW-6Ib-13@gated-at.bofh.it>
In reply to#1591102
On Thu, Mar 02, 2017 at 04:01:17PM +0300, Dmitry V. Levin wrote:
> On Thu, Mar 02, 2017 at 12:42:12PM +0100, David Sterba wrote:
> > On Wed, Mar 01, 2017 at 03:54:35PM +0100, David Sterba wrote:
> > > On Wed, Mar 01, 2017 at 02:12:50AM +0300, Dmitry V. Levin wrote:
> > > > btrfs_err_str function is not called from anywhere and is replicated
> > > > in the userspace headers for btrfs-progs.
> > > > 
> > > > It's removal also fixes the following linux/btrfs.h userspace
> > > > compilation error:
> > > > 
> > > > /usr/include/linux/btrfs.h: In function 'btrfs_err_str':
> > > > /usr/include/linux/btrfs.h:740:11: error: 'NULL' undeclared (first use in this function)
> > > >     return NULL;
> > > > 
> > > > Suggested-by: Jeff Mahoney <jeffm@suse.com>
> > > > Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
> > > > Reviewed-by: David Sterba <dsterba@suse.com>
> > > > ---
> > > > v3: the patch seems to be lost, resending with updated list of addressees
> > > 
> > > Indeed, I can't find how or where it got lost, sorry. Added to 4.11
> > > again.
> > 
> > So it's because you did not CC linux-btrfs@ , I have the mails in my
> > inbox but haven't found it in the other folder while picking patches.
> 
> Thanks, I though so when Cc'ed linux-btrfs@ the last time.
> 
> Consider updating MAINTAINERS file so that scripts/get_maintainer.pl
> would be able to print the right addressees for btrfs header files:

Good idea.

> diff --git a/MAINTAINERS b/MAINTAINERS
> index 0001835..04a758f 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -2905,4 +2905,6 @@ S:	Maintained
>  F:	Documentation/filesystems/btrfs.txt
>  F:	fs/btrfs/
> +F:	include/linux/btrfs*
> +F:	include/uapi/linux/btrfs*
>  
>  BTTV VIDEO4LINUX DRIVER

Please send a proper patch and add

Acked-by: David Sterba <dsterba@suse.com>

[toc] | [prev] | [next] | [standalone]


#1591426 — [PATCH] MAINTAINERS: add btrfs file entries

From"Dmitry V. Levin" <ldv@altlinux.org>
Date2017-03-02 20:50 +0100
Subject[PATCH] MAINTAINERS: add btrfs file entries
Message-ID<tgETE-6XA-5@gated-at.bofh.it>
In reply to#1591401
Add file entries for btrfs header files.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Acked-by: David Sterba <dsterba@suse.com>
---
 MAINTAINERS | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 0001835..04a758f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2904,6 +2904,8 @@ T:	git git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git
 S:	Maintained
 F:	Documentation/filesystems/btrfs.txt
 F:	fs/btrfs/
+F:	include/linux/btrfs*
+F:	include/uapi/linux/btrfs*
 
 BTTV VIDEO4LINUX DRIVER
 M:	Mauro Carvalho Chehab <mchehab@s-opensource.com>
-- 
ldv

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web