Source
243
243
244
244
int affs_init_bitmap(struct super_block *sb, int *flags)
245
245
{
246
246
struct affs_bm_info *bm;
247
247
struct buffer_head *bmap_bh = NULL, *bh = NULL;
248
248
__be32 *bmap_blk;
249
249
u32 size, blk, end, offset, mask;
250
250
int i, res = 0;
251
251
struct affs_sb_info *sbi = AFFS_SB(sb);
252
252
253
-
if (*flags & MS_RDONLY)
253
+
if (*flags & SB_RDONLY)
254
254
return 0;
255
255
256
256
if (!AFFS_ROOT_TAIL(sb, sbi->s_root_bh)->bm_flag) {
257
257
pr_notice("Bitmap invalid - mounting %s read only\n", sb->s_id);
258
-
*flags |= MS_RDONLY;
258
+
*flags |= SB_RDONLY;
259
259
return 0;
260
260
}
261
261
262
262
sbi->s_last_bmap = ~0;
263
263
sbi->s_bmap_bh = NULL;
264
264
sbi->s_bmap_bits = sb->s_blocksize * 8 - 32;
265
265
sbi->s_bmap_count = (sbi->s_partition_size - sbi->s_reserved +
266
266
sbi->s_bmap_bits - 1) / sbi->s_bmap_bits;
267
267
size = sbi->s_bmap_count * sizeof(*bm);
268
268
bm = sbi->s_bitmap = kzalloc(size, GFP_KERNEL);
281
281
bm->bm_key = be32_to_cpu(bmap_blk[blk]);
282
282
bh = affs_bread(sb, bm->bm_key);
283
283
if (!bh) {
284
284
pr_err("Cannot read bitmap\n");
285
285
res = -EIO;
286
286
goto out;
287
287
}
288
288
if (affs_checksum_block(sb, bh)) {
289
289
pr_warn("Bitmap %u invalid - mounting %s read only.\n",
290
290
bm->bm_key, sb->s_id);
291
-
*flags |= MS_RDONLY;
291
+
*flags |= SB_RDONLY;
292
292
goto out;
293
293
}
294
294
pr_debug("read bitmap block %d: %d\n", blk, bm->bm_key);
295
295
bm->bm_free = memweight(bh->b_data + 4, sb->s_blocksize - 4);
296
296
297
297
/* Don't try read the extension if this is the last block,
298
298
* but we also need the right bm pointer below
299
299
*/
300
300
if (++blk < end || i == 1)
301
301
continue;