Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
backing-dev.c File Reference
#include <linux/wait.h>
#include <linux/backing-dev.h>
#include <linux/kthread.h>
#include <linux/freezer.h>
#include <linux/fs.h>
#include <linux/pagemap.h>
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/module.h>
#include <linux/writeback.h>
#include <linux/device.h>
#include <trace/events/writeback.h>

Go to the source code of this file.

Macros

#define K(pages)   ((pages) << (PAGE_SHIFT - 10))
 
#define BDI_SHOW(name, expr)
 
#define __ATTR_RW(attr)   __ATTR(attr, 0644, attr##_show, attr##_store)
 
#define INIT_BW   (100 << (20 - PAGE_SHIFT))
 

Functions

 EXPORT_SYMBOL_GPL (default_backing_dev_info)
 
 EXPORT_SYMBOL_GPL (noop_backing_dev_info)
 
 DEFINE_SPINLOCK (bdi_lock)
 
 LIST_HEAD (bdi_list)
 
 LIST_HEAD (bdi_pending_list)
 
void bdi_lock_two (struct bdi_writeback *wb1, struct bdi_writeback *wb2)
 
 postcore_initcall (bdi_class_init)
 
 subsys_initcall (default_bdi_init)
 
int bdi_has_dirty_io (struct backing_dev_info *bdi)
 
void bdi_wakeup_thread_delayed (struct backing_dev_info *bdi)
 
int bdi_register (struct backing_dev_info *bdi, struct device *parent, const char *fmt,...)
 
 EXPORT_SYMBOL (bdi_register)
 
int bdi_register_dev (struct backing_dev_info *bdi, dev_t dev)
 
 EXPORT_SYMBOL (bdi_register_dev)
 
void bdi_unregister (struct backing_dev_info *bdi)
 
 EXPORT_SYMBOL (bdi_unregister)
 
int bdi_init (struct backing_dev_info *bdi)
 
 EXPORT_SYMBOL (bdi_init)
 
void bdi_destroy (struct backing_dev_info *bdi)
 
 EXPORT_SYMBOL (bdi_destroy)
 
int bdi_setup_and_register (struct backing_dev_info *bdi, char *name, unsigned int cap)
 
 EXPORT_SYMBOL (bdi_setup_and_register)
 
void clear_bdi_congested (struct backing_dev_info *bdi, int sync)
 
 EXPORT_SYMBOL (clear_bdi_congested)
 
void set_bdi_congested (struct backing_dev_info *bdi, int sync)
 
 EXPORT_SYMBOL (set_bdi_congested)
 
long congestion_wait (int sync, long timeout)
 
 EXPORT_SYMBOL (congestion_wait)
 
long wait_iff_congested (struct zone *zone, int sync, long timeout)
 
 EXPORT_SYMBOL (wait_iff_congested)
 
int pdflush_proc_obsolete (struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
 

Variables

struct backing_dev_info default_backing_dev_info
 
struct backing_dev_info noop_backing_dev_info
 

Macro Definition Documentation

#define __ATTR_RW (   attr)    __ATTR(attr, 0644, attr##_show, attr##_store)

Definition at line 224 of file backing-dev.c.

#define BDI_SHOW (   name,
  expr 
)
Value:
static ssize_t name##_show(struct device *dev, \
struct device_attribute *attr, char *page) \
{ \
\
return snprintf(page, PAGE_SIZE-1, "%lld\n", (long long)expr); \
}

Definition at line 175 of file backing-dev.c.

#define INIT_BW   (100 << (20 - PAGE_SHIFT))

Definition at line 620 of file backing-dev.c.

#define K (   pages)    ((pages) << (PAGE_SHIFT - 10))

Definition at line 173 of file backing-dev.c.

Function Documentation

void bdi_destroy ( struct backing_dev_info bdi)

Definition at line 665 of file backing-dev.c.

int bdi_has_dirty_io ( struct backing_dev_info bdi)

Definition at line 258 of file backing-dev.c.

int bdi_init ( struct backing_dev_info bdi)

Definition at line 622 of file backing-dev.c.

void bdi_lock_two ( struct bdi_writeback wb1,
struct bdi_writeback wb2 
)

Definition at line 42 of file backing-dev.c.

int bdi_register ( struct backing_dev_info bdi,
struct device parent,
const char fmt,
  ... 
)

Definition at line 483 of file backing-dev.c.

int bdi_register_dev ( struct backing_dev_info bdi,
dev_t  dev 
)

Definition at line 526 of file backing-dev.c.

int bdi_setup_and_register ( struct backing_dev_info bdi,
char name,
unsigned int  cap 
)

Definition at line 705 of file backing-dev.c.

void bdi_unregister ( struct backing_dev_info bdi)

Definition at line 581 of file backing-dev.c.

void bdi_wakeup_thread_delayed ( struct backing_dev_info bdi)

Definition at line 294 of file backing-dev.c.

void clear_bdi_congested ( struct backing_dev_info bdi,
int  sync 
)

Definition at line 734 of file backing-dev.c.

long congestion_wait ( int  sync,
long  timeout 
)

congestion_wait - wait for a backing_dev to become uncongested : SYNC or ASYNC IO : timeout in jiffies

Waits for up to jiffies for a backing_dev (any backing_dev) to exit write congestion. If no backing_devs are congested then just wait for the next write to be completed.

Definition at line 767 of file backing-dev.c.

DEFINE_SPINLOCK ( bdi_lock  )
EXPORT_SYMBOL ( bdi_register  )
EXPORT_SYMBOL ( bdi_register_dev  )
EXPORT_SYMBOL ( bdi_unregister  )
EXPORT_SYMBOL ( bdi_init  )
EXPORT_SYMBOL ( bdi_destroy  )
EXPORT_SYMBOL ( bdi_setup_and_register  )
EXPORT_SYMBOL ( clear_bdi_congested  )
EXPORT_SYMBOL ( set_bdi_congested  )
EXPORT_SYMBOL ( congestion_wait  )
EXPORT_SYMBOL ( wait_iff_congested  )
EXPORT_SYMBOL_GPL ( default_backing_dev_info  )
EXPORT_SYMBOL_GPL ( noop_backing_dev_info  )
LIST_HEAD ( bdi_list  )
LIST_HEAD ( bdi_pending_list  )
int pdflush_proc_obsolete ( struct ctl_table table,
int  write,
void __user buffer,
size_t lenp,
loff_t *  ppos 
)

Definition at line 840 of file backing-dev.c.

postcore_initcall ( bdi_class_init  )
void set_bdi_congested ( struct backing_dev_info bdi,
int  sync 
)

Definition at line 748 of file backing-dev.c.

subsys_initcall ( default_bdi_init  )
long wait_iff_congested ( struct zone zone,
int  sync,
long  timeout 
)

wait_iff_congested - Conditionally wait for a backing_dev to become uncongested or a zone to complete writes : A zone to check if it is heavily congested : SYNC or ASYNC IO : timeout in jiffies

In the event of a congested backing_dev (any backing_dev) and the given has experienced recent congestion, this waits for up to jiffies for either a BDI to exit congestion of the given queue or a write to complete.

In the absence of zone congestion, cond_resched() is called to yield the processor if necessary but otherwise does not sleep.

The return value is 0 if the sleep is for the full timeout. Otherwise, it is the number of jiffies that were still remaining when the function returned. return_value == timeout implies the function did not sleep.

Definition at line 803 of file backing-dev.c.

Variable Documentation

struct backing_dev_info default_backing_dev_info
Initial value:
= {
.name = "default",
.ra_pages = VM_MAX_READAHEAD * 1024 / PAGE_CACHE_SIZE,
.state = 0,
.capabilities = BDI_CAP_MAP_COPY,
}

Definition at line 17 of file backing-dev.c.

struct backing_dev_info noop_backing_dev_info
Initial value:
= {
.name = "noop",
}

Definition at line 25 of file backing-dev.c.