Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1270920 > unrolled thread

[PATCH 1/5] fs/block_dev.c: make sb_is_blkdev_sb return bool when CONFIG_BLOCK undefined

Started byYaowei Bai <baiyaowei@cmss.chinamobile.com>
First post2015-11-17 07:50 +0100
Last post2015-11-19 14:10 +0100
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/5] fs/block_dev.c: make sb_is_blkdev_sb return bool when CONFIG_BLOCK undefined Yaowei Bai <baiyaowei@cmss.chinamobile.com> - 2015-11-17 07:50 +0100
    Re: [PATCH 1/5] fs/block_dev.c: make sb_is_blkdev_sb return bool when CONFIG_BLOCK undefined Jeff Moyer <jmoyer@redhat.com> - 2015-11-17 15:30 +0100
    [PATCH 5/5] fs/attr.c: is_sxid can be boolean Yaowei Bai <baiyaowei@cmss.chinamobile.com> - 2015-11-19 14:10 +0100
    [PATCH 4/5] fs/bad_inode.c: is_bad_inode can be boolean Yaowei Bai <baiyaowei@cmss.chinamobile.com> - 2015-11-19 14:10 +0100

#1270920 — [PATCH 1/5] fs/block_dev.c: make sb_is_blkdev_sb return bool when CONFIG_BLOCK undefined

FromYaowei Bai <baiyaowei@cmss.chinamobile.com>
Date2015-11-17 07:50 +0100
Subject[PATCH 1/5] fs/block_dev.c: make sb_is_blkdev_sb return bool when CONFIG_BLOCK undefined
Message-ID<qvIfv-1qi-5@gated-at.bofh.it>
Currently when CONFIG_BLOCK is defined sb_is_blkdev_sb returns bool,
while when CONFIG_BLOCK is not defined it returns int. Let's keep
consistent to make sb_is_blkdev_sb return bool as well when CONFIG_BLOCK
isn't defined.

No functional change.

Signed-off-by: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
---
 include/linux/fs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 3aa5142..11505af 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2291,9 +2291,9 @@ static inline void iterate_bdevs(void (*f)(struct block_device *, void *), void
 {
 }
 
-static inline int sb_is_blkdev_sb(struct super_block *sb)
+static inline bool sb_is_blkdev_sb(struct super_block *sb)
 {
-	return 0;
+	return false;
 }
 #endif
 extern int sync_filesystem(struct super_block *);
-- 
1.9.1



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1271275

FromJeff Moyer <jmoyer@redhat.com>
Date2015-11-17 15:30 +0100
Message-ID<qvPqG-6b2-5@gated-at.bofh.it>
In reply to#1270920
Yaowei Bai <baiyaowei@cmss.chinamobile.com> writes:

> Currently when CONFIG_BLOCK is defined sb_is_blkdev_sb returns bool,
> while when CONFIG_BLOCK is not defined it returns int. Let's keep
> consistent to make sb_is_blkdev_sb return bool as well when CONFIG_BLOCK
> isn't defined.
>
> No functional change.
>
> Signed-off-by: Yaowei Bai <baiyaowei@cmss.chinamobile.com>

Reviewed-by: Jeff Moyer <jmoyer@redhat.com>

> ---
>  include/linux/fs.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 3aa5142..11505af 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -2291,9 +2291,9 @@ static inline void iterate_bdevs(void (*f)(struct block_device *, void *), void
>  {
>  }
>  
> -static inline int sb_is_blkdev_sb(struct super_block *sb)
> +static inline bool sb_is_blkdev_sb(struct super_block *sb)
>  {
> -	return 0;
> +	return false;
>  }
>  #endif
>  extern int sync_filesystem(struct super_block *);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1273119 — [PATCH 5/5] fs/attr.c: is_sxid can be boolean

FromYaowei Bai <baiyaowei@cmss.chinamobile.com>
Date2015-11-19 14:10 +0100
Subject[PATCH 5/5] fs/attr.c: is_sxid can be boolean
Message-ID<qwx8n-1jR-37@gated-at.bofh.it>
In reply to#1270920
This patch makes is_sxid return bool to improve readability
due to this particular function only using either one or zero
as its return value.

No functional change.

Signed-off-by: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
---
 include/linux/fs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 6b33ac4..bd14476 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2963,7 +2963,7 @@ int __init get_filesystem_list(char *buf);
 #define OPEN_FMODE(flag) ((__force fmode_t)(((flag + 1) & O_ACCMODE) | \
 					    (flag & __FMODE_NONOTIFY)))
 
-static inline int is_sxid(umode_t mode)
+static inline bool is_sxid(umode_t mode)
 {
 	return (mode & S_ISUID) || ((mode & S_ISGID) && (mode & S_IXGRP));
 }
-- 
1.9.1



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1273120 — [PATCH 4/5] fs/bad_inode.c: is_bad_inode can be boolean

FromYaowei Bai <baiyaowei@cmss.chinamobile.com>
Date2015-11-19 14:10 +0100
Subject[PATCH 4/5] fs/bad_inode.c: is_bad_inode can be boolean
Message-ID<qwx8n-1jR-39@gated-at.bofh.it>
In reply to#1270920
This patch makes is_bad_inode return bool to improve
readability due to this particular function only using either
one or zero as its return value.

No functional change.

Signed-off-by: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
---
 fs/bad_inode.c     | 2 +-
 include/linux/fs.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/bad_inode.c b/fs/bad_inode.c
index 861b1e1..103f5d7 100644
--- a/fs/bad_inode.c
+++ b/fs/bad_inode.c
@@ -192,7 +192,7 @@ EXPORT_SYMBOL(make_bad_inode);
  *	Returns true if the inode in question has been marked as bad.
  */
  
-int is_bad_inode(struct inode *inode)
+bool is_bad_inode(struct inode *inode)
 {
 	return (inode->i_op == &bad_inode_ops);	
 }
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 4b23def..6b33ac4 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2371,7 +2371,7 @@ extern void init_special_inode(struct inode *, umode_t, dev_t);
 
 /* Invalid inode operations -- fs/bad_inode.c */
 extern void make_bad_inode(struct inode *);
-extern int is_bad_inode(struct inode *);
+extern bool is_bad_inode(struct inode *);
 
 #ifdef CONFIG_BLOCK
 /*
-- 
1.9.1



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web