Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
f7fc6f3f
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
161
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f7fc6f3f
编写于
1月 07, 2009
作者:
A
Artem Bityutskiy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
UBI: improve ioctl commentaries
Signed-off-by:
N
Artem Bityutskiy
<
Artem.Bityutskiy@nokia.com
>
上级
a27ce8f5
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
62 addition
and
26 deletion
+62
-26
include/mtd/ubi-user.h
include/mtd/ubi-user.h
+62
-26
未找到文件。
include/mtd/ubi-user.h
浏览文件 @
f7fc6f3f
...
...
@@ -40,37 +40,37 @@
* UBI volume creation
* ~~~~~~~~~~~~~~~~~~~
*
* UBI volumes are created via the %UBI_IOCMKVOL
IOCTL
command of UBI character
* UBI volumes are created via the %UBI_IOCMKVOL
ioctl
command of UBI character
* device. A &struct ubi_mkvol_req object has to be properly filled and a
* pointer to it has to be passed to the
IOCTL
.
* pointer to it has to be passed to the
ioctl
.
*
* UBI volume deletion
* ~~~~~~~~~~~~~~~~~~~
*
* To delete a volume, the %UBI_IOCRMVOL
IOCTL
command of the UBI character
* To delete a volume, the %UBI_IOCRMVOL
ioctl
command of the UBI character
* device should be used. A pointer to the 32-bit volume ID hast to be passed
* to the
IOCTL
.
* to the
ioctl
.
*
* UBI volume re-size
* ~~~~~~~~~~~~~~~~~~
*
* To re-size a volume, the %UBI_IOCRSVOL
IOCTL
command of the UBI character
* To re-size a volume, the %UBI_IOCRSVOL
ioctl
command of the UBI character
* device should be used. A &struct ubi_rsvol_req object has to be properly
* filled and a pointer to it has to be passed to the
IOCTL
.
* filled and a pointer to it has to be passed to the
ioctl
.
*
* UBI volumes re-name
* ~~~~~~~~~~~~~~~~~~~
*
* To re-name several volumes atomically at one go, the %UBI_IOCRNVOL command
* of the UBI character device should be used. A &struct ubi_rnvol_req object
* has to be properly filled and a pointer to it has to be passed to the
IOCTL
.
* has to be properly filled and a pointer to it has to be passed to the
ioctl
.
*
* UBI volume update
* ~~~~~~~~~~~~~~~~~
*
* Volume update should be done via the %UBI_IOCVOLUP
IOCTL
command of the
* Volume update should be done via the %UBI_IOCVOLUP
ioctl
command of the
* corresponding UBI volume character device. A pointer to a 64-bit update
* size should be passed to the
IOCTL
. After this, UBI expects user to write
* size should be passed to the
ioctl
. After this, UBI expects user to write
* this number of bytes to the volume character device. The update is finished
* when the claimed number of bytes is passed. So, the volume update sequence
* is something like:
...
...
@@ -80,14 +80,50 @@
* write(fd, buf, image_size);
* close(fd);
*
*
Atomic eraseblock chang
e
*
Logical eraseblock eras
e
* ~~~~~~~~~~~~~~~~~~~~~~~~
*
* Atomic eraseblock change operation is done via the %UBI_IOCEBCH IOCTL
* command of the corresponding UBI volume character device. A pointer to
* &struct ubi_leb_change_req has to be passed to the IOCTL. Then the user is
* expected to write the requested amount of bytes. This is similar to the
* "volume update" IOCTL.
* To erase a logical eraseblock, the %UBI_IOCEBER ioctl command of the
* corresponding UBI volume character device should be used. This command
* unmaps the requested logical eraseblock, makes sure the corresponding
* physical eraseblock is successfully erased, and returns.
*
* Atomic logical eraseblock change
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* Atomic logical eraseblock change operation is called using the %UBI_IOCEBCH
* ioctl command of the corresponding UBI volume character device. A pointer to
* a &struct ubi_leb_change_req object has to be passed to the ioctl. Then the
* user is expected to write the requested amount of bytes (similarly to what
* should be done in case of the "volume update" ioctl).
*
* Logical eraseblock map
* ~~~~~~~~~~~~~~~~~~~~~
*
* To map a logical eraseblock to a physical eraseblock, the %UBI_IOCEBMAP
* ioctl command should be used. A pointer to a &struct ubi_map_req object is
* expected to be passed. The ioctl maps the requested logical eraseblock to
* a physical eraseblock and returns. Only non-mapped logical eraseblocks can
* be mapped. If the logical eraseblock specified in the request is already
* mapped to a physical eraseblock, the ioctl fails and returns error.
*
* Logical eraseblock unmap
* ~~~~~~~~~~~~~~~~~~~~~~~~
*
* To unmap a logical eraseblock to a physical eraseblock, the %UBI_IOCEBUNMAP
* ioctl command should be used. The ioctl unmaps the logical eraseblocks,
* schedules corresponding physical eraseblock for erasure, and returns. Unlike
* the "LEB erase" command, it does not wait for the physical eraseblock being
* erased. Note, the side effect of this is that if an unclean reboot happens
* after the unmap ioctl returns, you may find the LEB mapped again to the same
* physical eraseblock after the UBI is run again.
*
* Check if logical eraseblock is mapped
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* To check if a logical eraseblock is mapped to a physical eraseblock, the
* %UBI_IOCEBISMAP ioctl command should be used. It returns %0 if the LEB is
* not mapped, and %1 if it is mapped.
*/
/*
...
...
@@ -101,7 +137,7 @@
/* Maximum volume name length */
#define UBI_MAX_VOLUME_NAME 127
/*
IOCTL
commands of UBI character devices */
/*
ioctl
commands of UBI character devices */
#define UBI_IOC_MAGIC 'o'
...
...
@@ -114,7 +150,7 @@
/* Re-name volumes */
#define UBI_IOCRNVOL _IOW(UBI_IOC_MAGIC, 3, struct ubi_rnvol_req)
/*
IOCTL
commands of the UBI control character device */
/*
ioctl
commands of the UBI control character device */
#define UBI_CTRL_IOC_MAGIC 'o'
...
...
@@ -123,21 +159,21 @@
/* Detach an MTD device */
#define UBI_IOCDET _IOW(UBI_CTRL_IOC_MAGIC, 65, int32_t)
/*
IOCTL
commands of UBI volume character devices */
/*
ioctl
commands of UBI volume character devices */
#define UBI_VOL_IOC_MAGIC 'O'
/* Start UBI volume update */
#define UBI_IOCVOLUP _IOW(UBI_VOL_IOC_MAGIC, 0, int64_t)
/*
An eraseblock
erasure command, used for debugging, disabled by default */
/*
LEB
erasure command, used for debugging, disabled by default */
#define UBI_IOCEBER _IOW(UBI_VOL_IOC_MAGIC, 1, int32_t)
/* A
n atomic eraseblock
change command */
/* A
tomic LEB
change command */
#define UBI_IOCEBCH _IOW(UBI_VOL_IOC_MAGIC, 2, int32_t)
/* Map
an eraseblock, used for debugging, disabled by default
*/
/* Map
LEB command
*/
#define UBI_IOCEBMAP _IOW(UBI_VOL_IOC_MAGIC, 3, struct ubi_map_req)
/* Unmap
an eraseblock, used for debugging, disabled by default
*/
/* Unmap
LEB command
*/
#define UBI_IOCEBUNMAP _IOW(UBI_VOL_IOC_MAGIC, 4, int32_t)
/* Check if
an eraseblock is mapped, used for debugging, disabled by default
*/
/* Check if
LEB is mapped command
*/
#define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, int32_t)
/* Maximum MTD device name length supported by UBI */
...
...
@@ -311,8 +347,8 @@ struct ubi_rnvol_req {
}
__attribute__
((
packed
));
/**
* struct ubi_leb_change_req - a data structure used in atomic
logical
*
eraseblock change
requests.
* struct ubi_leb_change_req - a data structure used in atomic
LEB change
* requests.
* @lnum: logical eraseblock number to change
* @bytes: how many bytes will be written to the logical eraseblock
* @dtype: data type (%UBI_LONGTERM, %UBI_SHORTTERM, %UBI_UNKNOWN)
...
...
@@ -326,7 +362,7 @@ struct ubi_leb_change_req {
}
__attribute__
((
packed
));
/**
* struct ubi_map_req - a data structure used in map
eraseblock
requests.
* struct ubi_map_req - a data structure used in map
LEB
requests.
* @lnum: logical eraseblock number to unmap
* @dtype: data type (%UBI_LONGTERM, %UBI_SHORTTERM, %UBI_UNKNOWN)
* @padding: reserved for future, not used, has to be zeroed
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录