Linux Kernel
3.7.1
|
#include <linux/buffer_head.h>
#include <linux/blockgroup_lock.h>
#include "nilfs.h"
#include "page.h"
Go to the source code of this file.
Data Structures | |
struct | nilfs_shadow_map |
struct | nilfs_mdt_info |
Macros | |
#define | NILFS_MDT_GFP (__GFP_WAIT | __GFP_IO | __GFP_HIGHMEM) |
#define | nilfs_mdt_bgl_lock(inode, bg) (&NILFS_MDT(inode)->mi_bgl->locks[(bg) & (NR_BG_LOCKS-1)].lock) |
Functions | |
int | nilfs_mdt_get_block (struct inode *, unsigned long, int, void(*init_block)(struct inode *, struct buffer_head *, void *), struct buffer_head **) |
int | nilfs_mdt_delete_block (struct inode *, unsigned long) |
int | nilfs_mdt_forget_block (struct inode *, unsigned long) |
int | nilfs_mdt_mark_block_dirty (struct inode *, unsigned long) |
int | nilfs_mdt_fetch_dirty (struct inode *) |
int | nilfs_mdt_init (struct inode *inode, gfp_t gfp_mask, size_t objsz) |
void | nilfs_mdt_set_entry_size (struct inode *, unsigned, unsigned) |
int | nilfs_mdt_setup_shadow_map (struct inode *inode, struct nilfs_shadow_map *shadow) |
int | nilfs_mdt_save_to_shadow_map (struct inode *inode) |
void | nilfs_mdt_restore_from_shadow_map (struct inode *inode) |
void | nilfs_mdt_clear_shadow_map (struct inode *inode) |
int | nilfs_mdt_freeze_buffer (struct inode *inode, struct buffer_head *bh) |
struct buffer_head * | nilfs_mdt_get_frozen_buffer (struct inode *inode, struct buffer_head *bh) |
#define NILFS_MDT_GFP (__GFP_WAIT | __GFP_IO | __GFP_HIGHMEM) |
nilfs_mdt_forget_block - discard dirty state and try to remove the page : inode of the meta data file : block offset
nilfs_mdt_forget_block() clears a dirty flag of the specified buffer, and tries to release the page including the buffer from a page cache.
Return Value: On success, 0 is returned. On error, one of the following negative error code is returned.
%-EBUSY - page has an active buffer.
%-ENOENT - page cache has no page addressed by the offset.
int nilfs_mdt_get_block | ( | struct inode * | inode, |
unsigned long | blkoff, | ||
int | create, | ||
void(*)(struct inode *, struct buffer_head *, void *) | init_block, | ||
struct buffer_head ** | out_bh | ||
) |
nilfs_mdt_get_block - read or create a buffer on meta data file. : inode of the meta data file : block offset : create flag : initializer used for newly allocated block : output of a pointer to the buffer_head
nilfs_mdt_get_block() looks up the specified buffer and tries to create a new buffer if is not zero. On success, the returned buffer is assured to be either existing or formatted using a buffer lock on success. is substituted only when zero is returned.
Return Value: On success, it returns 0. On error, the following negative error code is returned.
%-ENOMEM - Insufficient memory available.
%-EIO - I/O error
%-ENOENT - the specified block does not exist (hole block)
%-EROFS - Read only filesystem (for create mode)
nilfs_mdt_mark_block_dirty - mark a block on the meta data file dirty. : inode of the meta data file : block offset
Return Value: On success, it returns 0. On error, the following negative error code is returned.
%-ENOMEM - Insufficient memory available.
%-EIO - I/O error
%-ENOENT - the specified block does not exist (hole block)