[RFC][PATCH 3/3] add ext2_fileblk_t for file offset

[email protected]
Newsgroups gmane.comp.file-systems.ext2.devel,gmane.linux.kernel
Message-ID <[email protected]>
[patch 3/3] ext2_fileblk_t.patch
This patch converts ext2 file offset to ext2_fileblk_t.

Signed-off-by: Takashi Sato <[email protected]>
---
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
--- linux-2.6.17/fs/ext2/ext2.h	2006-06-29 21:26:30.000000000 +0900
+++ linux-2.6.17.tmp/fs/ext2/ext2.h	2006-06-29 21:27:31.000000000 +0900
@@ -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.
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
--- linux-2.6.17/fs/ext2/inode.c	2006-06-29 21:27:18.000000000 +0900
+++ linux-2.6.17.tmp/fs/ext2/inode.c	2006-06-29 21:27:31.000000000 +0900
@@ -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) ||
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
--- linux-2.6.17/fs/ext2/super.c	2006-06-29 21:26:30.000000000 +0900
+++ linux-2.6.17.tmp/fs/ext2/super.c	2006-06-29 21:27:31.000000000 +0900
@@ -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;
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
--- linux-2.6.17/include/linux/ext2_fs_sb.h	2006-06-29 21:27:18.000000000 +0900
+++ linux-2.6.17.tmp/include/linux/ext2_fs_sb.h	2006-06-29 21:27:31.000000000 +0900
@@ -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


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.