Skip to contentSkip to conversation

fat: move fat_i_pos_read to fat.h

PATCH In review Namjae Jeon 2 participants 2 messages Oct 28, 2012 – Nov 5, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/5 fat: move fat_i_pos_read to fat.h

From: Namjae Jeon <[email protected]>

Originally, fat_i_pos_read was a static inline function in inode.c. The static keyword was removed so that it could be accessed from other files. However it is better to make it a static inline function in fat.h as suggested by Ogawa.

---
 fs/fat/fat.h   |   14 ++++++++++++++
 fs/fat/inode.c |   14 --------------
 2 files changed, 14 insertions(+), 14 deletions(-)
fs/fat/fat.h +14 -0
index 65f9149..177e94e 100644
@@ -222,6 +222,20 @@ static inline void fat_get_blknr_offset(struct msdos_sb_info *sbi,
 	*offset = i_pos & (sbi->dir_per_block - 1);
 }
 
+static inline loff_t fat_i_pos_read(struct msdos_sb_info *sbi,
+					struct inode *inode)
+{
+	loff_t i_pos;
+#if BITS_PER_LONG == 32
+	spin_lock(&sbi->inode_hash_lock);
+#endif
+	i_pos = MSDOS_I(inode)->i_pos;
+#if BITS_PER_LONG == 32
+	spin_unlock(&sbi->inode_hash_lock);
+#endif
+	return i_pos;
+}
+
 static inline void fat16_towchar(wchar_t *dst, const __u8 *src, size_t len)
 {
 #ifdef __BIG_ENDIAN
fs/fat/inode.c +0 -14
index 34253dc..63e0883 100644
@@ -595,20 +595,6 @@ static int fat_statfs(struct dentry *dentry, struct kstatfs *buf)
 	return 0;
 }
 
-loff_t fat_i_pos_read(struct msdos_sb_info *sbi,
-				    struct inode *inode)
-{
-	loff_t i_pos;
-#if BITS_PER_LONG == 32
-	spin_lock(&sbi->inode_hash_lock);
-#endif
-	i_pos = MSDOS_I(inode)->i_pos;
-#if BITS_PER_LONG == 32
-	spin_unlock(&sbi->inode_hash_lock);
-#endif
-	return i_pos;
-}
-
 static int __fat_write_inode(struct inode *inode, int wait)
 {
 	struct super_block *sb = inode->i_sb;
Signature · 1 line
1.7.9.5
maintainer
#1 lore raw
Quoted 6 lines · Namjae Jeon

From: Namjae Jeon <[email protected]>

Originally, fat_i_pos_read was a static inline function in inode.c. The static keyword was removed so that it could be accessed from other files. However it is better to make it a static inline function in fat.h as suggested by Ogawa.

Looks like leaving extra line.

+extern loff_t fat_i_pos_read(struct msdos_sb_info *sbi, struct inode *inode);

Quoted 58 lines
---
 fs/fat/fat.h   |   14 ++++++++++++++
 fs/fat/inode.c |   14 --------------
 2 files changed, 14 insertions(+), 14 deletions(-)
fs/fat/fat.h +14 -0
index 65f9149..177e94e 100644
@@ -222,6 +222,20 @@ static inline void fat_get_blknr_offset(struct msdos_sb_info *sbi,
 	*offset = i_pos & (sbi->dir_per_block - 1);
 }
 
+static inline loff_t fat_i_pos_read(struct msdos_sb_info *sbi,
+					struct inode *inode)
+{
+	loff_t i_pos;
+#if BITS_PER_LONG == 32
+	spin_lock(&sbi->inode_hash_lock);
+#endif
+	i_pos = MSDOS_I(inode)->i_pos;
+#if BITS_PER_LONG == 32
+	spin_unlock(&sbi->inode_hash_lock);
+#endif
+	return i_pos;
+}
+
 static inline void fat16_towchar(wchar_t *dst, const __u8 *src, size_t len)
 {
 #ifdef __BIG_ENDIAN
fs/fat/inode.c +0 -14
index 34253dc..63e0883 100644
@@ -595,20 +595,6 @@ static int fat_statfs(struct dentry *dentry, struct kstatfs *buf)
 	return 0;
 }
 
-loff_t fat_i_pos_read(struct msdos_sb_info *sbi,
-				    struct inode *inode)
-{
-	loff_t i_pos;
-#if BITS_PER_LONG == 32
-	spin_lock(&sbi->inode_hash_lock);
-#endif
-	i_pos = MSDOS_I(inode)->i_pos;
-#if BITS_PER_LONG == 32
-	spin_unlock(&sbi->inode_hash_lock);
-#endif
-	return i_pos;
-}
-
 static int __fat_write_inode(struct inode *inode, int wait)
 {
 	struct super_block *sb = inode->i_sb;
Signature · 1 line
OGAWA Hirofumi <[email protected]>