aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-24 14:51:26 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-24 14:51:26 -0400
commit4d429480352c63db2228489f0db9fd381cdc3c9c (patch)
tree96a3bc976735ef01d5d5e42353ae1dd795d34370 /include
parenteb08d8ff476ad39a149e1044c7d3fd742a168864 (diff)
parentab50ff684707031ed4bad2fdd313208ae392e5bb (diff)
Merge branch 'linux-next' of git://git.infradead.org/ubi-2.6
* 'linux-next' of git://git.infradead.org/ubi-2.6: UBI: switch to dynamic printks UBI: turn some macros into static inline UBI: improve checking in debugging prints UBI: fix typo in a message UBI: fix minor stylistic issues UBI: use __packed instead of __attribute__((packed)) UBI: cleanup comments around volume properties UBI: re-name set volume properties ioctl UBI: make the control character device non-seekable
Diffstat (limited to 'include')
-rw-r--r--include/linux/mtd/ubi.h4
-rw-r--r--include/mtd/ubi-user.h40
2 files changed, 23 insertions, 21 deletions
diff --git a/include/linux/mtd/ubi.h b/include/linux/mtd/ubi.h
index 84854edf4436..15da0e99f48a 100644
--- a/include/linux/mtd/ubi.h
+++ b/include/linux/mtd/ubi.h
@@ -21,7 +21,7 @@
21#ifndef __LINUX_UBI_H__ 21#ifndef __LINUX_UBI_H__
22#define __LINUX_UBI_H__ 22#define __LINUX_UBI_H__
23 23
24#include <asm/ioctl.h> 24#include <linux/ioctl.h>
25#include <linux/types.h> 25#include <linux/types.h>
26#include <mtd/ubi-user.h> 26#include <mtd/ubi-user.h>
27 27
@@ -87,7 +87,7 @@ enum {
87 * physical eraseblock size and on how much bytes UBI headers consume. But 87 * physical eraseblock size and on how much bytes UBI headers consume. But
88 * because of the volume alignment (@alignment), the usable size of logical 88 * because of the volume alignment (@alignment), the usable size of logical
89 * eraseblocks if a volume may be less. The following equation is true: 89 * eraseblocks if a volume may be less. The following equation is true:
90 * @usable_leb_size = LEB size - (LEB size mod @alignment), 90 * @usable_leb_size = LEB size - (LEB size mod @alignment),
91 * where LEB size is the logical eraseblock size defined by the UBI device. 91 * where LEB size is the logical eraseblock size defined by the UBI device.
92 * 92 *
93 * The alignment is multiple to the minimal flash input/output unit size or %1 93 * The alignment is multiple to the minimal flash input/output unit size or %1
diff --git a/include/mtd/ubi-user.h b/include/mtd/ubi-user.h
index c0d47ad4b103..3c4109777aff 100644
--- a/include/mtd/ubi-user.h
+++ b/include/mtd/ubi-user.h
@@ -131,7 +131,7 @@
131 * ~~~~~~~~~~~~~~~~~~~~~~~~~ 131 * ~~~~~~~~~~~~~~~~~~~~~~~~~
132 * 132 *
133 * To set an UBI volume property the %UBI_IOCSETPROP ioctl command should be 133 * 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
135 * passed. The object describes which property should be set, and to which value 135 * passed. The object describes which property should be set, and to which value
136 * it should be set. 136 * it should be set.
137 */ 137 */
@@ -186,7 +186,8 @@
186/* Check if LEB is mapped command */ 186/* Check if LEB is mapped command */
187#define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, __s32) 187#define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, __s32)
188/* Set an UBI volume property */ 188/* 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)
190 191
191/* Maximum MTD device name length supported by UBI */ 192/* Maximum MTD device name length supported by UBI */
192#define MAX_UBI_MTD_NAME_LEN 127 193#define MAX_UBI_MTD_NAME_LEN 127
@@ -223,13 +224,14 @@ enum {
223}; 224};
224 225
225/* 226/*
226 * UBI set property ioctl constants 227 * UBI set volume property ioctl constants.
227 * 228 *
228 * @UBI_PROP_DIRECT_WRITE: allow / disallow user to directly write and 229 * @UBI_VOL_PROP_DIRECT_WRITE: allow (any non-zero value) or disallow (value 0)
229 * erase individual eraseblocks on dynamic volumes 230 * user to directly write and erase individual
231 * eraseblocks on dynamic volumes
230 */ 232 */
231enum { 233enum {
232 UBI_PROP_DIRECT_WRITE = 1, 234 UBI_VOL_PROP_DIRECT_WRITE = 1,
233}; 235};
234 236
235/** 237/**
@@ -308,7 +310,7 @@ struct ubi_mkvol_req {
308 __s16 name_len; 310 __s16 name_len;
309 __s8 padding2[4]; 311 __s8 padding2[4];
310 char name[UBI_MAX_VOLUME_NAME + 1]; 312 char name[UBI_MAX_VOLUME_NAME + 1];
311} __attribute__ ((packed)); 313} __packed;
312 314
313/** 315/**
314 * struct ubi_rsvol_req - a data structure used in volume re-size requests. 316 * struct ubi_rsvol_req - a data structure used in volume re-size requests.
@@ -324,7 +326,7 @@ struct ubi_mkvol_req {
324struct ubi_rsvol_req { 326struct ubi_rsvol_req {
325 __s64 bytes; 327 __s64 bytes;
326 __s32 vol_id; 328 __s32 vol_id;
327} __attribute__ ((packed)); 329} __packed;
328 330
329/** 331/**
330 * struct ubi_rnvol_req - volumes re-name request. 332 * struct ubi_rnvol_req - volumes re-name request.
@@ -366,7 +368,7 @@ struct ubi_rnvol_req {
366 __s8 padding2[2]; 368 __s8 padding2[2];
367 char name[UBI_MAX_VOLUME_NAME + 1]; 369 char name[UBI_MAX_VOLUME_NAME + 1];
368 } ents[UBI_MAX_RNVOL]; 370 } ents[UBI_MAX_RNVOL];
369} __attribute__ ((packed)); 371} __packed;
370 372
371/** 373/**
372 * struct ubi_leb_change_req - a data structure used in atomic LEB change 374 * struct ubi_leb_change_req - a data structure used in atomic LEB change
@@ -381,7 +383,7 @@ struct ubi_leb_change_req {
381 __s32 bytes; 383 __s32 bytes;
382 __s8 dtype; 384 __s8 dtype;
383 __s8 padding[7]; 385 __s8 padding[7];
384} __attribute__ ((packed)); 386} __packed;
385 387
386/** 388/**
387 * struct ubi_map_req - a data structure used in map LEB requests. 389 * struct ubi_map_req - a data structure used in map LEB requests.
@@ -393,20 +395,20 @@ struct ubi_map_req {
393 __s32 lnum; 395 __s32 lnum;
394 __s8 dtype; 396 __s8 dtype;
395 __s8 padding[3]; 397 __s8 padding[3];
396} __attribute__ ((packed)); 398} __packed;
397 399
398 400
399/** 401/**
400 * struct ubi_set_prop_req - a data structure used to set an ubi volume 402 * struct ubi_set_vol_prop_req - a data structure used to set an UBI volume
401 * property. 403 * property.
402 * @property: property to set (%UBI_PROP_DIRECT_WRITE) 404 * @property: property to set (%UBI_VOL_PROP_DIRECT_WRITE)
403 * @padding: reserved for future, not used, has to be zeroed 405 * @padding: reserved for future, not used, has to be zeroed
404 * @value: value to set 406 * @value: value to set
405 */ 407 */
406struct ubi_set_prop_req { 408struct ubi_set_vol_prop_req {
407 __u8 property; 409 __u8 property;
408 __u8 padding[7]; 410 __u8 padding[7];
409 __u64 value; 411 __u64 value;
410} __attribute__ ((packed)); 412} __packed;
411 413
412#endif /* __UBI_USER_H__ */ 414#endif /* __UBI_USER_H__ */