buffer.c File Reference

Go to the source code of this file.

Classes

struct  bh_lru
struct  bh_accounting

Defines

#define BH_ENTRY(list)   list_entry((list), struct buffer_head, b_assoc_buffers)
#define BH_LRU_SIZE   8
#define bh_lru_lock()   preempt_disable()
#define bh_lru_unlock()   preempt_enable()

Functions

static int fsync_buffers_list (spinlock_t *lock, struct list_head *list)
void init_buffer (struct buffer_head *bh, bh_end_io_t *handler, void *private)
static int sync_buffer (void *word)
void __lock_buffer (struct buffer_head *bh)
 EXPORT_SYMBOL (__lock_buffer)
void unlock_buffer (struct buffer_head *bh)
void __wait_on_buffer (struct buffer_head *bh)
static void __clear_page_buffers (struct page *page)
static int quiet_error (struct buffer_head *bh)
static void buffer_io_error (struct buffer_head *bh)
static void __end_buffer_read_notouch (struct buffer_head *bh, int uptodate)
void end_buffer_read_sync (struct buffer_head *bh, int uptodate)
void end_buffer_write_sync (struct buffer_head *bh, int uptodate)
int sync_blockdev (struct block_device *bdev)
 EXPORT_SYMBOL (sync_blockdev)
int fsync_bdev (struct block_device *bdev)
struct super_block * freeze_bdev (struct block_device *bdev)
 freeze_bdev -- lock a filesystem and force it into a consistent state : blockdevice to lock
 EXPORT_SYMBOL (freeze_bdev)
int thaw_bdev (struct block_device *bdev, struct super_block *sb)
 thaw_bdev -- unlock filesystem : blockdevice to unlock : associated superblock
 EXPORT_SYMBOL (thaw_bdev)
static struct buffer_head * __find_get_block_slow (struct block_device *bdev, sector_t block)
void invalidate_bdev (struct block_device *bdev)
static void free_more_memory (void)
static void end_buffer_async_read (struct buffer_head *bh, int uptodate)
static void end_buffer_async_write (struct buffer_head *bh, int uptodate)
static void mark_buffer_async_read (struct buffer_head *bh)
void mark_buffer_async_write (struct buffer_head *bh)
 EXPORT_SYMBOL (mark_buffer_async_write)
static void __remove_assoc_queue (struct buffer_head *bh)
int inode_has_buffers (struct inode *inode)
static int osync_buffers_list (spinlock_t *lock, struct list_head *list)
int sync_mapping_buffers (struct address_space *mapping)
 sync_mapping_buffers - write out & wait upon a mapping's "associated" buffers : the mapping which wants those buffers written
 EXPORT_SYMBOL (sync_mapping_buffers)
void write_boundary_block (struct block_device *bdev, sector_t bblock, unsigned blocksize)
void mark_buffer_dirty_inode (struct buffer_head *bh, struct inode *inode)
 EXPORT_SYMBOL (mark_buffer_dirty_inode)
static void __set_page_dirty (struct page *page, struct address_space *mapping, int warn)
int __set_page_dirty_buffers (struct page *page)
 EXPORT_SYMBOL (__set_page_dirty_buffers)
void invalidate_inode_buffers (struct inode *inode)
 EXPORT_SYMBOL (invalidate_inode_buffers)
int remove_inode_buffers (struct inode *inode)
struct buffer_head * alloc_page_buffers (struct page *page, unsigned long size, int retry)
 EXPORT_SYMBOL_GPL (alloc_page_buffers)
static void link_dev_buffers (struct page *page, struct buffer_head *head)
static void init_page_buffers (struct page *page, struct block_device *bdev, sector_t block, int size)
static struct page * grow_dev_page (struct block_device *bdev, sector_t block, pgoff_t index, int size)
static int grow_buffers (struct block_device *bdev, sector_t block, int size)
static struct buffer_head * __getblk_slow (struct block_device *bdev, sector_t block, int size)
void mark_buffer_dirty (struct buffer_head *bh)
 mark_buffer_dirty - mark a buffer_head as needing writeout : the buffer_head to mark dirty
void __brelse (struct buffer_head *buf)
void __bforget (struct buffer_head *bh)
static struct buffer_head * __bread_slow (struct buffer_head *bh)
static DEFINE_PER_CPU (struct bh_lru, bh_lrus)
static void check_irqs_on (void)
static void bh_lru_install (struct buffer_head *bh)
static struct buffer_head * lookup_bh_lru (struct block_device *bdev, sector_t block, unsigned size)
struct buffer_head * __find_get_block (struct block_device *bdev, sector_t block, unsigned size)
 EXPORT_SYMBOL (__find_get_block)
struct buffer_head * __getblk (struct block_device *bdev, sector_t block, unsigned size)
 EXPORT_SYMBOL (__getblk)
void __breadahead (struct block_device *bdev, sector_t block, unsigned size)
 EXPORT_SYMBOL (__breadahead)
struct buffer_head * __bread (struct block_device *bdev, sector_t block, unsigned size)
 __bread() - reads a specified block and returns the bh : the block_device to read from : number of block : size (in bytes) to read
 EXPORT_SYMBOL (__bread)
static void invalidate_bh_lru (void *arg)
void invalidate_bh_lrus (void)
 EXPORT_SYMBOL_GPL (invalidate_bh_lrus)
void set_bh_page (struct buffer_head *bh, struct page *page, unsigned long offset)
 EXPORT_SYMBOL (set_bh_page)
static void discard_buffer (struct buffer_head *bh)
void block_invalidatepage (struct page *page, unsigned long offset)
 EXPORT_SYMBOL (block_invalidatepage)
void create_empty_buffers (struct page *page, unsigned long blocksize, unsigned long b_state)
 EXPORT_SYMBOL (create_empty_buffers)
void unmap_underlying_metadata (struct block_device *bdev, sector_t block)
 EXPORT_SYMBOL (unmap_underlying_metadata)
static int __block_write_full_page (struct inode *inode, struct page *page, get_block_t *get_block, struct writeback_control *wbc)
void page_zero_new_buffers (struct page *page, unsigned from, unsigned to)
 EXPORT_SYMBOL (page_zero_new_buffers)
static int __block_prepare_write (struct inode *inode, struct page *page, unsigned from, unsigned to, get_block_t *get_block)
static int __block_commit_write (struct inode *inode, struct page *page, unsigned from, unsigned to)
int block_write_begin (struct file *file, struct address_space *mapping, loff_t pos, unsigned len, unsigned flags, struct page **pagep, void **fsdata, get_block_t *get_block)
 EXPORT_SYMBOL (block_write_begin)
int block_write_end (struct file *file, struct address_space *mapping, loff_t pos, unsigned len, unsigned copied, struct page *page, void *fsdata)
 EXPORT_SYMBOL (block_write_end)
int generic_write_end (struct file *file, struct address_space *mapping, loff_t pos, unsigned len, unsigned copied, struct page *page, void *fsdata)
 EXPORT_SYMBOL (generic_write_end)
int block_is_partially_uptodate (struct page *page, read_descriptor_t *desc, unsigned long from)
 EXPORT_SYMBOL (block_is_partially_uptodate)
int block_read_full_page (struct page *page, get_block_t *get_block)
int generic_cont_expand_simple (struct inode *inode, loff_t size)
static int cont_expand_zero (struct file *file, struct address_space *mapping, loff_t pos, loff_t *bytes)
int cont_write_begin (struct file *file, struct address_space *mapping, loff_t pos, unsigned len, unsigned flags, struct page **pagep, void **fsdata, get_block_t *get_block, loff_t *bytes)
int block_prepare_write (struct page *page, unsigned from, unsigned to, get_block_t *get_block)
int block_commit_write (struct page *page, unsigned from, unsigned to)
int block_page_mkwrite (struct vm_area_struct *vma, struct page *page, get_block_t get_block)
static void end_buffer_read_nobh (struct buffer_head *bh, int uptodate)
static void attach_nobh_buffers (struct page *page, struct buffer_head *head)
int nobh_write_begin (struct file *file, struct address_space *mapping, loff_t pos, unsigned len, unsigned flags, struct page **pagep, void **fsdata, get_block_t *get_block)
 EXPORT_SYMBOL (nobh_write_begin)
int nobh_write_end (struct file *file, struct address_space *mapping, loff_t pos, unsigned len, unsigned copied, struct page *page, void *fsdata)
 EXPORT_SYMBOL (nobh_write_end)
int nobh_writepage (struct page *page, get_block_t *get_block, struct writeback_control *wbc)
 EXPORT_SYMBOL (nobh_writepage)
int nobh_truncate_page (struct address_space *mapping, loff_t from, get_block_t *get_block)
 EXPORT_SYMBOL (nobh_truncate_page)
int block_truncate_page (struct address_space *mapping, loff_t from, get_block_t *get_block)
int block_write_full_page (struct page *page, get_block_t *get_block, struct writeback_control *wbc)
sector_t generic_block_bmap (struct address_space *mapping, sector_t block, get_block_t *get_block)
static void end_bio_bh_io_sync (struct bio *bio, int err)
int submit_bh (int rw, struct buffer_head *bh)
void ll_rw_block (int rw, int nr, struct buffer_head *bhs[])
 ll_rw_block: low-level access to block devices (DEPRECATED) : whether to READ or WRITE or SWRITE or maybe READA (readahead) : number of &struct buffer_heads in the array : array of pointers to &struct buffer_head
int sync_dirty_buffer (struct buffer_head *bh)
static int buffer_busy (struct buffer_head *bh)
static int drop_buffers (struct page *page, struct buffer_head **buffers_to_free)
int try_to_free_buffers (struct page *page)
 EXPORT_SYMBOL (try_to_free_buffers)
void block_sync_page (struct page *page)
 SYSCALL_DEFINE2 (bdflush, int, func, long, data)
static DEFINE_PER_CPU (struct bh_accounting, bh_accounting)
static void recalc_bh_state (void)
struct buffer_head * alloc_buffer_head (gfp_t gfp_flags)
 EXPORT_SYMBOL (alloc_buffer_head)
void free_buffer_head (struct buffer_head *bh)
 EXPORT_SYMBOL (free_buffer_head)
static void buffer_exit_cpu (int cpu)
static int buffer_cpu_notify (struct notifier_block *self, unsigned long action, void *hcpu)
int bh_uptodate_or_lock (struct buffer_head *bh)
 bh_uptodate_or_lock - Test whether the buffer is uptodate : struct buffer_head
 EXPORT_SYMBOL (bh_uptodate_or_lock)
int bh_submit_read (struct buffer_head *bh)
 bh_submit_read - Submit a locked buffer for reading : struct buffer_head
 EXPORT_SYMBOL (bh_submit_read)
static void init_buffer_head (void *data)
void __init buffer_init (void)
 EXPORT_SYMBOL (__bforget)
 EXPORT_SYMBOL (__brelse)
 EXPORT_SYMBOL (__wait_on_buffer)
 EXPORT_SYMBOL (block_commit_write)
 EXPORT_SYMBOL (block_prepare_write)
 EXPORT_SYMBOL (block_page_mkwrite)
 EXPORT_SYMBOL (block_read_full_page)
 EXPORT_SYMBOL (block_sync_page)
 EXPORT_SYMBOL (block_truncate_page)
 EXPORT_SYMBOL (block_write_full_page)
 EXPORT_SYMBOL (cont_write_begin)
 EXPORT_SYMBOL (end_buffer_read_sync)
 EXPORT_SYMBOL (end_buffer_write_sync)
 EXPORT_SYMBOL (file_fsync)
 EXPORT_SYMBOL (fsync_bdev)
 EXPORT_SYMBOL (generic_block_bmap)
 EXPORT_SYMBOL (generic_cont_expand_simple)
 EXPORT_SYMBOL (init_buffer)
 EXPORT_SYMBOL (invalidate_bdev)
 EXPORT_SYMBOL (ll_rw_block)
 EXPORT_SYMBOL (mark_buffer_dirty)
 EXPORT_SYMBOL (submit_bh)
 EXPORT_SYMBOL (sync_dirty_buffer)
 EXPORT_SYMBOL (unlock_buffer)

Variables

static struct kmem_cachebh_cachep
static int max_buffer_heads
int buffer_heads_over_limit


Define Documentation

#define BH_ENTRY ( list   )     list_entry((list), struct buffer_head, b_assoc_buffers)

Definition at line 47 of file buffer.c.

 
#define bh_lru_lock (  )     preempt_disable()

Definition at line 1371 of file buffer.c.

#define BH_LRU_SIZE   8

Definition at line 1359 of file buffer.c.

 
#define bh_lru_unlock (  )     preempt_enable()

Definition at line 1372 of file buffer.c.


Function Documentation

void __bforget ( struct buffer_head *  bh  ) 

Definition at line 1313 of file buffer.c.

static int __block_commit_write ( struct inode *  inode,
struct page *  page,
unsigned  from,
unsigned  to 
) [static]

Definition at line 2020 of file buffer.c.

static int __block_prepare_write ( struct inode *  inode,
struct page *  page,
unsigned  from,
unsigned  to,
get_block_t *  get_block 
) [static]

Definition at line 1940 of file buffer.c.

static int __block_write_full_page ( struct inode *  inode,
struct page *  page,
get_block_t *  get_block,
struct writeback_control *  wbc 
) [static]

Definition at line 1735 of file buffer.c.

struct buffer_head* __bread ( struct block_device *  bdev,
sector_t  block,
unsigned  size 
) [read]

__bread() - reads a specified block and returns the bh : the block_device to read from : number of block : size (in bytes) to read

Reads a specified block, and returns buffer head that contains it. It returns NULL if the block was unreadable.

Definition at line 1526 of file buffer.c.

static struct buffer_head* __bread_slow ( struct buffer_head *  bh  )  [static, read]

Definition at line 1327 of file buffer.c.

void __breadahead ( struct block_device *  bdev,
sector_t  block,
unsigned  size 
)

Definition at line 1506 of file buffer.c.

void __brelse ( struct buffer_head *  buf  ) 

Definition at line 1300 of file buffer.c.

static void __clear_page_buffers ( struct page *  page  )  [static]

Definition at line 95 of file buffer.c.

static void __end_buffer_read_notouch ( struct buffer_head *  bh,
int  uptodate 
) [static]

Definition at line 127 of file buffer.c.

struct buffer_head* __find_get_block ( struct block_device *  bdev,
sector_t  block,
unsigned  size 
) [read]

Definition at line 1464 of file buffer.c.

static struct buffer_head* __find_get_block_slow ( struct block_device *  bdev,
sector_t  block 
) [static, read]

Definition at line 335 of file buffer.c.

struct buffer_head* __getblk ( struct block_device *  bdev,
sector_t  block,
unsigned  size 
) [read]

Definition at line 1492 of file buffer.c.

static struct buffer_head* __getblk_slow ( struct block_device *  bdev,
sector_t  block,
int  size 
) [static, read]

Definition at line 1201 of file buffer.c.

void __lock_buffer ( struct buffer_head *  bh  ) 

Definition at line 70 of file buffer.c.

static void __remove_assoc_queue ( struct buffer_head *  bh  )  [static]

Definition at line 662 of file buffer.c.

static void __set_page_dirty ( struct page *  page,
struct address_space *  mapping,
int  warn 
) [static]

Definition at line 779 of file buffer.c.

int __set_page_dirty_buffers ( struct page *  page  ) 

Definition at line 825 of file buffer.c.

void __wait_on_buffer ( struct buffer_head *  bh  ) 

Definition at line 89 of file buffer.c.

struct buffer_head* alloc_buffer_head ( gfp_t  gfp_flags  )  [read]

Definition at line 3335 of file buffer.c.

struct buffer_head* alloc_page_buffers ( struct page *  page,
unsigned long  size,
int  retry 
) [read]

Definition at line 998 of file buffer.c.

static void attach_nobh_buffers ( struct page *  page,
struct buffer_head *  head 
) [static]

Definition at line 2548 of file buffer.c.

static void bh_lru_install ( struct buffer_head *  bh  )  [static]

Definition at line 1385 of file buffer.c.

int bh_submit_read ( struct buffer_head *  bh  ) 

bh_submit_read - Submit a locked buffer for reading : struct buffer_head

Returns zero on success and -EIO on error.

Definition at line 3405 of file buffer.c.

int bh_uptodate_or_lock ( struct buffer_head *  bh  ) 

bh_uptodate_or_lock - Test whether the buffer is uptodate : struct buffer_head

Return true if the buffer is up-to-date and false, with the buffer locked, if not.

Definition at line 3387 of file buffer.c.

int block_commit_write ( struct page *  page,
unsigned  from,
unsigned  to 
)

Definition at line 2479 of file buffer.c.

void block_invalidatepage ( struct page *  page,
unsigned long  offset 
)

Definition at line 1607 of file buffer.c.

int block_is_partially_uptodate ( struct page *  page,
read_descriptor_t *  desc,
unsigned long  from 
)

Definition at line 2202 of file buffer.c.

int block_page_mkwrite ( struct vm_area_struct *  vma,
struct page *  page,
get_block_t  get_block 
)

Definition at line 2502 of file buffer.c.

int block_prepare_write ( struct page *  page,
unsigned  from,
unsigned  to,
get_block_t *  get_block 
)

Definition at line 2469 of file buffer.c.

int block_read_full_page ( struct page *  page,
get_block_t *  get_block 
)

Definition at line 2248 of file buffer.c.

void block_sync_page ( struct page *  page  ) 

Definition at line 3265 of file buffer.c.

int block_truncate_page ( struct address_space *  mapping,
loff_t  from,
get_block_t *  get_block 
)

Definition at line 2878 of file buffer.c.

int block_write_begin ( struct file *  file,
struct address_space *  mapping,
loff_t  pos,
unsigned  len,
unsigned  flags,
struct page **  pagep,
void **  fsdata,
get_block_t *  get_block 
)

Definition at line 2063 of file buffer.c.

int block_write_end ( struct file *  file,
struct address_space *  mapping,
loff_t  pos,
unsigned  len,
unsigned  copied,
struct page *  page,
void *  fsdata 
)

Definition at line 2122 of file buffer.c.

int block_write_full_page ( struct page *  page,
get_block_t *  get_block,
struct writeback_control *  wbc 
)

Definition at line 2956 of file buffer.c.

static int buffer_busy ( struct buffer_head *  bh  )  [inline, static]

Definition at line 3179 of file buffer.c.

static int buffer_cpu_notify ( struct notifier_block *  self,
unsigned long  action,
void *  hcpu 
) [static]

Definition at line 3372 of file buffer.c.

static void buffer_exit_cpu ( int  cpu  )  [static]

Definition at line 3358 of file buffer.c.

void __init buffer_init ( void   ) 

Definition at line 3433 of file buffer.c.

static void buffer_io_error ( struct buffer_head *  bh  )  [static]

Definition at line 111 of file buffer.c.

static void check_irqs_on ( void   )  [inline, static]

Definition at line 1375 of file buffer.c.

static int cont_expand_zero ( struct file *  file,
struct address_space *  mapping,
loff_t  pos,
loff_t *  bytes 
) [static]

Definition at line 2369 of file buffer.c.

int cont_write_begin ( struct file *  file,
struct address_space *  mapping,
loff_t  pos,
unsigned  len,
unsigned  flags,
struct page **  pagep,
void **  fsdata,
get_block_t *  get_block,
loff_t *  bytes 
)

Definition at line 2442 of file buffer.c.

void create_empty_buffers ( struct page *  page,
unsigned long  blocksize,
unsigned long  b_state 
)

Definition at line 1648 of file buffer.c.

static DEFINE_PER_CPU ( struct  bh_accounting,
bh_accounting   
) [static]

static DEFINE_PER_CPU ( struct  bh_lru,
bh_lrus   
) [static]

static void discard_buffer ( struct buffer_head *  bh  )  [static]

Definition at line 1579 of file buffer.c.

static int drop_buffers ( struct page *  page,
struct buffer_head **  buffers_to_free 
) [static]

Definition at line 3186 of file buffer.c.

static void end_bio_bh_io_sync ( struct bio *  bio,
int  err 
) [static]

Definition at line 3004 of file buffer.c.

static void end_buffer_async_read ( struct buffer_head *  bh,
int  uptodate 
) [static]

Definition at line 462 of file buffer.c.

static void end_buffer_async_write ( struct buffer_head *  bh,
int  uptodate 
) [static]

Definition at line 524 of file buffer.c.

static void end_buffer_read_nobh ( struct buffer_head *  bh,
int  uptodate 
) [static]

Definition at line 2538 of file buffer.c.

void end_buffer_read_sync ( struct buffer_head *  bh,
int  uptodate 
)

Definition at line 142 of file buffer.c.

void end_buffer_write_sync ( struct buffer_head *  bh,
int  uptodate 
)

Definition at line 148 of file buffer.c.

EXPORT_SYMBOL ( unlock_buffer   ) 

EXPORT_SYMBOL ( sync_dirty_buffer   ) 

EXPORT_SYMBOL ( submit_bh   ) 

EXPORT_SYMBOL ( mark_buffer_dirty   ) 

EXPORT_SYMBOL ( ll_rw_block   ) 

EXPORT_SYMBOL ( invalidate_bdev   ) 

EXPORT_SYMBOL ( init_buffer   ) 

EXPORT_SYMBOL ( generic_cont_expand_simple   ) 

EXPORT_SYMBOL ( generic_block_bmap   ) 

EXPORT_SYMBOL ( fsync_bdev   ) 

EXPORT_SYMBOL ( file_fsync   ) 

EXPORT_SYMBOL ( end_buffer_write_sync   ) 

EXPORT_SYMBOL ( end_buffer_read_sync   ) 

EXPORT_SYMBOL ( cont_write_begin   ) 

EXPORT_SYMBOL ( block_write_full_page   ) 

EXPORT_SYMBOL ( block_truncate_page   ) 

EXPORT_SYMBOL ( block_sync_page   ) 

EXPORT_SYMBOL ( block_read_full_page   ) 

EXPORT_SYMBOL ( block_page_mkwrite   ) 

EXPORT_SYMBOL ( block_prepare_write   ) 

EXPORT_SYMBOL ( block_commit_write   ) 

EXPORT_SYMBOL ( __wait_on_buffer   ) 

EXPORT_SYMBOL ( __brelse   ) 

EXPORT_SYMBOL ( __bforget   ) 

EXPORT_SYMBOL ( bh_submit_read   ) 

EXPORT_SYMBOL ( bh_uptodate_or_lock   ) 

EXPORT_SYMBOL ( free_buffer_head   ) 

EXPORT_SYMBOL ( alloc_buffer_head   ) 

EXPORT_SYMBOL ( try_to_free_buffers   ) 

EXPORT_SYMBOL ( nobh_truncate_page   ) 

EXPORT_SYMBOL ( nobh_writepage   ) 

EXPORT_SYMBOL ( nobh_write_end   ) 

EXPORT_SYMBOL ( nobh_write_begin   ) 

EXPORT_SYMBOL ( block_is_partially_uptodate   ) 

EXPORT_SYMBOL ( generic_write_end   ) 

EXPORT_SYMBOL ( block_write_end   ) 

EXPORT_SYMBOL ( block_write_begin   ) 

EXPORT_SYMBOL ( page_zero_new_buffers   ) 

EXPORT_SYMBOL ( unmap_underlying_metadata   ) 

EXPORT_SYMBOL ( create_empty_buffers   ) 

EXPORT_SYMBOL ( block_invalidatepage   ) 

EXPORT_SYMBOL ( set_bh_page   ) 

EXPORT_SYMBOL ( __bread   ) 

EXPORT_SYMBOL ( __breadahead   ) 

EXPORT_SYMBOL ( __getblk   ) 

EXPORT_SYMBOL ( __find_get_block   ) 

EXPORT_SYMBOL ( invalidate_inode_buffers   ) 

EXPORT_SYMBOL ( __set_page_dirty_buffers   ) 

EXPORT_SYMBOL ( mark_buffer_dirty_inode   ) 

EXPORT_SYMBOL ( sync_mapping_buffers   ) 

EXPORT_SYMBOL ( mark_buffer_async_write   ) 

EXPORT_SYMBOL ( thaw_bdev   ) 

EXPORT_SYMBOL ( freeze_bdev   ) 

EXPORT_SYMBOL ( sync_blockdev   ) 

EXPORT_SYMBOL ( __lock_buffer   ) 

EXPORT_SYMBOL_GPL ( invalidate_bh_lrus   ) 

EXPORT_SYMBOL_GPL ( alloc_page_buffers   ) 

void free_buffer_head ( struct buffer_head *  bh  ) 

Definition at line 3348 of file buffer.c.

static void free_more_memory ( void   )  [static]

Definition at line 436 of file buffer.c.

struct super_block* freeze_bdev ( struct block_device *  bdev  )  [read]

freeze_bdev -- lock a filesystem and force it into a consistent state : blockdevice to lock

This takes the block device bd_mount_sem to make sure no new mounts happen on bdev until thaw_bdev() is called. If a superblock is found on this device, we take the s_umount semaphore on it to make sure nobody unmounts until the snapshot creation is done. The reference counter (bd_fsfreeze_count) guarantees that only the last unfreeze process can unfreeze the frozen filesystem actually when multiple freeze requests arrive simultaneously. It counts up in freeze_bdev() and count down in thaw_bdev(). When it becomes 0, thaw_bdev() will unfreeze actually.

Definition at line 222 of file buffer.c.

int fsync_bdev ( struct block_device *  bdev  ) 

Definition at line 192 of file buffer.c.

static int fsync_buffers_list ( spinlock_t *  lock,
struct list_head *  list 
) [static]

Definition at line 871 of file buffer.c.

sector_t generic_block_bmap ( struct address_space *  mapping,
sector_t  block,
get_block_t *  get_block 
)

Definition at line 2992 of file buffer.c.

int generic_cont_expand_simple ( struct inode *  inode,
loff_t  size 
)

Definition at line 2339 of file buffer.c.

int generic_write_end ( struct file *  file,
struct address_space *  mapping,
loff_t  pos,
unsigned  len,
unsigned  copied,
struct page *  page,
void *  fsdata 
)

Definition at line 2158 of file buffer.c.

static int grow_buffers ( struct block_device *  bdev,
sector_t  block,
int  size 
) [static]

Definition at line 1164 of file buffer.c.

static struct page* grow_dev_page ( struct block_device *  bdev,
sector_t  block,
pgoff_t  index,
int  size 
) [static, read]

Definition at line 1105 of file buffer.c.

void init_buffer ( struct buffer_head *  bh,
bh_end_io_t *  handler,
void *  private 
) [inline]

Definition at line 50 of file buffer.c.

static void init_buffer_head ( void *  data  )  [static]

Definition at line 3425 of file buffer.c.

static void init_page_buffers ( struct page *  page,
struct block_device *  bdev,
sector_t  block,
int  size 
) [static]

Definition at line 1078 of file buffer.c.

int inode_has_buffers ( struct inode *  inode  ) 

Definition at line 671 of file buffer.c.

void invalidate_bdev ( struct block_device *  bdev  ) 

Definition at line 420 of file buffer.c.

static void invalidate_bh_lru ( void *  arg  )  [static]

Definition at line 1541 of file buffer.c.

void invalidate_bh_lrus ( void   ) 

Definition at line 1553 of file buffer.c.

void invalidate_inode_buffers ( struct inode *  inode  ) 

Definition at line 945 of file buffer.c.

static void link_dev_buffers ( struct page *  page,
struct buffer_head *  head 
) [inline, static]

Definition at line 1061 of file buffer.c.

void ll_rw_block ( int  rw,
int  nr,
struct buffer_head *  bhs[] 
)

ll_rw_block: low-level access to block devices (DEPRECATED) : whether to READ or WRITE or SWRITE or maybe READA (readahead) : number of &struct buffer_heads in the array : array of pointers to &struct buffer_head

ll_rw_block() takes an array of pointers to &struct buffer_heads, and requests an I/O operation on them, either a READ or a WRITE. The third SWRITE is like WRITE only we make sure that the *current* data in buffers are sent to disk. The fourth READA option is described in the documentation for generic_make_request() which ll_rw_block() calls.

This function drops any buffer that it cannot get a lock on (with the BH_Lock state bit) unless SWRITE is required, any buffer that appears to be clean when doing a write request, and any buffer that appears to be up-to-date when doing read request. Further it marks as clean buffers that are processed for writing (the buffer cache won't assume that they are actually clean until the buffer gets unlocked).

ll_rw_block sets b_end_io to simple completion handler that marks the buffer up-to-date (if approriate), unlocks the buffer and wakes any waiters.

All of the buffers must be for the same device, and must also be a multiple of the current approved size for the device.

Definition at line 3097 of file buffer.c.

static struct buffer_head* lookup_bh_lru ( struct block_device *  bdev,
sector_t  block,
unsigned  size 
) [static, read]

Definition at line 1428 of file buffer.c.

static void mark_buffer_async_read ( struct buffer_head *  bh  )  [static]

Definition at line 596 of file buffer.c.

void mark_buffer_async_write ( struct buffer_head *  bh  ) 

Definition at line 602 of file buffer.c.

void mark_buffer_dirty ( struct buffer_head *  bh  ) 

mark_buffer_dirty - mark a buffer_head as needing writeout : the buffer_head to mark dirty

mark_buffer_dirty() will set the dirty bit against the buffer, then set its backing page dirty, then tag the page as dirty in its address_space's radix tree and then attach the address_space's inode to its superblock's dirty inode list.

mark_buffer_dirty() is atomic. It takes bh->b_page->mapping->private_lock, mapping->tree_lock and the global inode_lock.

Definition at line 1266 of file buffer.c.

void mark_buffer_dirty_inode ( struct buffer_head *  bh,
struct inode *  inode 
)

Definition at line 751 of file buffer.c.

int nobh_truncate_page ( struct address_space *  mapping,
loff_t  from,
get_block_t *  get_block 
)

Definition at line 2802 of file buffer.c.

int nobh_write_begin ( struct file *  file,
struct address_space *  mapping,
loff_t  pos,
unsigned  len,
unsigned  flags,
struct page **  pagep,
void **  fsdata,
get_block_t *  get_block 
)

Definition at line 2571 of file buffer.c.

int nobh_write_end ( struct file *  file,
struct address_space *  mapping,
loff_t  pos,
unsigned  len,
unsigned  copied,
struct page *  page,
void *  fsdata 
)

Definition at line 2716 of file buffer.c.

int nobh_writepage ( struct page *  page,
get_block_t *  get_block,
struct writeback_control *  wbc 
)

Definition at line 2756 of file buffer.c.

static int osync_buffers_list ( spinlock_t *  lock,
struct list_head *  list 
) [static]

Definition at line 686 of file buffer.c.

void page_zero_new_buffers ( struct page *  page,
unsigned  from,
unsigned  to 
)

Definition at line 1903 of file buffer.c.

static int quiet_error ( struct buffer_head *  bh  )  [static]

Definition at line 103 of file buffer.c.

static void recalc_bh_state ( void   )  [static]

Definition at line 3322 of file buffer.c.

int remove_inode_buffers ( struct inode *  inode  ) 

Definition at line 966 of file buffer.c.

void set_bh_page ( struct buffer_head *  bh,
struct page *  page,
unsigned long  offset 
)

Definition at line 1561 of file buffer.c.

int submit_bh ( int  rw,
struct buffer_head *  bh 
)

Definition at line 3020 of file buffer.c.

int sync_blockdev ( struct block_device *  bdev  ) 

Definition at line 172 of file buffer.c.

static int sync_buffer ( void *  word  )  [static]

Definition at line 56 of file buffer.c.

int sync_dirty_buffer ( struct buffer_head *  bh  ) 

Definition at line 3136 of file buffer.c.

int sync_mapping_buffers ( struct address_space *  mapping  ) 

sync_mapping_buffers - write out & wait upon a mapping's "associated" buffers : the mapping which wants those buffers written

Starts I/O against the buffers at mapping->private_list, and waits upon that I/O.

Basically, this is a convenience function for fsync(). is a file or directory which needs those buffers to be written for a successful fsync().

Definition at line 722 of file buffer.c.

SYSCALL_DEFINE2 ( bdflush  ,
int  ,
func  ,
long  ,
data   
)

Definition at line 3282 of file buffer.c.

int thaw_bdev ( struct block_device *  bdev,
struct super_block *  sb 
)

thaw_bdev -- unlock filesystem : blockdevice to unlock : associated superblock

Unlocks the filesystem and marks it writeable again after freeze_bdev().

Definition at line 278 of file buffer.c.

int try_to_free_buffers ( struct page *  page  ) 

Definition at line 3214 of file buffer.c.

void unlock_buffer ( struct buffer_head *  bh  ) 

Definition at line 77 of file buffer.c.

void unmap_underlying_metadata ( struct block_device *  bdev,
sector_t  block 
)

Definition at line 1694 of file buffer.c.

void write_boundary_block ( struct block_device *  bdev,
sector_t  bblock,
unsigned  blocksize 
)

Definition at line 740 of file buffer.c.


Variable Documentation

struct kmem_cache* bh_cachep [static]

Definition at line 3305 of file buffer.c.

Definition at line 3313 of file buffer.c.

int max_buffer_heads [static]

Definition at line 3311 of file buffer.c.


Generated on Wed Apr 11 06:39:15 2012 for DDE - The L4 Device Driver Environment by  doxygen 1.5.6