kernel: update 3.14 to 3.14.7
[openwrt.git] / target / linux / generic / patches-3.14 / 044-UBI-rename-block-device-ioctls.patch
1 From 8af871887fcba470ff9265c65cff7d14d9e0e3f9 Mon Sep 17 00:00:00 2001
2 From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
3 Date: Wed, 5 Mar 2014 13:01:56 +0200
4 Subject: [PATCH] UBI: rename block device ioctls
5
6 Rename the UBI_IOCVOLATTBLK and UBI_IOCVOLDETBLK to UBI_IOCVOLCRBLK and
7 UBI_IOCVOLRMBLK, because we do not use terms "attach" and "detach" for the R/O
8 block devices on top of UBI volumes. Instead, we use terms "create" and
9 "remove". This patch also amends the related commentaries.
10
11 Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
12 Acked-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
13 ---
14  drivers/mtd/ubi/block.c     |  2 +-
15  drivers/mtd/ubi/cdev.c      |  8 ++++----
16  include/uapi/mtd/ubi-user.h | 14 +++++++-------
17  3 files changed, 12 insertions(+), 12 deletions(-)
18
19 --- a/drivers/mtd/ubi/block.c
20 +++ b/drivers/mtd/ubi/block.c
21 @@ -32,7 +32,7 @@
22   * This feature is compiled in the UBI core, and adds a 'block' parameter
23   * to allow early creation of block devices on top of UBI volumes. Runtime
24   * block creation/removal for UBI volumes is provided through two UBI ioctls:
25 - * UBI_IOCVOLATTBLK and UBI_IOCVOLDETBLK.
26 + * UBI_IOCVOLCRBLK and UBI_IOCVOLRMBLK.
27   */
28  
29  #include <linux/module.h>
30 --- a/drivers/mtd/ubi/cdev.c
31 +++ b/drivers/mtd/ubi/cdev.c
32 @@ -561,8 +561,8 @@ static long vol_cdev_ioctl(struct file *
33                 break;
34         }
35  
36 -       /* Attach a block device to an UBI volume */
37 -       case UBI_IOCVOLATTBLK:
38 +       /* Create a R/O block device on top of the UBI volume */
39 +       case UBI_IOCVOLCRBLK:
40         {
41                 struct ubi_volume_info vi;
42  
43 @@ -571,8 +571,8 @@ static long vol_cdev_ioctl(struct file *
44                 break;
45         }
46  
47 -       /* Dettach a block device from an UBI volume */
48 -       case UBI_IOCVOLDETBLK:
49 +       /* Remove the R/O block device */
50 +       case UBI_IOCVOLRMBLK:
51         {
52                 struct ubi_volume_info vi;
53  
54 --- a/include/uapi/mtd/ubi-user.h
55 +++ b/include/uapi/mtd/ubi-user.h
56 @@ -138,9 +138,9 @@
57   * Block devices on UBI volumes
58   * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
59   *
60 - * To attach or detach a block device from an UBI volume the %UBI_IOCVOLATTBLK
61 - * and %UBI_IOCVOLDETBLK ioctl commands should be used, respectively.
62 - * These commands take no arguments.
63 + * To create or remove a R/O block device on top of an UBI volume the
64 + * %UBI_IOCVOLCRBLK and %UBI_IOCVOLRMBLK ioctl commands should be used,
65 + * respectively. These commands take no arguments.
66   */
67  
68  /*
69 @@ -198,10 +198,10 @@
70  /* Set an UBI volume property */
71  #define UBI_IOCSETVOLPROP _IOW(UBI_VOL_IOC_MAGIC, 6, \
72                                struct ubi_set_vol_prop_req)
73 -/* Attach a block device to an UBI volume */
74 -#define UBI_IOCVOLATTBLK _IO(UBI_VOL_IOC_MAGIC, 7)
75 -/* Detach a block device from an UBI volume */
76 -#define UBI_IOCVOLDETBLK _IO(UBI_VOL_IOC_MAGIC, 8)
77 +/* Create a R/O block device on top of an UBI volume */
78 +#define UBI_IOCVOLCRBLK _IO(UBI_VOL_IOC_MAGIC, 7)
79 +/* Remove the R/O block device */
80 +#define UBI_IOCVOLRMBLK _IO(UBI_VOL_IOC_MAGIC, 8)
81  
82  /* Maximum MTD device name length supported by UBI */
83  #define MAX_UBI_MTD_NAME_LEN 127