|
Linux Kernel
3.7.1
|
#include <linux/pagemap.h>#include <linux/buffer_head.h>#include <linux/writeback.h>#include <linux/bio.h>#include <linux/completion.h>#include <linux/blkdev.h>#include <linux/backing-dev.h>#include <linux/freezer.h>#include <linux/kthread.h>#include <linux/crc32.h>#include <linux/pagevec.h>#include <linux/slab.h>#include "nilfs.h"#include "btnode.h"#include "page.h"#include "segment.h"#include "sufile.h"#include "cpfile.h"#include "ifile.h"#include "segbuf.h"Go to the source code of this file.
Data Structures | |
| struct | nilfs_sc_operations |
| struct | nilfs_segctor_wait_request |
Macros | |
| #define | SC_N_INODEVEC 16 /* Size of locally allocated inode vector */ |
| #define | SC_MAX_SEGDELTA |
| #define | NILFS_CF_NODE 0x0001 /* Collecting node blocks */ |
| #define | NILFS_CF_IFILE_STARTED 0x0002 /* IFILE stage has started */ |
| #define | NILFS_CF_SUFREED 0x0004 /* segment usages has been freed */ |
| #define | NILFS_CF_HISTORY_MASK (NILFS_CF_IFILE_STARTED | NILFS_CF_SUFREED) |
| #define | nilfs_cnt32_gt(a, b) |
| #define | nilfs_cnt32_ge(a, b) |
| #define | nilfs_cnt32_lt(a, b) nilfs_cnt32_gt(b, a) |
| #define | nilfs_cnt32_le(a, b) nilfs_cnt32_ge(b, a) |
| #define | FLUSH_FILE_BIT (0x1) /* data file only */ |
| #define | FLUSH_DAT_BIT (1 << NILFS_DAT_INO) /* DAT only */ |
Enumerations | |
| enum | { SC_LSEG_SR = 1, SC_LSEG_DSYNC, SC_FLUSH_FILE, SC_FLUSH_DAT } |
| enum | { NILFS_ST_INIT = 0, NILFS_ST_GC, NILFS_ST_FILE, NILFS_ST_IFILE, NILFS_ST_CPFILE, NILFS_ST_SUFILE, NILFS_ST_DAT, NILFS_ST_SR, NILFS_ST_DSYNC, NILFS_ST_DONE } |
Functions | |
| int | nilfs_transaction_begin (struct super_block *sb, struct nilfs_transaction_info *ti, int vacancy_check) |
| int | nilfs_transaction_commit (struct super_block *sb) |
| void | nilfs_transaction_abort (struct super_block *sb) |
| void | nilfs_relax_pressure_in_lock (struct super_block *sb) |
| void | nilfs_flush_segment (struct super_block *sb, ino_t ino) |
| int | nilfs_construct_segment (struct super_block *sb) |
| int | nilfs_construct_dsync_segment (struct super_block *sb, struct inode *inode, loff_t start, loff_t end) |
| int | nilfs_clean_segments (struct super_block *sb, struct nilfs_argv *argv, void **kbufs) |
| int | nilfs_attach_log_writer (struct super_block *sb, struct nilfs_root *root) |
| void | nilfs_detach_log_writer (struct super_block *sb) |
| #define FLUSH_DAT_BIT (1 << NILFS_DAT_INO) /* DAT only */ |
| #define NILFS_CF_HISTORY_MASK (NILFS_CF_IFILE_STARTED | NILFS_CF_SUFREED) |
| #define NILFS_CF_IFILE_STARTED 0x0002 /* IFILE stage has started */ |
| #define NILFS_CF_SUFREED 0x0004 /* segment usages has been freed */ |
| #define SC_MAX_SEGDELTA |
| anonymous enum |
| anonymous enum |
| int nilfs_attach_log_writer | ( | struct super_block * | sb, |
| struct nilfs_root * | root | ||
| ) |
nilfs_attach_log_writer - attach log writer : super block instance : root object of the current filesystem tree
This allocates a log writer object, initializes it, and starts the log writer.
Return Value: On success, 0 is returned. On error, one of the following negative error code is returned.
%-ENOMEM - Insufficient memory available.
| int nilfs_clean_segments | ( | struct super_block * | sb, |
| struct nilfs_argv * | argv, | ||
| void ** | kbufs | ||
| ) |
| int nilfs_construct_dsync_segment | ( | struct super_block * | sb, |
| struct inode * | inode, | ||
| loff_t | start, | ||
| loff_t | end | ||
| ) |
nilfs_construct_dsync_segment - construct a data-only logical segment : super block : inode whose data blocks should be written out : start byte offset : end byte offset (inclusive)
Return Value: On success, 0 is retured. On errors, one of the following negative error code is returned.
%-EROFS - Read only filesystem.
%-EIO - I/O error
%-ENOSPC - No space left on device (only in a panic state).
%-ERESTARTSYS - Interrupted.
%-ENOMEM - Insufficient memory available.
| int nilfs_construct_segment | ( | struct super_block * | sb | ) |
nilfs_construct_segment - construct a logical segment : super block
Return Value: On success, 0 is retured. On errors, one of the following negative error code is returned.
%-EROFS - Read only filesystem.
%-EIO - I/O error
%-ENOSPC - No space left on device (only in a panic state).
%-ERESTARTSYS - Interrupted.
%-ENOMEM - Insufficient memory available.
| void nilfs_detach_log_writer | ( | struct super_block * | sb | ) |
| void nilfs_flush_segment | ( | struct super_block * | sb, |
| ino_t | ino | ||
| ) |
| void nilfs_relax_pressure_in_lock | ( | struct super_block * | sb | ) |
| void nilfs_transaction_abort | ( | struct super_block * | sb | ) |
| int nilfs_transaction_begin | ( | struct super_block * | sb, |
| struct nilfs_transaction_info * | ti, | ||
| int | vacancy_check | ||
| ) |
nilfs_transaction_begin - start indivisible file operations. : super block : nilfs_transaction_info : flags for vacancy rate checks
nilfs_transaction_begin() acquires a reader/writer semaphore, called the segment semaphore, to make a segment construction and write tasks exclusive. The function is used with nilfs_transaction_commit() in pairs. The region enclosed by these two functions can be nested. To avoid a deadlock, the semaphore is only acquired or released in the outermost call.
This function allocates a nilfs_transaction_info struct to keep context information on it. It is initialized and hooked onto the current task in the outermost call. If a pre-allocated struct is given to , it is used instead; otherwise a new struct is assigned from a slab.
When flag is set, this function will check the amount of free space, and will wait for the GC to reclaim disk space if low capacity.
Return Value: On success, 0 is returned. On error, one of the following negative error code is returned.
%-ENOMEM - Insufficient memory available.
%-ENOSPC - No space left on device
| int nilfs_transaction_commit | ( | struct super_block * | sb | ) |
nilfs_transaction_commit - commit indivisible file operations. : super block
nilfs_transaction_commit() releases the read semaphore which is acquired by nilfs_transaction_begin(). This is only performed in outermost call of this function. If a commit flag is set, nilfs_transaction_commit() sets a timer to start the segment constructor. If a sync flag is set, it starts construction directly.
1.8.2