Skip to contentSkip to conversation

add ext2_fileblk_t for file offset

RFC PATCH New [email protected] 1 participant 1 message Jun 30, 2006 ext2 file system

lore
Share & tools
lore
#0 lore raw

RFC PATCH 3/3 add ext2_fileblk_t for file offset

[patch 3/3] ext2_fileblk_t.patch
This patch converts ext2 file offset to ext2_fileblk_t.

---

fs/ext2/ext2.h +1 -1
diff -upNr -X linux-2.6.17/Documentation/dontdiff linux-2.6.17/fs/ext2/ext2.h linux-2.6.17.tmp/fs/ext2/ext2.h
@@ -38,7 +38,7 @@ struct ext2_inode_info {
 	 * most-recently-allocated block in this file.  Yes, it is misnamed.
 	 * We use this for detecting linearly ascending allocation requests.
 	 */
-	__u32	i_next_alloc_block;
+	ext2_fileblk_t	i_next_alloc_block;
 
 	/*
 	 * i_next_alloc_goal is the *physical* companion to i_next_alloc_block.
fs/ext2/inode.c +4 -4
diff -upNr -X linux-2.6.17/Documentation/dontdiff linux-2.6.17/fs/ext2/inode.c linux-2.6.17.tmp/fs/ext2/inode.c
@@ -194,7 +194,7 @@ static inline int verify_chain(Indirect 
  */
 
 static int ext2_block_to_path(struct inode *inode,
-			long i_block, int offsets[4], int *boundary)
+			ext2_fileblk_t i_block, int offsets[4], int *boundary)
 {
 	int ptrs = EXT2_ADDR_PER_BLOCK(inode->i_sb);
 	int ptrs_bits = EXT2_ADDR_PER_BLOCK_BITS(inode->i_sb);
@@ -363,7 +363,7 @@ static unsigned long ext2_find_near(stru
  */
 
 static inline int ext2_find_goal(struct inode *inode,
-				 long block,
+				 ext2_fileblk_t block,
 				 Indirect chain[4],
 				 Indirect *partial,
 				 ext2_fsblk_t *goal)
@@ -489,7 +489,7 @@ static int ext2_alloc_branch(struct inod
  */
 
 static inline int ext2_splice_branch(struct inode *inode,
-				     long block,
+				     ext2_fileblk_t block,
 				     Indirect chain[4],
 				     Indirect *where,
 				     int num)
@@ -905,7 +905,7 @@ void ext2_truncate (struct inode * inode
 	Indirect *partial;
 	__le32 nr = 0;
 	int n;
-	long iblock;
+	ext2_fileblk_t iblock;
 	unsigned blocksize;
 
 	if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
fs/ext2/super.c +2 -2
diff -upNr -X linux-2.6.17/Documentation/dontdiff linux-2.6.17/fs/ext2/super.c linux-2.6.17.tmp/fs/ext2/super.c
@@ -1104,7 +1104,7 @@ static ssize_t ext2_quota_read(struct su
 			       size_t len, loff_t off)
 {
 	struct inode *inode = sb_dqopt(sb)->files[type];
-	sector_t blk = off >> EXT2_BLOCK_SIZE_BITS(sb);
+	ext2_fileblk_t blk = off >> EXT2_BLOCK_SIZE_BITS(sb);
 	int err = 0;
 	int offset = off & (sb->s_blocksize - 1);
 	int tocopy;
@@ -1148,7 +1148,7 @@ static ssize_t ext2_quota_write(struct s
 				const char *data, size_t len, loff_t off)
 {
 	struct inode *inode = sb_dqopt(sb)->files[type];
-	sector_t blk = off >> EXT2_BLOCK_SIZE_BITS(sb);
+	ext2_fileblk_t blk = off >> EXT2_BLOCK_SIZE_BITS(sb);
 	int err = 0;
 	int offset = off & (sb->s_blocksize - 1);
 	int tocopy;
include/linux/ext2_fs_sb.h +1 -0
diff -upNr -X linux-2.6.17/Documentation/dontdiff linux-2.6.17/include/linux/ext2_fs_sb.h linux-2.6.17.tmp/include/linux/ext2_fs_sb.h
@@ -21,6 +21,7 @@
 
 typedef unsigned long ext2_fsblk_t;
 typedef long ext2_grpblk_t;
+typedef unsigned long ext2_fileblk_t;
 
 /*
  * second extended-fs super-block data in memory