aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-09 15:33:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-09 15:33:09 -0400
commite3a0dd98e1ddfd135b7ef889fcc0269e8c2ca445 (patch)
tree7f942b10ffe7ea1498e4b1d3a206291692647040 /include/uapi/linux
parentda89bd213fe719ec3552abbeb8be12d0cc0337ca (diff)
parent0e267c44c3a402d35111d1935be1167240b5b79f (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs
Pull btrfs update from Chris Mason: "These are the usual mixture of bugs, cleanups and performance fixes. Miao has some really nice tuning of our crc code as well as our transaction commits. Josef is peeling off more and more problems related to early enospc, and has a number of important bug fixes in here too" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (81 commits) Btrfs: wait ordered range before doing direct io Btrfs: only do the tree_mod_log_free_eb if this is our last ref Btrfs: hold the tree mod lock in __tree_mod_log_rewind Btrfs: make backref walking code handle skinny metadata Btrfs: fix crash regarding to ulist_add_merge Btrfs: fix several potential problems in copy_nocow_pages_for_inode Btrfs: cleanup the code of copy_nocow_pages_for_inode() Btrfs: fix oops when recovering the file data by scrub function Btrfs: make the chunk allocator completely tree lockless Btrfs: cleanup orphaned root orphan item Btrfs: fix wrong mirror number tuning Btrfs: cleanup redundant code in btrfs_submit_direct() Btrfs: remove btrfs_sector_sum structure Btrfs: check if we can nocow if we don't have data space Btrfs: stop using try_to_writeback_inodes_sb_nr to flush delalloc Btrfs: use a percpu to keep track of possibly pinned bytes Btrfs: check for actual acls rather than just xattrs when caching no acl Btrfs: move btrfs_truncate_page to btrfs_cont_expand instead of btrfs_truncate Btrfs: optimize reada_for_balance Btrfs: optimize read_block_for_search ...
Diffstat (limited to 'include/uapi/linux')
-rw-r--r--include/uapi/linux/btrfs.h42
1 files changed, 41 insertions, 1 deletions
diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
index 5ef0df545a2a..05aed70627e2 100644
--- a/include/uapi/linux/btrfs.h
+++ b/include/uapi/linux/btrfs.h
@@ -447,6 +447,46 @@ struct btrfs_ioctl_send_args {
447 __u64 reserved[4]; /* in */ 447 __u64 reserved[4]; /* in */
448}; 448};
449 449
450/* Error codes as returned by the kernel */
451enum btrfs_err_code {
452 notused,
453 BTRFS_ERROR_DEV_RAID1_MIN_NOT_MET,
454 BTRFS_ERROR_DEV_RAID10_MIN_NOT_MET,
455 BTRFS_ERROR_DEV_RAID5_MIN_NOT_MET,
456 BTRFS_ERROR_DEV_RAID6_MIN_NOT_MET,
457 BTRFS_ERROR_DEV_TGT_REPLACE,
458 BTRFS_ERROR_DEV_MISSING_NOT_FOUND,
459 BTRFS_ERROR_DEV_ONLY_WRITABLE,
460 BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS
461};
462/* An error code to error string mapping for the kernel
463* error codes
464*/
465static inline char *btrfs_err_str(enum btrfs_err_code err_code)
466{
467 switch (err_code) {
468 case BTRFS_ERROR_DEV_RAID1_MIN_NOT_MET:
469 return "unable to go below two devices on raid1";
470 case BTRFS_ERROR_DEV_RAID10_MIN_NOT_MET:
471 return "unable to go below four devices on raid10";
472 case BTRFS_ERROR_DEV_RAID5_MIN_NOT_MET:
473 return "unable to go below two devices on raid5";
474 case BTRFS_ERROR_DEV_RAID6_MIN_NOT_MET:
475 return "unable to go below three devices on raid6";
476 case BTRFS_ERROR_DEV_TGT_REPLACE:
477 return "unable to remove the dev_replace target dev";
478 case BTRFS_ERROR_DEV_MISSING_NOT_FOUND:
479 return "no missing devices found to remove";
480 case BTRFS_ERROR_DEV_ONLY_WRITABLE:
481 return "unable to remove the only writeable device";
482 case BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS:
483 return "add/delete/balance/replace/resize operation "\
484 "in progress";
485 default:
486 return NULL;
487 }
488}
489
450#define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \ 490#define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \
451 struct btrfs_ioctl_vol_args) 491 struct btrfs_ioctl_vol_args)
452#define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \ 492#define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \
@@ -530,6 +570,7 @@ struct btrfs_ioctl_send_args {
530 struct btrfs_ioctl_quota_rescan_args) 570 struct btrfs_ioctl_quota_rescan_args)
531#define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, \ 571#define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, \
532 struct btrfs_ioctl_quota_rescan_args) 572 struct btrfs_ioctl_quota_rescan_args)
573#define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46)
533#define BTRFS_IOC_GET_FSLABEL _IOR(BTRFS_IOCTL_MAGIC, 49, \ 574#define BTRFS_IOC_GET_FSLABEL _IOR(BTRFS_IOCTL_MAGIC, 49, \
534 char[BTRFS_LABEL_SIZE]) 575 char[BTRFS_LABEL_SIZE])
535#define BTRFS_IOC_SET_FSLABEL _IOW(BTRFS_IOCTL_MAGIC, 50, \ 576#define BTRFS_IOC_SET_FSLABEL _IOW(BTRFS_IOCTL_MAGIC, 50, \
@@ -538,5 +579,4 @@ struct btrfs_ioctl_send_args {
538 struct btrfs_ioctl_get_dev_stats) 579 struct btrfs_ioctl_get_dev_stats)
539#define BTRFS_IOC_DEV_REPLACE _IOWR(BTRFS_IOCTL_MAGIC, 53, \ 580#define BTRFS_IOC_DEV_REPLACE _IOWR(BTRFS_IOCTL_MAGIC, 53, \
540 struct btrfs_ioctl_dev_replace_args) 581 struct btrfs_ioctl_dev_replace_args)
541
542#endif /* _UAPI_LINUX_BTRFS_H */ 582#endif /* _UAPI_LINUX_BTRFS_H */