Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 250471
b: refs/heads/master
c: 6748482
h: refs/heads/master
i:
  250469: 7e87082
  250467: 4e60aec
  250463: b3db08a
v: v3
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed Apr 14, 2011
1 parent 86ae23b commit 56d85a0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e10b376e98332edcc2530aaed384a7e248477052
refs/heads/master: 6748482f4153fc0e095aa3dc831d5edac5656a80
8 changes: 4 additions & 4 deletions trunk/drivers/mtd/ubi/cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,18 +561,18 @@ static long vol_cdev_ioctl(struct file *file, unsigned int cmd,
}

/* 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,
sizeof(struct ubi_set_prop_req));
sizeof(struct ubi_set_vol_prop_req));
if (err) {
err = -EFAULT;
break;
}
switch (req.property) {
case UBI_PROP_DIRECT_WRITE:
case UBI_VOL_PROP_DIRECT_WRITE:
mutex_lock(&ubi->device_mutex);
desc->vol->direct_writes = !!req.value;
mutex_unlock(&ubi->device_mutex);
Expand Down
19 changes: 10 additions & 9 deletions trunk/include/mtd/ubi-user.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
* ~~~~~~~~~~~~~~~~~~~~~~~~~
*
* 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
* it should be set.
*/
Expand Down Expand Up @@ -186,7 +186,8 @@
/* Check if LEB is mapped command */
#define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, __s32)
/* 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 */
#define MAX_UBI_MTD_NAME_LEN 127
Expand Down Expand Up @@ -225,11 +226,11 @@ enum {
/*
* UBI set property ioctl constants
*
* @UBI_PROP_DIRECT_WRITE: allow / disallow user to directly write and
* erase individual eraseblocks on dynamic volumes
* @UBI_VOL_PROP_DIRECT_WRITE: allow / disallow user to directly write and
* erase individual eraseblocks on dynamic volumes
*/
enum {
UBI_PROP_DIRECT_WRITE = 1,
UBI_VOL_PROP_DIRECT_WRITE = 1,
};

/**
Expand Down Expand Up @@ -397,13 +398,13 @@ struct ubi_map_req {


/**
* struct ubi_set_prop_req - a data structure used to set an ubi volume
* property.
* @property: property to set (%UBI_PROP_DIRECT_WRITE)
* struct ubi_set_vol_prop_req - a data structure used to set an ubi volume
* property.
* @property: property to set (%UBI_VOL_PROP_DIRECT_WRITE)
* @padding: reserved for future, not used, has to be zeroed
* @value: value to set
*/
struct ubi_set_prop_req {
struct ubi_set_vol_prop_req {
__u8 property;
__u8 padding[7];
__u64 value;
Expand Down

0 comments on commit 56d85a0

Please sign in to comment.