Linux Kernel
3.7.1
|
#include "ext2.h"
#include <linux/quotaops.h>
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/buffer_head.h>
#include <linux/capability.h>
Go to the source code of this file.
Macros | |
#define | in_range(b, first, len) ((b) >= (first) && (b) <= (first) + (len) - 1) |
#define | rsv_window_dump(root, verbose) __rsv_window_dump((root), (verbose), __func__) |
Functions | |
struct ext2_group_desc * | ext2_get_group_desc (struct super_block *sb, unsigned int block_group, struct buffer_head **bh) |
void | ext2_rsv_window_add (struct super_block *sb, struct ext2_reserve_window_node *rsv) |
void | ext2_init_block_alloc_info (struct inode *inode) |
void | ext2_discard_reservation (struct inode *inode) |
void | ext2_free_blocks (struct inode *inode, unsigned long block, unsigned long count) |
ext2_fsblk_t | ext2_new_blocks (struct inode *inode, ext2_fsblk_t goal, unsigned long *count, int *errp) |
ext2_fsblk_t | ext2_new_block (struct inode *inode, unsigned long goal, int *errp) |
unsigned long | ext2_count_free_blocks (struct super_block *sb) |
int | ext2_bg_has_super (struct super_block *sb, int group) |
unsigned long | ext2_bg_num_gdb (struct super_block *sb, int group) |
int ext2_bg_has_super | ( | struct super_block * | sb, |
int | group | ||
) |
unsigned long ext2_bg_num_gdb | ( | struct super_block * | sb, |
int | group | ||
) |
unsigned long ext2_count_free_blocks | ( | struct super_block * | sb | ) |
ext2_discard_reservation() : inode
Discard(free) block reservation window on last file close, or truncate or at last iput().
It is being called in three cases: ext2_release_file(): last writer closes the file ext2_clear_inode(): last iput(), when nobody links to this file. ext2_truncate(): when the block indirect map is about to change.
ext2_free_blocks() – Free given blocks and update quota and i_blocks : inode : start physical block to free : number of blocks to free
|
read |
ext2_init_block_alloc_info() : file inode structure
Allocate and initialize the reservation window structure, and link the window to the ext2 inode structure at last
The reservation window structure is only dynamically allocated and linked to ext2 inode the first time the open file needs a new block. So, before every ext2_new_block(s) call, for regular files, we should check whether the reservation window structure exists or not. In the latter case, this function is called. Fail to do so will result in block reservation being turned off for that open file.
This function is called from ext2_get_blocks_handle(), also called when setting the reservation window size through ioctl before the file is open for write (needs block allocation).
Needs truncate_mutex protection prior to calling this function.
ext2_fsblk_t ext2_new_block | ( | struct inode * | inode, |
unsigned long | goal, | ||
int * | errp | ||
) |
ext2_fsblk_t ext2_new_blocks | ( | struct inode * | inode, |
ext2_fsblk_t | goal, | ||
unsigned long * | count, | ||
int * | errp | ||
) |
void ext2_rsv_window_add | ( | struct super_block * | sb, |
struct ext2_reserve_window_node * | rsv | ||
) |