Skip to content

Commit 6748482

Browse files
Artem BityutskiyArtem Bityutskiy
authored andcommitted
UBI: re-name set volume properties ioctl
Rename the ioctl which sets volume properties from 'UBI_IOCSETPROP' to 'UBI_IOCSETVOLPROP' to reflect the fact that this ioctl is about volume properties, not device properties. This is also consistent with the other volume ioctl name - 'UBI_IOCVOLUP'. The main motivation for the re-name, however, is that we are going to introduce the per-UBI device "set properties" ioctl, so we need good and logical naming. At the same time, re-name the "set volume properties request" data structure from 'struct ubi_set_prop_req' to 'struct ubi_set_vol_prop_req'. And re-name 'UBI_PROP_DIRECT_WRITE' to 'UBI_VOL_PROP_DIRECT_WRITE'. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
1 parent e10b376 commit 6748482

2 files changed

Lines changed: 14 additions & 13 deletions

File tree

‎drivers/mtd/ubi/cdev.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -561,18 +561,18 @@ static long vol_cdev_ioctl(struct file *file, unsigned int cmd,
561561
}
562562

563563
/* Set volume property command */
564-
case UBI_IOCSETPROP:
564+
case UBI_IOCSETVOLPROP:
565565
{
566-
struct ubi_set_prop_req req;
566+
struct ubi_set_vol_prop_req req;
567567

568568
err = copy_from_user(&req, argp,
569-
sizeof(struct ubi_set_prop_req));
569+
sizeof(struct ubi_set_vol_prop_req));
570570
if (err) {
571571
err = -EFAULT;
572572
break;
573573
}
574574
switch (req.property) {
575-
case UBI_PROP_DIRECT_WRITE:
575+
case UBI_VOL_PROP_DIRECT_WRITE:
576576
mutex_lock(&ubi->device_mutex);
577577
desc->vol->direct_writes = !!req.value;
578578
mutex_unlock(&ubi->device_mutex);

‎include/mtd/ubi-user.h‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
* ~~~~~~~~~~~~~~~~~~~~~~~~~
132132
*
133133
* To set an UBI volume property the %UBI_IOCSETPROP ioctl command should be
134-
* used. A pointer to a &struct ubi_set_prop_req object is expected to be
134+
* used. A pointer to a &struct ubi_set_vol_prop_req object is expected to be
135135
* passed. The object describes which property should be set, and to which value
136136
* it should be set.
137137
*/
@@ -186,7 +186,8 @@
186186
/* Check if LEB is mapped command */
187187
#define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, __s32)
188188
/* Set an UBI volume property */
189-
#define UBI_IOCSETPROP _IOW(UBI_VOL_IOC_MAGIC, 6, struct ubi_set_prop_req)
189+
#define UBI_IOCSETVOLPROP _IOW(UBI_VOL_IOC_MAGIC, 6, \
190+
struct ubi_set_vol_prop_req)
190191

191192
/* Maximum MTD device name length supported by UBI */
192193
#define MAX_UBI_MTD_NAME_LEN 127
@@ -225,11 +226,11 @@ enum {
225226
/*
226227
* UBI set property ioctl constants
227228
*
228-
* @UBI_PROP_DIRECT_WRITE: allow / disallow user to directly write and
229-
* erase individual eraseblocks on dynamic volumes
229+
* @UBI_VOL_PROP_DIRECT_WRITE: allow / disallow user to directly write and
230+
* erase individual eraseblocks on dynamic volumes
230231
*/
231232
enum {
232-
UBI_PROP_DIRECT_WRITE = 1,
233+
UBI_VOL_PROP_DIRECT_WRITE = 1,
233234
};
234235

235236
/**
@@ -397,13 +398,13 @@ struct ubi_map_req {
397398

398399

399400
/**
400-
* struct ubi_set_prop_req - a data structure used to set an ubi volume
401-
* property.
402-
* @property: property to set (%UBI_PROP_DIRECT_WRITE)
401+
* struct ubi_set_vol_prop_req - a data structure used to set an ubi volume
402+
* property.
403+
* @property: property to set (%UBI_VOL_PROP_DIRECT_WRITE)
403404
* @padding: reserved for future, not used, has to be zeroed
404405
* @value: value to set
405406
*/
406-
struct ubi_set_prop_req {
407+
struct ubi_set_vol_prop_req {
407408
__u8 property;
408409
__u8 padding[7];
409410
__u64 value;

0 commit comments

Comments
 (0)