Lines Matching refs:sectors
537 sector_t sectors = bad->len; in can_merge_behind() local
542 ((s + sectors) >= BB_OFFSET(p[behind])) && in can_merge_behind()
557 sector_t sectors = bad->len; in behind_merge() local
563 WARN_ON((s + sectors) < BB_OFFSET(p[behind])); in behind_merge()
599 sector_t sectors = bad->len; in front_merge() local
607 merged = min_t(sector_t, sectors, BB_END(p[prev]) - s); in front_merge()
609 merged = min_t(sector_t, sectors, BB_MAX_LEN - BB_LEN(p[prev])); in front_merge()
859 static int _badblocks_set(struct badblocks *bb, sector_t s, int sectors, in _badblocks_set() argument
875 if (sectors == 0) in _badblocks_set()
881 sector_t next = s + sectors; in _badblocks_set()
885 sectors = next - s; in _badblocks_set()
891 orig_len = sectors; in _badblocks_set()
897 bad.len = sectors; in _badblocks_set()
957 BB_END(p[prev]) - s, sectors); in _badblocks_set()
987 ((s + sectors) >= BB_END(p[prev + 1]))) { in _badblocks_set()
994 len = sectors; in _badblocks_set()
1013 sectors -= len; in _badblocks_set()
1015 if (sectors > 0) in _badblocks_set()
1018 WARN_ON(sectors < 0); in _badblocks_set()
1042 sectors = orig_len; in _badblocks_set()
1076 sector_t sectors = bad->len; in front_clear() local
1083 if (BB_LEN(p[prev]) > sectors) { in front_clear()
1084 p[prev] = BB_MAKE(BB_OFFSET(p[prev]) + sectors, in front_clear()
1085 BB_LEN(p[prev]) - sectors, in front_clear()
1087 cleared = sectors; in front_clear()
1097 if (BB_END(p[prev]) <= (s + sectors)) { in front_clear()
1122 sector_t sectors = bad->len; in front_splitting_clear() local
1129 p[prev + 1] = BB_MAKE(s + sectors, end - s - sectors, ack); in front_splitting_clear()
1130 return sectors; in front_splitting_clear()
1134 static int _badblocks_clear(struct badblocks *bb, sector_t s, int sectors) in _badblocks_clear() argument
1146 if (sectors == 0) in _badblocks_clear()
1159 target = s + sectors; in _badblocks_clear()
1162 sectors = target - s; in _badblocks_clear()
1172 bad.len = sectors; in _badblocks_clear()
1175 len = sectors; in _badblocks_clear()
1189 len = sectors; in _badblocks_clear()
1201 len = sectors; in _badblocks_clear()
1208 (BB_END(p[prev]) > (bad.start + sectors))) { in _badblocks_clear()
1209 len = sectors; in _badblocks_clear()
1223 len = sectors; in _badblocks_clear()
1247 len = sectors; in _badblocks_clear()
1253 sectors -= len; in _badblocks_clear()
1255 if (sectors > 0) in _badblocks_clear()
1258 WARN_ON(sectors < 0); in _badblocks_clear()
1274 static int _badblocks_check(struct badblocks *bb, sector_t s, int sectors, in _badblocks_check() argument
1284 WARN_ON(bb->shift < 0 || sectors == 0); in _badblocks_check()
1290 target = s + sectors; in _badblocks_check()
1293 sectors = target - s; in _badblocks_check()
1305 bad.len = sectors; in _badblocks_check()
1308 len = sectors; in _badblocks_check()
1317 len = sectors; in _badblocks_check()
1328 if (BB_END(p[prev]) >= (s + sectors)) in _badblocks_check()
1329 len = sectors; in _badblocks_check()
1349 len = sectors; in _badblocks_check()
1353 sectors -= len; in _badblocks_check()
1355 if (sectors > 0) in _badblocks_check()
1358 WARN_ON(sectors < 0); in _badblocks_check()
1407 int badblocks_check(struct badblocks *bb, sector_t s, int sectors, in badblocks_check() argument
1410 return _badblocks_check(bb, s, sectors, first_bad, bad_sectors); in badblocks_check()
1429 int badblocks_set(struct badblocks *bb, sector_t s, int sectors, in badblocks_set() argument
1432 return _badblocks_set(bb, s, sectors, acknowledged); in badblocks_set()
1450 int badblocks_clear(struct badblocks *bb, sector_t s, int sectors) in badblocks_clear() argument
1452 return _badblocks_clear(bb, s, sectors); in badblocks_clear()