diff options
Diffstat (limited to 'fs/udf/lowlevel.c')
-rw-r--r-- | fs/udf/lowlevel.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/fs/udf/lowlevel.c b/fs/udf/lowlevel.c index 084216107667..4826c3616eef 100644 --- a/fs/udf/lowlevel.c +++ b/fs/udf/lowlevel.c | |||
@@ -26,43 +26,38 @@ | |||
26 | #include <linux/udf_fs.h> | 26 | #include <linux/udf_fs.h> |
27 | #include "udf_sb.h" | 27 | #include "udf_sb.h" |
28 | 28 | ||
29 | unsigned int | 29 | unsigned int udf_get_last_session(struct super_block *sb) |
30 | udf_get_last_session(struct super_block *sb) | ||
31 | { | 30 | { |
32 | struct cdrom_multisession ms_info; | 31 | struct cdrom_multisession ms_info; |
33 | unsigned int vol_desc_start; | 32 | unsigned int vol_desc_start; |
34 | struct block_device *bdev = sb->s_bdev; | 33 | struct block_device *bdev = sb->s_bdev; |
35 | int i; | 34 | int i; |
36 | 35 | ||
37 | vol_desc_start=0; | 36 | vol_desc_start = 0; |
38 | ms_info.addr_format=CDROM_LBA; | 37 | ms_info.addr_format = CDROM_LBA; |
39 | i = ioctl_by_bdev(bdev, CDROMMULTISESSION, (unsigned long) &ms_info); | 38 | i = ioctl_by_bdev(bdev, CDROMMULTISESSION, (unsigned long)&ms_info); |
40 | 39 | ||
41 | #define WE_OBEY_THE_WRITTEN_STANDARDS 1 | 40 | #define WE_OBEY_THE_WRITTEN_STANDARDS 1 |
42 | 41 | ||
43 | if (i == 0) | 42 | if (i == 0) { |
44 | { | ||
45 | udf_debug("XA disk: %s, vol_desc_start=%d\n", | 43 | udf_debug("XA disk: %s, vol_desc_start=%d\n", |
46 | (ms_info.xa_flag ? "yes" : "no"), ms_info.addr.lba); | 44 | (ms_info.xa_flag ? "yes" : "no"), ms_info.addr.lba); |
47 | #if WE_OBEY_THE_WRITTEN_STANDARDS | 45 | #if WE_OBEY_THE_WRITTEN_STANDARDS |
48 | if (ms_info.xa_flag) /* necessary for a valid ms_info.addr */ | 46 | if (ms_info.xa_flag) /* necessary for a valid ms_info.addr */ |
49 | #endif | 47 | #endif |
50 | vol_desc_start = ms_info.addr.lba; | 48 | vol_desc_start = ms_info.addr.lba; |
51 | } | 49 | } else { |
52 | else | ||
53 | { | ||
54 | udf_debug("CDROMMULTISESSION not supported: rc=%d\n", i); | 50 | udf_debug("CDROMMULTISESSION not supported: rc=%d\n", i); |
55 | } | 51 | } |
56 | return vol_desc_start; | 52 | return vol_desc_start; |
57 | } | 53 | } |
58 | 54 | ||
59 | unsigned long | 55 | unsigned long udf_get_last_block(struct super_block *sb) |
60 | udf_get_last_block(struct super_block *sb) | ||
61 | { | 56 | { |
62 | struct block_device *bdev = sb->s_bdev; | 57 | struct block_device *bdev = sb->s_bdev; |
63 | unsigned long lblock = 0; | 58 | unsigned long lblock = 0; |
64 | 59 | ||
65 | if (ioctl_by_bdev(bdev, CDROM_LAST_WRITTEN, (unsigned long) &lblock)) | 60 | if (ioctl_by_bdev(bdev, CDROM_LAST_WRITTEN, (unsigned long)&lblock)) |
66 | lblock = bdev->bd_inode->i_size >> sb->s_blocksize_bits; | 61 | lblock = bdev->bd_inode->i_size >> sb->s_blocksize_bits; |
67 | 62 | ||
68 | if (lblock) | 63 | if (lblock) |