Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4611386
  • 博文数量: 385
  • 博客积分: 21208
  • 博客等级: 上将
  • 技术积分: 4393
  • 用 户 组: 普通用户
  • 注册时间: 2006-09-30 13:40
文章分类

全部博文(385)

文章存档

2015年(1)

2014年(3)

2012年(16)

2011年(42)

2010年(1)

2009年(2)

2008年(34)

2007年(188)

2006年(110)

分类: LINUX

2011-03-17 23:12:34

LIST_HEAD(name)  定义name 链表,并初始化。
HLIST_HEAD(name)  定义name 哈希链表,并初始化。


init_waitqueue_head
add_wait_queue
add_wait_queue_exclusive
remove_wait_queue
prepare_to_wait
prepare_to_wait_exclusive
finish_wait
autoremove_wake_function
wake_bit_function
__wait_on_bit
out_of_line_wait_on_bit
__wait_on_bit_lock
out_of_line_wait_on_bit_lock
__wake_up_bit
wake_up_bit
bit_waitqueue         a standard hashed waitqueue table for generic use

 int wait_on_bit(void *word, int bit,
int (*action)(void *), unsigned mode)   wait for a bit to be cleared
用法详见:
static void __wait_on_freeing_inode(struct inode *inode)
{
wait_queue_head_t *wq;
DEFINE_WAIT_BIT(wait, &inode->i_state, __I_LOCK);
wq = bit_waitqueue(&inode->i_state, __I_LOCK);
prepare_to_wait(wq, &wait.wait, TASK_UNINTERRUPTIBLE);
spin_unlock(&inode_lock);
schedule();
finish_wait(wq, &wait.wait);
spin_lock(&inode_lock);
}

static inline void wait_on_inode(struct inode *inode)
{
might_sleep();
wait_on_bit(&inode->i_state, __I_LOCK, inode_wait,
TASK_UNINTERRUPTIBLE);
}


inode的内存cache :inode_hashtable  全局哈希链表

/*
 * second extended-fs super-block data in memory
 */
struct ext2_sb_info 

计算方法:ext2_get_group_desc


/*
 * second extended file system inode data in memory
 */
struct ext2_inode_info {


new_inode->alloc_inode  ,给inode->i_mapping 赋值


更新超级块,使用struct writeback_control 样例:

int ext2_sync_inode(struct inode *inode)
{
struct writeback_control wbc = {
.sync_mode = WB_SYNC_ALL,
.nr_to_write = 0, /* sys_fsync did this */
};
return sync_inode(inode, &wbc);
}

filemap_fdatawait - wait for all under-writeback pages to complete


/*
 * Track a single file's readahead state
 */
struct file_ra_state 

预读接口
default_backing_dev_info
file_ra_state_init
page_cache_sync_readahead
page_cache_async_readahead


Page_cache接口
filemap_fdatawrite
filemap_flush
sync_page_range
sync_page_range_nolock
filemap_fdatawait
filemap_write_and_wait
add_to_page_cache
__page_cache_alloc
wait_on_page_bit
unlock_page
end_page_writeback
__lock_page
find_get_page
find_lock_page
find_or_create_page
find_get_pages_contig
find_get_pages_tag
grab_cache_page_nowait
do_generic_mapping_read
generic_segment_checks
generic_file_aio_read
filemap_fault
generic_file_mmap
generic_file_readonly_mmap
read_cache_page_async
read_cache_page
should_remove_suid
remove_suid
iov_iter_copy_from_user_atomic
iov_iter_copy_from_user
iov_iter_advance
iov_iter_fault_in_readable
iov_iter_single_seg_count
generic_write_checks
pagecache_write_begin
pagecache_write_end
generic_file_direct_write
__grab_cache_page
generic_file_buffered_write
generic_file_aio_write_nolock
generic_file_aio_write
try_to_release_page

阅读(2358) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~