mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
e10b376e98
commit
6748482f41
|
@ -561,18 +561,18 @@ static long vol_cdev_ioctl(struct file *file, unsigned int cmd,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set volume property command */
|
/* Set volume property command */
|
||||||
case UBI_IOCSETPROP:
|
case UBI_IOCSETVOLPROP:
|
||||||
{
|
{
|
||||||
struct ubi_set_prop_req req;
|
struct ubi_set_vol_prop_req req;
|
||||||
|
|
||||||
err = copy_from_user(&req, argp,
|
err = copy_from_user(&req, argp,
|
||||||
sizeof(struct ubi_set_prop_req));
|
sizeof(struct ubi_set_vol_prop_req));
|
||||||
if (err) {
|
if (err) {
|
||||||
err = -EFAULT;
|
err = -EFAULT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch (req.property) {
|
switch (req.property) {
|
||||||
case UBI_PROP_DIRECT_WRITE:
|
case UBI_VOL_PROP_DIRECT_WRITE:
|
||||||
mutex_lock(&ubi->device_mutex);
|
mutex_lock(&ubi->device_mutex);
|
||||||
desc->vol->direct_writes = !!req.value;
|
desc->vol->direct_writes = !!req.value;
|
||||||
mutex_unlock(&ubi->device_mutex);
|
mutex_unlock(&ubi->device_mutex);
|
||||||
|
|
|
@ -131,7 +131,7 @@
|
||||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
*
|
*
|
||||||
* To set an UBI volume property the %UBI_IOCSETPROP ioctl command should be
|
* To set an UBI volume property the %UBI_IOCSETPROP ioctl command should be
|
||||||
* used. A pointer to a &struct ubi_set_prop_req object is expected to be
|
* used. A pointer to a &struct ubi_set_vol_prop_req object is expected to be
|
||||||
* passed. The object describes which property should be set, and to which value
|
* passed. The object describes which property should be set, and to which value
|
||||||
* it should be set.
|
* it should be set.
|
||||||
*/
|
*/
|
||||||
|
@ -186,7 +186,8 @@
|
||||||
/* Check if LEB is mapped command */
|
/* Check if LEB is mapped command */
|
||||||
#define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, __s32)
|
#define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, __s32)
|
||||||
/* Set an UBI volume property */
|
/* Set an UBI volume property */
|
||||||
#define UBI_IOCSETPROP _IOW(UBI_VOL_IOC_MAGIC, 6, struct ubi_set_prop_req)
|
#define UBI_IOCSETVOLPROP _IOW(UBI_VOL_IOC_MAGIC, 6, \
|
||||||
|
struct ubi_set_vol_prop_req)
|
||||||
|
|
||||||
/* Maximum MTD device name length supported by UBI */
|
/* Maximum MTD device name length supported by UBI */
|
||||||
#define MAX_UBI_MTD_NAME_LEN 127
|
#define MAX_UBI_MTD_NAME_LEN 127
|
||||||
|
@ -225,11 +226,11 @@ enum {
|
||||||
/*
|
/*
|
||||||
* UBI set property ioctl constants
|
* UBI set property ioctl constants
|
||||||
*
|
*
|
||||||
* @UBI_PROP_DIRECT_WRITE: allow / disallow user to directly write and
|
* @UBI_VOL_PROP_DIRECT_WRITE: allow / disallow user to directly write and
|
||||||
* erase individual eraseblocks on dynamic volumes
|
* erase individual eraseblocks on dynamic volumes
|
||||||
*/
|
*/
|
||||||
enum {
|
enum {
|
||||||
UBI_PROP_DIRECT_WRITE = 1,
|
UBI_VOL_PROP_DIRECT_WRITE = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -397,13 +398,13 @@ struct ubi_map_req {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct ubi_set_prop_req - a data structure used to set an ubi volume
|
* struct ubi_set_vol_prop_req - a data structure used to set an ubi volume
|
||||||
* property.
|
* property.
|
||||||
* @property: property to set (%UBI_PROP_DIRECT_WRITE)
|
* @property: property to set (%UBI_VOL_PROP_DIRECT_WRITE)
|
||||||
* @padding: reserved for future, not used, has to be zeroed
|
* @padding: reserved for future, not used, has to be zeroed
|
||||||
* @value: value to set
|
* @value: value to set
|
||||||
*/
|
*/
|
||||||
struct ubi_set_prop_req {
|
struct ubi_set_vol_prop_req {
|
||||||
__u8 property;
|
__u8 property;
|
||||||
__u8 padding[7];
|
__u8 padding[7];
|
||||||
__u64 value;
|
__u64 value;
|
||||||
|
|
Loading…
Reference in New Issue