电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

UBIFS分析二:重要结构体VIP免费

UBIFS分析二:重要结构体_第1页
1/9
UBIFS分析二:重要结构体_第2页
2/9
UBIFS分析二:重要结构体_第3页
3/9
UBIFS 中的重要的结构体 用leeming 的话来说,一个大的工程中,最最核心的往往是数据结构体的定义。所以看代码不急着看 c 文件,而是主要看 document 和 h 文件,来理解设计者的思路,这样才能走对路。 1. struct ubi_device UBI 中对于一个UBI 设备的抽象是以 struct ubi_device 来定义,其中包括了该 UBI 设备的各种信息。 struct ubi_device { struct cdev cdev; struct device dev; int ubi_num;//UBI 设备的标号,在 ubiattach 用户程序时以-d 选项来输入 char ubi_name[sizeof(UBI_NAME_STR)+5];//ubi 设备的名称 int vol_count;//在该 UBI 设备中有多少个volume struct ubi_volume *volumes[UBI_MAX_VOLUMES+UBI_INT_VOL_COUNT]; spinlock_t volumes_lock; int ref_count; int image_seq; int rsvd_pebs;//保留的LEB 数目 int avail_pebs;//可用的LEB 数目 int beb_rsvd_pebs;//为坏块处理而保留的LEB 数目 int beb_rsvd_level;//为坏块处理而保留的LEB 的正常数目 int autoresize_vol_id; int vtbl_slots; int vtbl_size;//volume 表的大小(bytes) struct ubi_vtbl_record *vtbl;//内存中volume 表的拷贝 struct mutex device_mutex; int max_ec;//最大的erase counter /* Note, mean_ec is not updated run-time - should be fixed */ int mean_ec;//平均 erase counter /* EBA sub-system's stuff */ unsigned long long global_sqnum; spinlock_t ltree_lock; struct rb_root ltree; struct mutex alc_mutex; /* Wear-leveling sub-system's stuff */ struct rb_root used;//一个红黑树,其中是已用的blcok struct rb_root erroneous;// RB-tree of erroneous used physical eraseblocks struct rb_root free;//红黑树的根,其中是没有用到的block struct rb_root scrub;//需要擦除的blcok struct list_head pq[UBI_PROT_QUEUE_LEN]; int pq_head; spinlock_t wl_lock; struct mutex move_mutex; struct rw_semaphore work_sem; int wl_scheduled; struct ubi_wl_entry **lookuptbl;// a table to quickly find a &struct ubi_wl_entry object for any physical eraseblock,,一个struct ubi_wl_entry 类型的数组,以pnum 为下标,记录该UBI 设备的每...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

UBIFS分析二:重要结构体

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部