kernel: backport ubiblock support from 3.15
[openwrt/staging/chunkeey.git] / target / linux / generic / patches-3.14 / 047-UBI-make-UBI_IOCVOLCRBLK-take-a-parameter-for-future.patch
1 From 463c5eedb4a13b9aa91f05498a0f2c20bd03f8c4 Mon Sep 17 00:00:00 2001
2 From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
3 Date: Wed, 5 Mar 2014 11:16:14 -0300
4 Subject: [PATCH] UBI: make UBI_IOCVOLCRBLK take a parameter for future usage
5
6 In order to allow a future ioctl parameter, such as a creation flag,
7 we change the UBI_IOCVOLCRBLK so it accepts a struct ubi_blkcreate_req.
8 For the time being the structure is not in use, but fully reserved.
9
10 This ABI change is still possible and harmless, because the ioctl has just
11 been introduced and there's no userspace program which uses it.
12
13 Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
14 Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
15 ---
16 include/uapi/mtd/ubi-user.h | 19 +++++++++++++++----
17 1 file changed, 15 insertions(+), 4 deletions(-)
18
19 diff --git a/include/uapi/mtd/ubi-user.h b/include/uapi/mtd/ubi-user.h
20 index 9c885e2..1927b0d 100644
21 --- a/include/uapi/mtd/ubi-user.h
22 +++ b/include/uapi/mtd/ubi-user.h
23 @@ -138,9 +138,12 @@
24 * Block devices on UBI volumes
25 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26 *
27 - * To create or remove a R/O block device on top of an UBI volume the
28 - * %UBI_IOCVOLCRBLK and %UBI_IOCVOLRMBLK ioctl commands should be used,
29 - * respectively. These commands take no arguments.
30 + * To create a R/O block device on top of an UBI volume the %UBI_IOCVOLCRBLK
31 + * should be used. A pointer to a &struct ubi_blkcreate_req object is expected
32 + * to be passed, which is not used and reserved for future usage.
33 + *
34 + * Conversely, to remove a block device the %UBI_IOCVOLRMBLK should be used,
35 + * which takes no arguments.
36 */
37
38 /*
39 @@ -199,7 +202,7 @@
40 #define UBI_IOCSETVOLPROP _IOW(UBI_VOL_IOC_MAGIC, 6, \
41 struct ubi_set_vol_prop_req)
42 /* Create a R/O block device on top of an UBI volume */
43 -#define UBI_IOCVOLCRBLK _IO(UBI_VOL_IOC_MAGIC, 7)
44 +#define UBI_IOCVOLCRBLK _IOW(UBI_VOL_IOC_MAGIC, 7, struct ubi_blkcreate_req)
45 /* Remove the R/O block device */
46 #define UBI_IOCVOLRMBLK _IO(UBI_VOL_IOC_MAGIC, 8)
47
48 @@ -431,4 +434,12 @@ struct ubi_set_vol_prop_req {
49 __u64 value;
50 } __packed;
51
52 +/**
53 + * struct ubi_blkcreate_req - a data structure used in block creation requests.
54 + * @padding: reserved for future, not used, has to be zeroed
55 + */
56 +struct ubi_blkcreate_req {
57 + __s8 padding[128];
58 +} __packed;
59 +
60 #endif /* __UBI_USER_H__ */
61 --
62 1.9.2
63