eba.c (2d78aee426d821bbecbc80ee96ada5730ee68b6f) eba.c (7554769641da272ea8821194c2efda08a11014b0)
1/*
2 * Copyright (c) International Business Machines Corp., 2006
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *

--- 298 unchanged lines hidden (view full) ---

307 if (le->users == 0) {
308 rb_erase(&le->rb, &ubi->ltree);
309 kfree(le);
310 }
311 spin_unlock(&ubi->ltree_lock);
312}
313
314/**
1/*
2 * Copyright (c) International Business Machines Corp., 2006
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *

--- 298 unchanged lines hidden (view full) ---

307 if (le->users == 0) {
308 rb_erase(&le->rb, &ubi->ltree);
309 kfree(le);
310 }
311 spin_unlock(&ubi->ltree_lock);
312}
313
314/**
315 * ubi_eba_is_mapped - check if a LEB is mapped.
316 * @vol: volume description object
317 * @lnum: logical eraseblock number
318 *
319 * This function returns true if the LEB is mapped, false otherwise.
320 */
321bool ubi_eba_is_mapped(struct ubi_volume *vol, int lnum)
322{
323 return vol->eba_tbl[lnum] >= 0;
324}
325
326/**
315 * ubi_eba_unmap_leb - un-map logical eraseblock.
316 * @ubi: UBI device description object
317 * @vol: volume description object
318 * @lnum: logical eraseblock number
319 *
320 * This function un-maps logical eraseblock @lnum and schedules corresponding
321 * physical eraseblock for erasure. Returns zero in case of success and a
322 * negative error code in case of failure.

--- 1123 unchanged lines hidden ---
327 * ubi_eba_unmap_leb - un-map logical eraseblock.
328 * @ubi: UBI device description object
329 * @vol: volume description object
330 * @lnum: logical eraseblock number
331 *
332 * This function un-maps logical eraseblock @lnum and schedules corresponding
333 * physical eraseblock for erasure. Returns zero in case of success and a
334 * negative error code in case of failure.

--- 1123 unchanged lines hidden ---