@@ -49,7 +49,7 @@ MODULE_LICENSE("GPL");
4949static mode_t udf_convert_permissions (struct fileEntry * );
5050static int udf_update_inode (struct inode * , int );
5151static void udf_fill_inode (struct inode * , struct buffer_head * );
52- static struct buffer_head * inode_getblk (struct inode * , long , int * ,
52+ static struct buffer_head * inode_getblk (struct inode * , sector_t , int * ,
5353 long * , int * );
5454static int8_t udf_insert_aext (struct inode * , kernel_lb_addr , int ,
5555 kernel_lb_addr , uint32_t , struct buffer_head * );
@@ -354,7 +354,7 @@ udf_getblk(struct inode *inode, long block, int create, int *err)
354354 return NULL ;
355355}
356356
357- static struct buffer_head * inode_getblk (struct inode * inode , long block ,
357+ static struct buffer_head * inode_getblk (struct inode * inode , sector_t block ,
358358 int * err , long * phys , int * new )
359359{
360360 struct buffer_head * pbh = NULL , * cbh = NULL , * nbh = NULL , * result = NULL ;
@@ -364,14 +364,15 @@ static struct buffer_head * inode_getblk(struct inode * inode, long block,
364364 uint32_t elen = 0 ;
365365 kernel_lb_addr eloc , pbloc , cbloc , nbloc ;
366366 int c = 1 ;
367- uint64_t lbcount = 0 , b_off = 0 ;
368- uint32_t newblocknum , newblock , offset = 0 ;
367+ loff_t lbcount = 0 , b_off = 0 ;
368+ uint32_t newblocknum , newblock ;
369+ sector_t offset = 0 ;
369370 int8_t etype ;
370371 int goal = 0 , pgoal = UDF_I_LOCATION (inode ).logicalBlockNum ;
371372 char lastblock = 0 ;
372373
373374 pextoffset = cextoffset = nextoffset = udf_file_entry_alloc_offset (inode );
374- b_off = (uint64_t )block << inode -> i_sb -> s_blocksize_bits ;
375+ b_off = (loff_t )block << inode -> i_sb -> s_blocksize_bits ;
375376 pbloc = cbloc = nbloc = UDF_I_LOCATION (inode );
376377
377378 /* find the extent which contains the block we are looking for.
@@ -1948,10 +1949,10 @@ int8_t udf_delete_aext(struct inode *inode, kernel_lb_addr nbloc, int nextoffset
19481949 return (elen >> 30 );
19491950}
19501951
1951- int8_t inode_bmap (struct inode * inode , int block , kernel_lb_addr * bloc , uint32_t * extoffset ,
1952- kernel_lb_addr * eloc , uint32_t * elen , uint32_t * offset , struct buffer_head * * bh )
1952+ int8_t inode_bmap (struct inode * inode , sector_t block , kernel_lb_addr * bloc , uint32_t * extoffset ,
1953+ kernel_lb_addr * eloc , uint32_t * elen , sector_t * offset , struct buffer_head * * bh )
19531954{
1954- uint64_t lbcount = 0 , bcount = (uint64_t )block << inode -> i_sb -> s_blocksize_bits ;
1955+ loff_t lbcount = 0 , bcount = (loff_t )block << inode -> i_sb -> s_blocksize_bits ;
19551956 int8_t etype ;
19561957
19571958 if (block < 0 )
@@ -1968,29 +1969,30 @@ int8_t inode_bmap(struct inode *inode, int block, kernel_lb_addr *bloc, uint32_t
19681969 {
19691970 if ((etype = udf_next_aext (inode , bloc , extoffset , eloc , elen , bh , 1 )) == -1 )
19701971 {
1971- * offset = bcount - lbcount ;
1972+ * offset = ( bcount - lbcount ) >> inode -> i_sb -> s_blocksize_bits ;
19721973 UDF_I_LENEXTENTS (inode ) = lbcount ;
19731974 return -1 ;
19741975 }
19751976 lbcount += * elen ;
19761977 } while (lbcount <= bcount );
19771978
1978- * offset = bcount + * elen - lbcount ;
1979+ * offset = ( bcount + * elen - lbcount ) >> inode -> i_sb -> s_blocksize_bits ;
19791980
19801981 return etype ;
19811982}
19821983
1983- long udf_block_map (struct inode * inode , long block )
1984+ long udf_block_map (struct inode * inode , sector_t block )
19841985{
19851986 kernel_lb_addr eloc , bloc ;
1986- uint32_t offset , extoffset , elen ;
1987+ uint32_t extoffset , elen ;
1988+ sector_t offset ;
19871989 struct buffer_head * bh = NULL ;
19881990 int ret ;
19891991
19901992 lock_kernel ();
19911993
19921994 if (inode_bmap (inode , block , & bloc , & extoffset , & eloc , & elen , & offset , & bh ) == (EXT_RECORDED_ALLOCATED >> 30 ))
1993- ret = udf_get_lb_pblock (inode -> i_sb , eloc , offset >> inode -> i_sb -> s_blocksize_bits );
1995+ ret = udf_get_lb_pblock (inode -> i_sb , eloc , offset );
19941996 else
19951997 ret = 0 ;
19961998
0 commit comments