* [PATCH 1/2] vfs: make writeback_in_progress() inline
@ 2011-12-06 5:35 Miao Xie
2011-12-06 5:51 ` Miao Xie
2011-12-06 9:55 ` Christoph Hellwig
0 siblings, 2 replies; 3+ messages in thread
From: Miao Xie @ 2011-12-06 5:35 UTC (permalink / raw)
To: viro, Chris Mason, Ito; +Cc: Linux Btrfs, Linux Fsdevel
writeback_in_progress() is very simple, and we will use writeback_in_progress()
in the module, so make it inline.
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
---
fs/fs-writeback.c | 12 ------------
include/linux/backing-dev.h | 12 +++++++++++-
2 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 04cf3b9..341448c 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -59,18 +59,6 @@ struct wb_writeback_work {
*/
int nr_pdflush_threads;
-/**
- * writeback_in_progress - determine whether there is writeback in progress
- * @bdi: the device's backing_dev_info structure.
- *
- * Determine whether there is writeback waiting to be handled against a
- * backing device.
- */
-int writeback_in_progress(struct backing_dev_info *bdi)
-{
- return test_bit(BDI_writeback_running, &bdi->state);
-}
-
static inline struct backing_dev_info *inode_to_bdi(struct inode *inode)
{
struct super_block *sb = inode->i_sb;
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index 3b2f9cb..ae4d7c0 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -258,7 +258,17 @@ int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio);
extern struct backing_dev_info default_backing_dev_info;
extern struct backing_dev_info noop_backing_dev_info;
-int writeback_in_progress(struct backing_dev_info *bdi);
+/**
+ * writeback_in_progress - determine whether there is writeback in progress
+ * @bdi: the device's backing_dev_info structure.
+ *
+ * Determine whether there is writeback waiting to be handled against a
+ * backing device.
+ */
+static inline int writeback_in_progress(struct backing_dev_info *bdi)
+{
+ return test_bit(BDI_writeback_running, &bdi->state);
+}
static inline int bdi_congested(struct backing_dev_info *bdi, int bdi_bits)
{
--
1.7.6.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] vfs: make writeback_in_progress() inline
2011-12-06 5:35 [PATCH 1/2] vfs: make writeback_in_progress() inline Miao Xie
@ 2011-12-06 5:51 ` Miao Xie
2011-12-06 9:55 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Miao Xie @ 2011-12-06 5:51 UTC (permalink / raw)
Cc: Linux Kernel, viro, Chris Mason, Ito, Linux Btrfs, Linux Fsdevel,
Wu Fengguang
cc Fengguang
cc Linux-kernel
On tue, 06 Dec 2011 13:35:45 +0800, Miao Xie wrote:
> writeback_in_progress() is very simple, and we will use writeback_in_progress()
> in the module, so make it inline.
>
> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
> ---
> fs/fs-writeback.c | 12 ------------
> include/linux/backing-dev.h | 12 +++++++++++-
> 2 files changed, 11 insertions(+), 13 deletions(-)
>
> diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
> index 04cf3b9..341448c 100644
> --- a/fs/fs-writeback.c
> +++ b/fs/fs-writeback.c
> @@ -59,18 +59,6 @@ struct wb_writeback_work {
> */
> int nr_pdflush_threads;
>
> -/**
> - * writeback_in_progress - determine whether there is writeback in progress
> - * @bdi: the device's backing_dev_info structure.
> - *
> - * Determine whether there is writeback waiting to be handled against a
> - * backing device.
> - */
> -int writeback_in_progress(struct backing_dev_info *bdi)
> -{
> - return test_bit(BDI_writeback_running, &bdi->state);
> -}
> -
> static inline struct backing_dev_info *inode_to_bdi(struct inode *inode)
> {
> struct super_block *sb = inode->i_sb;
> diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
> index 3b2f9cb..ae4d7c0 100644
> --- a/include/linux/backing-dev.h
> +++ b/include/linux/backing-dev.h
> @@ -258,7 +258,17 @@ int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio);
> extern struct backing_dev_info default_backing_dev_info;
> extern struct backing_dev_info noop_backing_dev_info;
>
> -int writeback_in_progress(struct backing_dev_info *bdi);
> +/**
> + * writeback_in_progress - determine whether there is writeback in progress
> + * @bdi: the device's backing_dev_info structure.
> + *
> + * Determine whether there is writeback waiting to be handled against a
> + * backing device.
> + */
> +static inline int writeback_in_progress(struct backing_dev_info *bdi)
> +{
> + return test_bit(BDI_writeback_running, &bdi->state);
> +}
>
> static inline int bdi_congested(struct backing_dev_info *bdi, int bdi_bits)
> {
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] vfs: make writeback_in_progress() inline
2011-12-06 5:35 [PATCH 1/2] vfs: make writeback_in_progress() inline Miao Xie
2011-12-06 5:51 ` Miao Xie
@ 2011-12-06 9:55 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2011-12-06 9:55 UTC (permalink / raw)
To: Miao Xie; +Cc: viro, Chris Mason, Ito, Linux Btrfs, Linux Fsdevel
On Tue, Dec 06, 2011 at 01:35:45PM +0800, Miao Xie wrote:
> writeback_in_progress() is very simple, and we will use writeback_in_progress()
> in the module, so make it inline.
Modules don't really have a business looking at this information. I'd
prefer to keep it static in fs-writeback.c.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-12-06 9:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-06 5:35 [PATCH 1/2] vfs: make writeback_in_progress() inline Miao Xie
2011-12-06 5:51 ` Miao Xie
2011-12-06 9:55 ` Christoph Hellwig
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).