udf_get_last_block decrement redundant maybe
Subsystems (3)
PATCH 1/1 udf_get_last_block decrement redundant maybe
Ben F:
Please dis/agree the following is a small correction. I ask because,
I see ioctl CDROM_LAST_WRITTEN dynamically calls cdrom_get_last_written of drivers/cdrom/cdrom.c.
I see cdrom_get_last_written gets its idea of max LBA from such places as the ti.last_rec_address, which is an LBA written, not the LBA beyond, i.e. is already the count of blocks written minus one, with no further decrement required.
I see removing the udf_get_last_block decrement lets udf_find_anchor(sb) work with an "AVDPs at N-256, N" UDF disc if only I also insert, beforehand:
UDF_SB_LASTBLOCK(sb) = udf_get_last_block(sb);
Pat LaVarre
fs/udf/lowlevel.c +1 -1
@@ -76,8 +76,8 @@ udf_get_last_block(struct super_block *sif (ioctl_by_bdev (bdev,CDROM_LAST_WRITTEN , (unsigned long ) &lblock)) lblock = bdev->bd_inode->i_size >> sb->s_blocksize_bits;if (lblock) -return lblock -1 ; +return lblock;else return 0 ; }