kapi.c (9a5f09ac0ab83e4a965a24edd6cf7cb0303c6dc9) | kapi.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 * --- 708 unchanged lines hidden (view full) --- 717 return -EROFS; 718 719 if (!ubi_leb_valid(vol, lnum)) 720 return -EINVAL; 721 722 if (vol->upd_marker) 723 return -EBADF; 724 | 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 * --- 708 unchanged lines hidden (view full) --- 717 return -EROFS; 718 719 if (!ubi_leb_valid(vol, lnum)) 720 return -EINVAL; 721 722 if (vol->upd_marker) 723 return -EBADF; 724 |
725 if (vol->eba_tbl[lnum] >= 0) | 725 if (ubi_eba_is_mapped(vol, lnum)) |
726 return -EBADMSG; 727 728 return ubi_eba_write_leb(ubi, vol, lnum, NULL, 0, 0); 729} 730EXPORT_SYMBOL_GPL(ubi_leb_map); 731 732/** 733 * ubi_is_mapped - check if logical eraseblock is mapped. --- 18 unchanged lines hidden (view full) --- 752 dbg_gen("test LEB %d:%d", vol->vol_id, lnum); 753 754 if (!ubi_leb_valid(vol, lnum)) 755 return -EINVAL; 756 757 if (vol->upd_marker) 758 return -EBADF; 759 | 726 return -EBADMSG; 727 728 return ubi_eba_write_leb(ubi, vol, lnum, NULL, 0, 0); 729} 730EXPORT_SYMBOL_GPL(ubi_leb_map); 731 732/** 733 * ubi_is_mapped - check if logical eraseblock is mapped. --- 18 unchanged lines hidden (view full) --- 752 dbg_gen("test LEB %d:%d", vol->vol_id, lnum); 753 754 if (!ubi_leb_valid(vol, lnum)) 755 return -EINVAL; 756 757 if (vol->upd_marker) 758 return -EBADF; 759 |
760 return vol->eba_tbl[lnum] >= 0; | 760 return ubi_eba_is_mapped(vol, lnum); |
761} 762EXPORT_SYMBOL_GPL(ubi_is_mapped); 763 764/** 765 * ubi_sync - synchronize UBI device buffers. 766 * @ubi_num: UBI device to synchronize 767 * 768 * The underlying MTD device may cache data in hardware or in software. This --- 99 unchanged lines hidden --- | 761} 762EXPORT_SYMBOL_GPL(ubi_is_mapped); 763 764/** 765 * ubi_sync - synchronize UBI device buffers. 766 * @ubi_num: UBI device to synchronize 767 * 768 * The underlying MTD device may cache data in hardware or in software. This --- 99 unchanged lines hidden --- |