aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/ubi.h
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2007-12-17 08:42:57 -0500
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2007-12-26 12:15:16 -0500
commitd05c77a816974c09f8c7e8f48e5b9f7b59dafdf3 (patch)
tree6263ef3ad76c654e9d2635e5145f15c2b517edeb /drivers/mtd/ubi/ubi.h
parentdb6e5770ef0ab351a403ac26e1ab1309e58f15d7 (diff)
UBI: introduce volume refcounting
Add ref_count field to UBI volumes and remove weired "vol->removed" field. This way things are better understandable and we do not have to do whold show_attr operation under spinlock. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/ubi.h')
-rw-r--r--drivers/mtd/ubi/ubi.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h
index 69cbee3be7a4..f782d5aa849a 100644
--- a/drivers/mtd/ubi/ubi.h
+++ b/drivers/mtd/ubi/ubi.h
@@ -140,10 +140,10 @@ struct ubi_volume_desc;
140 * @cdev: character device object to create character device 140 * @cdev: character device object to create character device
141 * @ubi: reference to the UBI device description object 141 * @ubi: reference to the UBI device description object
142 * @vol_id: volume ID 142 * @vol_id: volume ID
143 * @ref_count: volume reference count
143 * @readers: number of users holding this volume in read-only mode 144 * @readers: number of users holding this volume in read-only mode
144 * @writers: number of users holding this volume in read-write mode 145 * @writers: number of users holding this volume in read-write mode
145 * @exclusive: whether somebody holds this volume in exclusive mode 146 * @exclusive: whether somebody holds this volume in exclusive mode
146 * @removed: if the volume was removed
147 * @checked: if this static volume was checked 147 * @checked: if this static volume was checked
148 * 148 *
149 * @reserved_pebs: how many physical eraseblocks are reserved for this volume 149 * @reserved_pebs: how many physical eraseblocks are reserved for this volume
@@ -156,7 +156,7 @@ struct ubi_volume_desc;
156 * @corrupted: non-zero if the volume is corrupted (static volumes only) 156 * @corrupted: non-zero if the volume is corrupted (static volumes only)
157 * @alignment: volume alignment 157 * @alignment: volume alignment
158 * @data_pad: how many bytes are not used at the end of physical eraseblocks to 158 * @data_pad: how many bytes are not used at the end of physical eraseblocks to
159 * satisfy the requested alignment 159 * satisfy the requested alignment
160 * @name_len: volume name length 160 * @name_len: volume name length
161 * @name: volume name 161 * @name: volume name
162 * 162 *
@@ -185,10 +185,10 @@ struct ubi_volume {
185 struct cdev cdev; 185 struct cdev cdev;
186 struct ubi_device *ubi; 186 struct ubi_device *ubi;
187 int vol_id; 187 int vol_id;
188 int ref_count;
188 int readers; 189 int readers;
189 int writers; 190 int writers;
190 int exclusive; 191 int exclusive;
191 int removed;
192 int checked; 192 int checked;
193 193
194 int reserved_pebs; 194 int reserved_pebs;
@@ -242,9 +242,9 @@ struct ubi_wl_entry;
242 * @vol_count: number of volumes in this UBI device 242 * @vol_count: number of volumes in this UBI device
243 * @volumes: volumes of this UBI device 243 * @volumes: volumes of this UBI device
244 * @volumes_lock: protects @volumes, @rsvd_pebs, @avail_pebs, beb_rsvd_pebs, 244 * @volumes_lock: protects @volumes, @rsvd_pebs, @avail_pebs, beb_rsvd_pebs,
245 * @beb_rsvd_level, @bad_peb_count, @good_peb_count, @vol_count, @vol->readers, 245 * @beb_rsvd_level, @bad_peb_count, @good_peb_count, @vol_count,
246 * @vol->writers, @vol->exclusive, @vol->removed, @vol->mapping and 246 * @vol->readers, @vol->writers, @vol->exclusive,
247 * @vol->eba_tbl. 247 * @vol->ref_count, @vol->mapping and @vol->eba_tbl.
248 * 248 *
249 * @rsvd_pebs: count of reserved physical eraseblocks 249 * @rsvd_pebs: count of reserved physical eraseblocks
250 * @avail_pebs: count of available physical eraseblocks 250 * @avail_pebs: count of available physical eraseblocks
@@ -273,11 +273,11 @@ struct ubi_wl_entry;
273 * @prot.pnum: protection tree indexed by physical eraseblock numbers 273 * @prot.pnum: protection tree indexed by physical eraseblock numbers
274 * @prot.aec: protection tree indexed by absolute erase counter value 274 * @prot.aec: protection tree indexed by absolute erase counter value
275 * @wl_lock: protects the @used, @free, @prot, @lookuptbl, @abs_ec, @move_from, 275 * @wl_lock: protects the @used, @free, @prot, @lookuptbl, @abs_ec, @move_from,
276 * @move_to, @move_to_put @erase_pending, @wl_scheduled, and @works 276 * @move_to, @move_to_put @erase_pending, @wl_scheduled, and @works
277 * fields 277 * fields
278 * @wl_scheduled: non-zero if the wear-leveling was scheduled 278 * @wl_scheduled: non-zero if the wear-leveling was scheduled
279 * @lookuptbl: a table to quickly find a &struct ubi_wl_entry object for any 279 * @lookuptbl: a table to quickly find a &struct ubi_wl_entry object for any
280 * physical eraseblock 280 * physical eraseblock
281 * @abs_ec: absolute erase counter 281 * @abs_ec: absolute erase counter
282 * @move_from: physical eraseblock from where the data is being moved 282 * @move_from: physical eraseblock from where the data is being moved
283 * @move_to: physical eraseblock where the data is being moved to 283 * @move_to: physical eraseblock where the data is being moved to
@@ -308,13 +308,13 @@ struct ubi_wl_entry;
308 * @hdrs_min_io_size 308 * @hdrs_min_io_size
309 * @vid_hdr_shift: contains @vid_hdr_offset - @vid_hdr_aloffset 309 * @vid_hdr_shift: contains @vid_hdr_offset - @vid_hdr_aloffset
310 * @bad_allowed: whether the MTD device admits of bad physical eraseblocks or 310 * @bad_allowed: whether the MTD device admits of bad physical eraseblocks or
311 * not 311 * not
312 * @mtd: MTD device descriptor 312 * @mtd: MTD device descriptor
313 * 313 *
314 * @peb_buf1: a buffer of PEB size used for different purposes 314 * @peb_buf1: a buffer of PEB size used for different purposes
315 * @peb_buf2: another buffer of PEB size used for different purposes 315 * @peb_buf2: another buffer of PEB size used for different purposes
316 * @buf_mutex: proptects @peb_buf1 and @peb_buf2 316 * @buf_mutex: proptects @peb_buf1 and @peb_buf2
317 * @dbg_peb_buf: buffer of PEB size used for debugging 317 * @dbg_peb_buf: buffer of PEB size used for debugging
318 * @dbg_buf_mutex: proptects @dbg_peb_buf 318 * @dbg_buf_mutex: proptects @dbg_peb_buf
319 */ 319 */
320struct ubi_device { 320struct ubi_device {