@@ -198,7 +198,7 @@ static int find_lnx1_partitions(struct parsed_partitions *state,
198
198
char name [],
199
199
union label_t * label ,
200
200
sector_t labelsect ,
201
- loff_t i_size ,
201
+ sector_t nr_sectors ,
202
202
dasd_information2_t * info )
203
203
{
204
204
loff_t offset , geo_size , size ;
@@ -213,14 +213,14 @@ static int find_lnx1_partitions(struct parsed_partitions *state,
213
213
} else {
214
214
/*
215
215
* Formated w/o large volume support. If the sanity check
216
- * 'size based on geo == size based on i_size ' is true, then
216
+ * 'size based on geo == size based on nr_sectors ' is true, then
217
217
* we can safely assume that we know the formatted size of
218
218
* the disk, otherwise we need additional information
219
219
* that we can only get from a real DASD device.
220
220
*/
221
221
geo_size = geo -> cylinders * geo -> heads
222
222
* geo -> sectors * secperblk ;
223
- size = i_size >> 9 ;
223
+ size = nr_sectors ;
224
224
if (size != geo_size ) {
225
225
if (!info ) {
226
226
strlcat (state -> pp_buf , "\n" , PAGE_SIZE );
@@ -229,7 +229,7 @@ static int find_lnx1_partitions(struct parsed_partitions *state,
229
229
if (!strcmp (info -> type , "ECKD" ))
230
230
if (geo_size < size )
231
231
size = geo_size ;
232
- /* else keep size based on i_size */
232
+ /* else keep size based on nr_sectors */
233
233
}
234
234
}
235
235
/* first and only partition starts in the first block after the label */
@@ -293,7 +293,8 @@ int ibm_partition(struct parsed_partitions *state)
293
293
struct gendisk * disk = state -> disk ;
294
294
struct block_device * bdev = disk -> part0 ;
295
295
int blocksize , res ;
296
- loff_t i_size , offset , size ;
296
+ loff_t offset , size ;
297
+ sector_t nr_sectors ;
297
298
dasd_information2_t * info ;
298
299
struct hd_geometry * geo ;
299
300
char type [5 ] = {0 ,};
@@ -308,8 +309,8 @@ int ibm_partition(struct parsed_partitions *state)
308
309
blocksize = bdev_logical_block_size (bdev );
309
310
if (blocksize <= 0 )
310
311
goto out_symbol ;
311
- i_size = i_size_read (bdev -> bd_inode );
312
- if (i_size == 0 )
312
+ nr_sectors = bdev_nr_sectors (bdev );
313
+ if (nr_sectors == 0 )
313
314
goto out_symbol ;
314
315
info = kmalloc (sizeof (dasd_information2_t ), GFP_KERNEL );
315
316
if (info == NULL )
@@ -336,7 +337,7 @@ int ibm_partition(struct parsed_partitions *state)
336
337
label );
337
338
} else if (!strncmp (type , "LNX1" , 4 )) {
338
339
res = find_lnx1_partitions (state , geo , blocksize , name ,
339
- label , labelsect , i_size ,
340
+ label , labelsect , nr_sectors ,
340
341
info );
341
342
} else if (!strncmp (type , "CMS1" , 4 )) {
342
343
res = find_cms1_partitions (state , geo , blocksize , name ,
@@ -353,7 +354,7 @@ int ibm_partition(struct parsed_partitions *state)
353
354
res = 1 ;
354
355
if (info -> format == DASD_FORMAT_LDL ) {
355
356
strlcat (state -> pp_buf , "(nonl)" , PAGE_SIZE );
356
- size = i_size >> 9 ;
357
+ size = nr_sectors ;
357
358
offset = (info -> label_block + 1 ) * (blocksize >> 9 );
358
359
put_partition (state , 1 , offset , size - offset );
359
360
strlcat (state -> pp_buf , "\n" , PAGE_SIZE );
0 commit comments