Skip to content

Commit 68598d2

Browse files
ldv-altkdave
authored andcommitted
btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h
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 <[email protected]> Signed-off-by: Dmitry V. Levin <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent e9f467d commit 68598d2

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

include/uapi/linux/btrfs.h

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -713,33 +713,6 @@ enum btrfs_err_code {
713713
BTRFS_ERROR_DEV_ONLY_WRITABLE,
714714
BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS
715715
};
716-
/* An error code to error string mapping for the kernel
717-
* error codes
718-
*/
719-
static inline char *btrfs_err_str(enum btrfs_err_code err_code)
720-
{
721-
switch (err_code) {
722-
case BTRFS_ERROR_DEV_RAID1_MIN_NOT_MET:
723-
return "unable to go below two devices on raid1";
724-
case BTRFS_ERROR_DEV_RAID10_MIN_NOT_MET:
725-
return "unable to go below four devices on raid10";
726-
case BTRFS_ERROR_DEV_RAID5_MIN_NOT_MET:
727-
return "unable to go below two devices on raid5";
728-
case BTRFS_ERROR_DEV_RAID6_MIN_NOT_MET:
729-
return "unable to go below three devices on raid6";
730-
case BTRFS_ERROR_DEV_TGT_REPLACE:
731-
return "unable to remove the dev_replace target dev";
732-
case BTRFS_ERROR_DEV_MISSING_NOT_FOUND:
733-
return "no missing devices found to remove";
734-
case BTRFS_ERROR_DEV_ONLY_WRITABLE:
735-
return "unable to remove the only writeable device";
736-
case BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS:
737-
return "add/delete/balance/replace/resize operation "\
738-
"in progress";
739-
default:
740-
return NULL;
741-
}
742-
}
743716

744717
#define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \
745718
struct btrfs_ioctl_vol_args)

0 commit comments

Comments
 (0)