Skip to contentSkip to conversation

fix up ext2_fs.h for userspace after reservations backport

PATCH In review Eric Sandeen 2 participants 3 messages Nov 26, 2007 – Nov 27, 2007 ext2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix up ext2_fs.h for userspace after reservations backport

From: Tobias Poschwatta <[email protected]>

In commit a686cd898bd999fd026a51e90fb0a3410d258ddb:

"Val's cross-port of the ext3 reservations code into ext2."

include/linux/ext2_fs.h got a new function whose return value is only defined if __KERNEL__ is defined. Putting #ifdef __KERNEL__ around the function seems to help, patch below.

BR, Tobias

---

include/linux/ext2_fs.h +2 -0
Index: linux-2.6.24-rc1/include/linux/ext2_fs.h
===================================================================
@@ -563,11 +563,13 @@ enum {
 					 ~EXT2_DIR_ROUND)
 #define EXT2_MAX_REC_LEN		((1<<16)-1)
 
+#ifdef __KERNEL__
 static inline ext2_fsblk_t
 ext2_group_first_block_no(struct super_block *sb, unsigned long group_no)
 {
 	return group_no * (ext2_fsblk_t)EXT2_BLOCKS_PER_GROUP(sb) +
 		le32_to_cpu(EXT2_SB(sb)->s_es->s_first_data_block);
 }
+#endif
 
 #endif	/* _LINUX_EXT2_FS_H */
#1 lore raw
Quoted 24 lines · On Mon, 26 Nov 2007 11:19:57 -0600 Eric Sandeen <[email protected]> wrote:

From: Tobias Poschwatta <[email protected]>

In commit a686cd898bd999fd026a51e90fb0a3410d258ddb:

"Val's cross-port of the ext3 reservations code into ext2."

include/linux/ext2_fs.h got a new function whose return value is only defined if __KERNEL__ is defined. Putting #ifdef __KERNEL__ around the function seems to help, patch below.

BR, Tobias

---

Index: linux-2.6.24-rc1/include/linux/ext2_fs.h
===================================================================

include/linux/ext2_fs.h +0 -0
@@ -563,11 +563,13 @@ enum {
 					 ~EXT2_DIR_ROUND)
 #define EXT2_MAX_REC_LEN		((1<<16)-1)
 

include/linux/ext2_fs.h enum { · line 575

Quoted 10 lines
include/linux/ext2_fs.h +2 -0
+#ifdef __KERNEL__
 static inline ext2_fsblk_t
 ext2_group_first_block_no(struct super_block *sb, unsigned long group_no)
 {
 	return group_no * (ext2_fsblk_t)EXT2_BLOCKS_PER_GROUP(sb) +
 		le32_to_cpu(EXT2_SB(sb)->s_es->s_first_data_block);
 }
+#endif
 
 #endif	/* _LINUX_EXT2_FS_H */

I did this instead:

From: Tobias Poschwatta <[email protected]>

In commit a686cd898bd999fd026a51e90fb0a3410d258ddb:

"Val's cross-port of the ext3 reservations code into ext2."

include/linux/ext2_fs.h got a new function whose return value is only defined if __KERNEL__ is defined. Putting #ifdef __KERNEL__ around the function seems to help, patch below.

---

 fs/ext2/ext2.h          |    7 +++++++
 include/linux/ext2_fs.h |    7 -------
 2 files changed, 7 insertions(+), 7 deletions(-)
include/linux/ext2_fs.h renamed from include/linux/ext2_fs.h~fix-up-ext2_fsh-for-userspace-after-reservations-backport +0 -7
diff -puN include/linux/ext2_fs.h~fix-up-ext2_fsh-for-userspace-after-reservations-backport include/linux/ext2_fs.h
@@ -563,11 +563,4 @@ enum {
 					 ~EXT2_DIR_ROUND)
 #define EXT2_MAX_REC_LEN		((1<<16)-1)
 
-static inline ext2_fsblk_t
-ext2_group_first_block_no(struct super_block *sb, unsigned long group_no)
-{
-	return group_no * (ext2_fsblk_t)EXT2_BLOCKS_PER_GROUP(sb) +
-		le32_to_cpu(EXT2_SB(sb)->s_es->s_first_data_block);
-}
-
 #endif	/* _LINUX_EXT2_FS_H */
fs/ext2/ext2.h renamed from fs/ext2/ext2.h~fix-up-ext2_fsh-for-userspace-after-reservations-backport +7 -0
diff -puN fs/ext2/ext2.h~fix-up-ext2_fsh-for-userspace-after-reservations-backport fs/ext2/ext2.h
@@ -178,3 +178,10 @@ extern const struct inode_operations ext
 /* symlink.c */
 extern const struct inode_operations ext2_fast_symlink_inode_operations;
 extern const struct inode_operations ext2_symlink_inode_operations;
+
+static inline ext2_fsblk_t
+ext2_group_first_block_no(struct super_block *sb, unsigned long group_no)
+{
+	return group_no * (ext2_fsblk_t)EXT2_BLOCKS_PER_GROUP(sb) +
+		le32_to_cpu(EXT2_SB(sb)->s_es->s_first_data_block);
+}

_

#2 lore raw
Quoted 1 line · Andrew Morton

I did this instead:

(moved offending function from ext2_fs.h to ext2.h)

Look like a better plan, thanks.

-Eric