• Home
  • Raw
  • Download

Lines Matching refs:bb

1472 static int md_set_badblocks(struct badblocks *bb, sector_t s, int sectors,
1579 u64 bb = le64_to_cpu(*bbp); in super_1_load() local
1580 int count = bb & (0x3ff); in super_1_load()
1581 u64 sector = bb >> 10; in super_1_load()
1584 if (bb + 1 == 0) in super_1_load()
1799 struct badblocks *bb = &rdev->badblocks; in super_1_sync() local
1801 u64 *p = bb->page; in super_1_sync()
1803 if (bb->changed) { in super_1_sync()
1807 seq = read_seqbegin(&bb->lock); in super_1_sync()
1811 for (i = 0 ; i < bb->count ; i++) { in super_1_sync()
1817 bb->changed = 0; in super_1_sync()
1818 if (read_seqretry(&bb->lock, seq)) in super_1_sync()
1821 bb->sector = (rdev->sb_start + in super_1_sync()
1823 bb->size = le16_to_cpu(sb->bblog_size); in super_1_sync()
2983 badblocks_show(struct badblocks *bb, char *page, int unack);
2985 badblocks_store(struct badblocks *bb, const char *page, size_t len, int unack);
7697 int md_is_badblock(struct badblocks *bb, sector_t s, int sectors, in md_is_badblock() argument
7702 u64 *p = bb->page; in md_is_badblock()
7707 if (bb->shift > 0) { in md_is_badblock()
7709 s >>= bb->shift; in md_is_badblock()
7710 target += (1<<bb->shift) - 1; in md_is_badblock()
7711 target >>= bb->shift; in md_is_badblock()
7717 seq = read_seqbegin(&bb->lock); in md_is_badblock()
7720 hi = bb->count; in md_is_badblock()
7763 if (read_seqretry(&bb->lock, seq)) in md_is_badblock()
7777 static int md_set_badblocks(struct badblocks *bb, sector_t s, int sectors, in md_set_badblocks() argument
7784 if (bb->shift < 0) in md_set_badblocks()
7788 if (bb->shift) { in md_set_badblocks()
7791 s >>= bb->shift; in md_set_badblocks()
7792 next += (1<<bb->shift) - 1; in md_set_badblocks()
7793 next >>= bb->shift; in md_set_badblocks()
7797 write_seqlock_irq(&bb->lock); in md_set_badblocks()
7799 p = bb->page; in md_set_badblocks()
7801 hi = bb->count; in md_set_badblocks()
7845 if (sectors && hi < bb->count) { in md_set_badblocks()
7873 if (sectors == 0 && hi < bb->count) { in md_set_badblocks()
7885 (bb->count - hi - 1) * 8); in md_set_badblocks()
7886 bb->count--; in md_set_badblocks()
7892 if (bb->count >= MD_MAX_BADBLOCKS) { in md_set_badblocks()
7899 (bb->count - hi) * 8); in md_set_badblocks()
7900 bb->count++; in md_set_badblocks()
7910 bb->changed = 1; in md_set_badblocks()
7912 bb->unacked_exist = 1; in md_set_badblocks()
7913 write_sequnlock_irq(&bb->lock); in md_set_badblocks()
7939 static int md_clear_badblocks(struct badblocks *bb, sector_t s, int sectors) in md_clear_badblocks() argument
7946 if (bb->shift > 0) { in md_clear_badblocks()
7953 s += (1<<bb->shift) - 1; in md_clear_badblocks()
7954 s >>= bb->shift; in md_clear_badblocks()
7955 target >>= bb->shift; in md_clear_badblocks()
7959 write_seqlock_irq(&bb->lock); in md_clear_badblocks()
7961 p = bb->page; in md_clear_badblocks()
7963 hi = bb->count; in md_clear_badblocks()
7986 if (bb->count >= MD_MAX_BADBLOCKS) { in md_clear_badblocks()
7990 memmove(p+lo+1, p+lo, (bb->count - lo) * 8); in md_clear_badblocks()
7991 bb->count++; in md_clear_badblocks()
8017 memmove(p+lo+1, p+hi, (bb->count - hi) * 8); in md_clear_badblocks()
8018 bb->count -= (hi - lo - 1); in md_clear_badblocks()
8022 bb->changed = 1; in md_clear_badblocks()
8024 write_sequnlock_irq(&bb->lock); in md_clear_badblocks()
8041 void md_ack_all_badblocks(struct badblocks *bb) in md_ack_all_badblocks() argument
8043 if (bb->page == NULL || bb->changed) in md_ack_all_badblocks()
8046 write_seqlock_irq(&bb->lock); in md_ack_all_badblocks()
8048 if (bb->changed == 0 && bb->unacked_exist) { in md_ack_all_badblocks()
8049 u64 *p = bb->page; in md_ack_all_badblocks()
8051 for (i = 0; i < bb->count ; i++) { in md_ack_all_badblocks()
8058 bb->unacked_exist = 0; in md_ack_all_badblocks()
8060 write_sequnlock_irq(&bb->lock); in md_ack_all_badblocks()
8077 badblocks_show(struct badblocks *bb, char *page, int unack) in badblocks_show() argument
8081 u64 *p = bb->page; in badblocks_show()
8084 if (bb->shift < 0) in badblocks_show()
8088 seq = read_seqbegin(&bb->lock); in badblocks_show()
8093 while (len < PAGE_SIZE && i < bb->count) { in badblocks_show()
8103 (unsigned long long)s << bb->shift, in badblocks_show()
8104 length << bb->shift); in badblocks_show()
8107 bb->unacked_exist = 0; in badblocks_show()
8109 if (read_seqretry(&bb->lock, seq)) in badblocks_show()
8118 badblocks_store(struct badblocks *bb, const char *page, size_t len, int unack) in badblocks_store() argument
8148 md_clear_badblocks(bb, sector, length); in badblocks_store()
8152 if (md_set_badblocks(bb, sector, length, !unack)) in badblocks_store()