sys/src/vmsbuffer.c File Reference

#include <linux/config.h>
#include <linux/sched.h>
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/locks.h>
#include <linux/errno.h>
#include <linux/swap.h>
#include <linux/swapctl.h>
#include <linux/smp_lock.h>
#include <linux/vmalloc.h>
#include <linux/blkdev.h>
#include <linux/sysrq.h>
#include <linux/file.h>
#include <linux/init.h>
#include <linux/quotaops.h>
#include <linux/iobuf.h>
#include <linux/highmem.h>
#include <linux/module.h>
#include <linux/completion.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <asm/bitops.h>
#include <asm/mmu_context.h>
#include <asm/hw_irq.h>
#include <fcbdef.h>
#include <pridef.h>
#include <iodef.h>
#include <misc.h>
#include <rvtdef.h>
#include <vcbdef.h>
#include <ucbdef.h>
#include <linux/ext2_fs.h>
#include <misc_routines.h>
#include "../../ext2/src/x2p.h"

Go to the source code of this file.

Classes

union  bdflush_param

Defines

#define EXT2_EF   30
#define MAX_BUF_PER_PAGE   (PAGE_CACHE_SIZE / 512)
#define NR_RESERVED   (10*MAX_BUF_PER_PAGE)
#define MAX_UNUSED_BUFFERS   NR_RESERVED+20
#define BH_ENTRY(list)   list_entry((list), struct buffer_head, b_inode_buffers)
#define N_PARAM   9
#define BUFFER_BUSY_BITS   ((1<<BH_Dirty) | (1<<BH_Lock))
#define buffer_busy(bh)   (atomic_read(&(bh)->b_count) | ((bh)->b_state & BUFFER_BUSY_BITS))

Functions

void fastcall unlock_buffer (struct buffer_head *bh)
void __wait_on_buffer (struct buffer_head *bh)
void end_buffer_io_sync (struct buffer_head *bh, int uptodate)
int sync_buffers (kdev_t dev, int wait)
int fsync_super (struct super_block *sb)
int fsync_no_super (kdev_t dev)
int fsync_dev (kdev_t dev)
void sync_dev (kdev_t dev)
asmlinkage long sys_sync (void)
int file_fsync (struct file *filp, struct dentry *dentry, int datasync)
asmlinkage long sys_fsync (unsigned int fd)
asmlinkage long sys_fdatasync (unsigned int fd)
void init_buffer (struct buffer_head *bh, bh_end_io_t *handler, void *private)
struct buffer_head * getblk (kdev_t dev, int block, int size)
void balance_dirty (void)
void fastcall __mark_dirty (struct buffer_head *bh)
void fastcall __mark_buffer_dirty (struct buffer_head *bh)
void fastcall mark_buffer_dirty (struct buffer_head *bh)
void set_buffer_flushtime (struct buffer_head *bh)
 EXPORT_SYMBOL (set_buffer_flushtime)
void __brelse (struct buffer_head *buf)
void __bforget (struct buffer_head *buf)
struct buffer_head * bread (kdev_t dev, int block, int size)
int try_to_release_page (struct page *page, int gfp_mask)
int discard_bh_page (struct page *page, unsigned long offset, int drop_pagecache)
int block_read_full_page2 (struct _fcb *inode, struct page *page, unsigned long pageno)
int block_read_full_page3 (struct _fcb *fcb, struct page *page, unsigned long pageno)
int generic_cont_expand (struct _fcb *inode, loff_t size)
int cont_prepare_write (struct page *page, unsigned offset, unsigned to, get_block_t *get_block, unsigned long *bytes)
int block_prepare_write2 (struct _fcb *inode, struct page *page, unsigned from, unsigned to, unsigned long pageno)
int block_commit_write2 (struct _fcb *inode, struct page *page, unsigned from, unsigned to, unsigned long pageno)
int generic_commit_write2 (struct _fcb *inode, struct page *page, unsigned from, unsigned to, unsigned long pageno)
int block_truncate_page (struct address_space *mapping, loff_t from, get_block_t *get_block)
int block_write_full_page2 (struct _fcb *inode, struct page *page, unsigned long pageno)
int block_write_full_page3 (struct _fcb *fcb, struct page *page, unsigned long pageno)
int generic_block_bmap (struct address_space *mapping, long block, get_block_t *get_block)
int generic_direct_IO (int rw, struct _fcb *inode, struct kiobuf *iobuf, unsigned long blocknr, int blocksize, get_block_t *get_block)
int brw_kiovec (int rw, int nr, struct kiobuf *iovec[], kdev_t dev, unsigned long b[], int size)
int brw_page (int rw, struct page *page, kdev_t dev, int b[], int size)
int block_symlink (struct _fcb *inode, const char *symname, int len)
void show_buffers (void)
void __init buffer_init (unsigned long mempages)
 DECLARE_WAIT_QUEUE_HEAD (bdflush_wait)
int block_sync_page (struct page *page)
asmlinkage long sys_bdflush (int func, long data)

Variables

atomic_t buffermem_pages = ATOMIC_INIT(0)
union bdflush_param bdf_prm
int bdflush_min [N_PARAM] = { 0, 10, 5, 25, 0, 1*HZ, 0, 0, 0}
int bdflush_max [N_PARAM] = {100,50000, 20000, 20000,10000*HZ, 6000*HZ, 100, 0, 0}


Define Documentation

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

Definition at line 86 of file vmsbuffer.c.

#define buffer_busy ( bh   )     (atomic_read(&(bh)->b_count) | ((bh)->b_state & BUFFER_BUSY_BITS))

Definition at line 1600 of file vmsbuffer.c.

#define BUFFER_BUSY_BITS   ((1<<BH_Dirty) | (1<<BH_Lock))

Definition at line 1599 of file vmsbuffer.c.

#define EXT2_EF   30

Definition at line 75 of file vmsbuffer.c.

Referenced by block_read_full_page2(), block_read_full_page3(), bread(), and generic_direct_IO().

#define MAX_BUF_PER_PAGE   (PAGE_CACHE_SIZE / 512)

Definition at line 77 of file vmsbuffer.c.

#define MAX_UNUSED_BUFFERS   NR_RESERVED+20

Definition at line 79 of file vmsbuffer.c.

#define N_PARAM   9

Definition at line 119 of file vmsbuffer.c.

Referenced by sys_bdflush().

#define NR_RESERVED   (10*MAX_BUF_PER_PAGE)

Definition at line 78 of file vmsbuffer.c.


Function Documentation

void __bforget ( struct buffer_head *  buf  ) 

Definition at line 511 of file vmsbuffer.c.

References __brelse().

void __brelse ( struct buffer_head *  buf  ) 

Definition at line 494 of file vmsbuffer.c.

References kfree().

Referenced by __bforget().

void fastcall __mark_buffer_dirty ( struct buffer_head *  bh  ) 

Definition at line 471 of file vmsbuffer.c.

References __mark_dirty().

void fastcall __mark_dirty ( struct buffer_head *  bh  )  [inline]

Definition at line 463 of file vmsbuffer.c.

References bdflush_param::age_buffer, bdflush_param::b_un, and bdf_prm.

Referenced by __mark_buffer_dirty(), and mark_buffer_dirty().

void __wait_on_buffer ( struct buffer_head *  bh  ) 

Definition at line 165 of file vmsbuffer.c.

References schedule().

void balance_dirty ( void   ) 

Definition at line 436 of file vmsbuffer.c.

Referenced by mark_buffer_dirty().

int block_commit_write2 ( struct _fcb inode,
struct page *  page,
unsigned  from,
unsigned  to,
unsigned long  pageno 
)

Definition at line 1096 of file vmsbuffer.c.

Referenced by generic_cont_expand().

int block_prepare_write2 ( struct _fcb inode,
struct page *  page,
unsigned  from,
unsigned  to,
unsigned long  pageno 
)

Definition at line 1084 of file vmsbuffer.c.

Referenced by block_symlink(), generic_cont_expand(), and generic_file_write().

int block_read_full_page2 ( struct _fcb inode,
struct page *  page,
unsigned long  pageno 
)

int block_read_full_page3 ( struct _fcb fcb,
struct page *  page,
unsigned long  pageno 
)

int block_symlink ( struct _fcb inode,
const char *  symname,
int  len 
)

int block_sync_page ( struct page *  page  ) 

Definition at line 1678 of file vmsbuffer.c.

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

Definition at line 1117 of file vmsbuffer.c.

References e2_map_vbn(), e2_search_fcb(), myqio(), _vcb::vcb_l_cache, and vms_block_factor.

int block_write_full_page2 ( struct _fcb inode,
struct page *  page,
unsigned long  pageno 
)

Definition at line 1175 of file vmsbuffer.c.

References e2_search_fcb(), and _fcb::fcb_l_filesize.

int block_write_full_page3 ( struct _fcb fcb,
struct page *  page,
unsigned long  pageno 
)

Definition at line 1215 of file vmsbuffer.c.

References _fcb::fcb_l_filesize, and _fcb::fcb_l_primfcb.

Referenced by mmg_purgempl().

struct buffer_head* bread ( kdev_t  dev,
int  block,
int  size 
) [read]

bread() - reads a specified block and returns the bh : 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 526 of file vmsbuffer.c.

References dev2chan(), exe_qiow(), EXT2_EF, init_buffer(), and kmalloc().

int brw_kiovec ( int  rw,
int  nr,
struct kiobuf *  iovec[],
kdev_t  dev,
unsigned long  b[],
int  size 
)

Definition at line 1414 of file vmsbuffer.c.

References init_buffer(), map, and vms_submit_bh().

int brw_page ( int  rw,
struct page *  page,
kdev_t  dev,
int  b[],
int  size 
)

Definition at line 1552 of file vmsbuffer.c.

void __init buffer_init ( unsigned long  mempages  ) 

Definition at line 1664 of file vmsbuffer.c.

int cont_prepare_write ( struct page *  page,
unsigned  offset,
unsigned  to,
get_block_t *  get_block,
unsigned long *  bytes 
)

Definition at line 988 of file vmsbuffer.c.

References _vcb::vcb_l_cache.

DECLARE_WAIT_QUEUE_HEAD ( bdflush_wait   ) 

int discard_bh_page ( struct page *  page,
unsigned long  offset,
int  drop_pagecache 
)

Definition at line 569 of file vmsbuffer.c.

void end_buffer_io_sync ( struct buffer_head *  bh,
int  uptodate 
)

Definition at line 188 of file vmsbuffer.c.

References unlock_buffer().

EXPORT_SYMBOL ( set_buffer_flushtime   ) 

int file_fsync ( struct file *  filp,
struct dentry *  dentry,
int  datasync 
)

Definition at line 289 of file vmsbuffer.c.

References sync_buffers().

int fsync_dev ( kdev_t  dev  ) 

Definition at line 253 of file vmsbuffer.c.

References sync_buffers().

Referenced by sync_dev(), and sys_sync().

int fsync_no_super ( kdev_t  dev  ) 

Definition at line 247 of file vmsbuffer.c.

References sync_buffers().

int fsync_super ( struct super_block *  sb  ) 

Definition at line 226 of file vmsbuffer.c.

References sync_buffers().

int generic_block_bmap ( struct address_space *  mapping,
long  block,
get_block_t *  get_block 
)

Definition at line 1255 of file vmsbuffer.c.

int generic_commit_write2 ( struct _fcb inode,
struct page *  page,
unsigned  from,
unsigned  to,
unsigned long  pageno 
)

Definition at line 1103 of file vmsbuffer.c.

References _fcb::fcb_l_filesize.

Referenced by block_symlink(), and generic_file_write().

int generic_cont_expand ( struct _fcb inode,
loff_t  size 
)

Definition at line 938 of file vmsbuffer.c.

References block_commit_write2(), block_prepare_write2(), and _vcb::vcb_l_cache.

int generic_direct_IO ( int  rw,
struct _fcb inode,
struct kiobuf *  iobuf,
unsigned long  blocknr,
int  blocksize,
get_block_t *  get_block 
)

struct buffer_head* getblk ( kdev_t  dev,
int  block,
int  size 
) [read]

Definition at line 414 of file vmsbuffer.c.

References init_buffer(), and kmalloc().

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

Definition at line 397 of file vmsbuffer.c.

Referenced by bread(), brw_kiovec(), and getblk().

void fastcall mark_buffer_dirty ( struct buffer_head *  bh  ) 

Definition at line 477 of file vmsbuffer.c.

References __mark_dirty(), and balance_dirty().

void set_buffer_flushtime ( struct buffer_head *  bh  ) 

Definition at line 485 of file vmsbuffer.c.

References bdflush_param::age_buffer, bdflush_param::b_un, and bdf_prm.

void show_buffers ( void   ) 

Definition at line 1604 of file vmsbuffer.c.

References buffermem_pages.

int sync_buffers ( kdev_t  dev,
int  wait 
)

Definition at line 205 of file vmsbuffer.c.

Referenced by file_fsync(), fsync_dev(), fsync_no_super(), and fsync_super().

void sync_dev ( kdev_t  dev  ) 

Definition at line 274 of file vmsbuffer.c.

References fsync_dev().

asmlinkage long sys_bdflush ( int  func,
long  data 
)

Definition at line 1688 of file vmsbuffer.c.

References bdf_prm, bdflush_max, bdflush_min, bdflush_param::data, and N_PARAM.

asmlinkage long sys_fdatasync ( unsigned int  fd  ) 

Definition at line 359 of file vmsbuffer.c.

References filemap_fdatasync(), and filemap_fdatawait().

asmlinkage long sys_fsync ( unsigned int  fd  ) 

Definition at line 318 of file vmsbuffer.c.

References filemap_fdatasync(), and filemap_fdatawait().

asmlinkage long sys_sync ( void   ) 

Definition at line 279 of file vmsbuffer.c.

References fsync_dev().

int try_to_release_page ( struct page *  page,
int  gfp_mask 
)

try_to_release_page - release old fs-specific metadata on a page

Definition at line 557 of file vmsbuffer.c.

void fastcall unlock_buffer ( struct buffer_head *  bh  ) 

Definition at line 145 of file vmsbuffer.c.

Referenced by end_buffer_io_sync().


Variable Documentation

int bdflush_max[N_PARAM] = {100,50000, 20000, 20000,10000*HZ, 6000*HZ, 100, 0, 0}

Definition at line 143 of file vmsbuffer.c.

Referenced by sys_bdflush().

int bdflush_min[N_PARAM] = { 0, 10, 5, 25, 0, 1*HZ, 0, 0, 0}

Definition at line 142 of file vmsbuffer.c.

Referenced by sys_bdflush().

atomic_t buffermem_pages = ATOMIC_INIT(0)

Definition at line 112 of file vmsbuffer.c.

Referenced by show_buffers().


Generated on Fri Oct 9 10:26:05 2009 for FreeVMS by  doxygen 1.5.5