a010a3cf4ad1f7f8e202e1c8022f2864734d2545
[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 diff --git a/drivers/mtd/ubi/block.c b/drivers/mtd/ubi/block.c
20 index 16e6731..69a74fd 100644
21 --- a/drivers/mtd/ubi/block.c
22 +++ b/drivers/mtd/ubi/block.c
23 @@ -32,7 +32,7 @@
24   * This feature is compiled in the UBI core, and adds a 'block' parameter
25   * to allow early creation of block devices on top of UBI volumes. Runtime
26   * block creation/removal for UBI volumes is provided through two UBI ioctls:
27 - * UBI_IOCVOLATTBLK and UBI_IOCVOLDETBLK.
28 + * UBI_IOCVOLCRBLK and UBI_IOCVOLRMBLK.
29   */
30  
31  #include <linux/module.h>
32 diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c
33 index 11c8473..f54562a 100644
34 --- a/drivers/mtd/ubi/cdev.c
35 +++ b/drivers/mtd/ubi/cdev.c
36 @@ -561,8 +561,8 @@ static long vol_cdev_ioctl(struct file *file, unsigned int cmd,
37                 break;
38         }
39  
40 -       /* Attach a block device to an UBI volume */
41 -       case UBI_IOCVOLATTBLK:
42 +       /* Create a R/O block device on top of the UBI volume */
43 +       case UBI_IOCVOLCRBLK:
44         {
45                 struct ubi_volume_info vi;
46  
47 @@ -571,8 +571,8 @@ static long vol_cdev_ioctl(struct file *file, unsigned int cmd,
48                 break;
49         }
50  
51 -       /* Dettach a block device from an UBI volume */
52 -       case UBI_IOCVOLDETBLK:
53 +       /* Remove the R/O block device */
54 +       case UBI_IOCVOLRMBLK:
55         {
56                 struct ubi_volume_info vi;
57  
58 diff --git a/include/uapi/mtd/ubi-user.h b/include/uapi/mtd/ubi-user.h
59 index b98585a..9c885e2 100644
60 --- a/include/uapi/mtd/ubi-user.h
61 +++ b/include/uapi/mtd/ubi-user.h
62 @@ -138,9 +138,9 @@
63   * Block devices on UBI volumes
64   * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
65   *
66 - * To attach or detach a block device from an UBI volume the %UBI_IOCVOLATTBLK
67 - * and %UBI_IOCVOLDETBLK ioctl commands should be used, respectively.
68 - * These commands take no arguments.
69 + * To create or remove a R/O block device on top of an UBI volume the
70 + * %UBI_IOCVOLCRBLK and %UBI_IOCVOLRMBLK ioctl commands should be used,
71 + * respectively. These commands take no arguments.
72   */
73  
74  /*
75 @@ -198,10 +198,10 @@
76  /* Set an UBI volume property */
77  #define UBI_IOCSETVOLPROP _IOW(UBI_VOL_IOC_MAGIC, 6, \
78                                struct ubi_set_vol_prop_req)
79 -/* Attach a block device to an UBI volume */
80 -#define UBI_IOCVOLATTBLK _IO(UBI_VOL_IOC_MAGIC, 7)
81 -/* Detach a block device from an UBI volume */
82 -#define UBI_IOCVOLDETBLK _IO(UBI_VOL_IOC_MAGIC, 8)
83 +/* Create a R/O block device on top of an UBI volume */
84 +#define UBI_IOCVOLCRBLK _IO(UBI_VOL_IOC_MAGIC, 7)
85 +/* Remove the R/O block device */
86 +#define UBI_IOCVOLRMBLK _IO(UBI_VOL_IOC_MAGIC, 8)
87  
88  /* Maximum MTD device name length supported by UBI */
89  #define MAX_UBI_MTD_NAME_LEN 127
90 -- 
91 1.9.2
92