linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/5] fat: move fat_i_pos_read to fat.h
@ 2012-10-28  1:53 Namjae Jeon
  2012-11-05 11:45 ` OGAWA Hirofumi
  0 siblings, 1 reply; 2+ messages in thread
From: Namjae Jeon @ 2012-10-28  1:53 UTC (permalink / raw)
  To: hirofumi, akpm
  Cc: linux-fsdevel, linux-kernel, Namjae Jeon, Namjae Jeon,
	Ravishankar N, Amit Sahrawat

From: Namjae Jeon <namjae.jeon@samsung.com>

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.

Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Ravishankar N <ravi.n1@samsung.com>
Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
---
 fs/fat/fat.h   |   14 ++++++++++++++
 fs/fat/inode.c |   14 --------------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/fs/fat/fat.h b/fs/fat/fat.h
index 65f9149..177e94e 100644
--- a/fs/fat/fat.h
+++ b/fs/fat/fat.h
@@ -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
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 34253dc..63e0883 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -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;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 3/5] fat: move fat_i_pos_read to fat.h
  2012-10-28  1:53 [PATCH 3/5] fat: move fat_i_pos_read to fat.h Namjae Jeon
@ 2012-11-05 11:45 ` OGAWA Hirofumi
  0 siblings, 0 replies; 2+ messages in thread
From: OGAWA Hirofumi @ 2012-11-05 11:45 UTC (permalink / raw)
  To: Namjae Jeon
  Cc: akpm, linux-fsdevel, linux-kernel, Namjae Jeon, Ravishankar N,
	Amit Sahrawat

Namjae Jeon <linkinjeon@gmail.com> writes:

> From: Namjae Jeon <namjae.jeon@samsung.com>
>
> 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);

> Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
> Signed-off-by: Ravishankar N <ravi.n1@samsung.com>
> Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
> ---
>  fs/fat/fat.h   |   14 ++++++++++++++
>  fs/fat/inode.c |   14 --------------
>  2 files changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/fs/fat/fat.h b/fs/fat/fat.h
> index 65f9149..177e94e 100644
> --- a/fs/fat/fat.h
> +++ b/fs/fat/fat.h
> @@ -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
> diff --git a/fs/fat/inode.c b/fs/fat/inode.c
> index 34253dc..63e0883 100644
> --- a/fs/fat/inode.c
> +++ b/fs/fat/inode.c
> @@ -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;

-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-11-05 11:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-28  1:53 [PATCH 3/5] fat: move fat_i_pos_read to fat.h Namjae Jeon
2012-11-05 11:45 ` OGAWA Hirofumi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).