#include <linux/mutex.h>
#include "exfat.h"
-#define LOCKBIT 0x01
-#define DIRTYBIT 0x02
-
/* Local variables */
static DEFINE_MUTEX(f_mutex);
static DEFINE_MUTEX(b_mutex);
for (i = 0; i < FAT_CACHE_SIZE; i++) {
p_fs->FAT_cache_array[i].drv = -1;
p_fs->FAT_cache_array[i].sec = ~0;
- p_fs->FAT_cache_array[i].flag = 0;
+ p_fs->FAT_cache_array[i].locked = false;
p_fs->FAT_cache_array[i].buf_bh = NULL;
p_fs->FAT_cache_array[i].prev = NULL;
p_fs->FAT_cache_array[i].next = NULL;
for (i = 0; i < BUF_CACHE_SIZE; i++) {
p_fs->buf_cache_array[i].drv = -1;
p_fs->buf_cache_array[i].sec = ~0;
- p_fs->buf_cache_array[i].flag = 0;
+ p_fs->buf_cache_array[i].locked = false;
p_fs->buf_cache_array[i].buf_bh = NULL;
p_fs->buf_cache_array[i].prev = NULL;
p_fs->buf_cache_array[i].next = NULL;
bp->drv = p_fs->drv;
bp->sec = sec;
- bp->flag = 0;
+ bp->locked = false;
FAT_cache_insert_hash(sb, bp);
FAT_cache_remove_hash(bp);
bp->drv = -1;
bp->sec = ~0;
- bp->flag = 0;
+ bp->locked = false;
bp->buf_bh = NULL;
move_to_lru(bp, &p_fs->FAT_cache_lru_list);
if (bp->drv == p_fs->drv) {
bp->drv = -1;
bp->sec = ~0;
- bp->flag = 0;
+ bp->locked = false;
if (bp->buf_bh) {
__brelse(bp->buf_bh);
struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info);
bp = p_fs->buf_cache_lru_list.prev;
- while (bp->flag & LOCKBIT)
+ while (bp->locked)
bp = bp->prev;
move_to_mru(bp, &p_fs->buf_cache_lru_list);
bp->drv = p_fs->drv;
bp->sec = sec;
- bp->flag = 0;
+ bp->locked = false;
buf_cache_insert_hash(sb, bp);
buf_cache_remove_hash(bp);
bp->drv = -1;
bp->sec = ~0;
- bp->flag = 0;
+ bp->locked = false;
bp->buf_bh = NULL;
move_to_lru(bp, &p_fs->buf_cache_lru_list);
bp = buf_cache_find(sb, sec);
if (likely(bp))
- bp->flag |= LOCKBIT;
+ bp->locked = true;
WARN(!bp, "[EXFAT] failed to find buffer_cache(sector:%llu).\n",
(unsigned long long)sec);
bp = buf_cache_find(sb, sec);
if (likely(bp))
- bp->flag &= ~(LOCKBIT);
+ bp->locked = false;
WARN(!bp, "[EXFAT] failed to find buffer_cache(sector:%llu).\n",
(unsigned long long)sec);
if (likely(bp)) {
bp->drv = -1;
bp->sec = ~0;
- bp->flag = 0;
+ bp->locked = false;
if (bp->buf_bh) {
__brelse(bp->buf_bh);
if (bp->drv == p_fs->drv) {
bp->drv = -1;
bp->sec = ~0;
- bp->flag = 0;
+ bp->locked = false;
if (bp->buf_bh) {
__brelse(bp->buf_bh);