diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-11 11:49:18 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-11 11:49:18 -0800 |
commit | 4e2ccdb0409146f8cf64a11b6ef82a9c928ced2a (patch) | |
tree | 986896cc558ae23017e79ab08eb55b25c3a54549 /fs/nilfs2/segbuf.h | |
parent | 3ef884b4c04e857c283cc77ca70ad8f638d94b0e (diff) | |
parent | a694291a6211537189c6080f77f63cdabfc9b63e (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2: (49 commits)
nilfs2: separate wait function from nilfs_segctor_write
nilfs2: add iterator for segment buffers
nilfs2: hide nilfs_write_info struct in segment buffer code
nilfs2: relocate io status variables to segment buffer
nilfs2: do not return io error for bio allocation failure
nilfs2: use list_splice_tail or list_splice_tail_init
nilfs2: replace mark_inode_dirty as nilfs_mark_inode_dirty
nilfs2: delete mark_inode_dirty in nilfs_delete_entry
nilfs2: delete mark_inode_dirty in nilfs_commit_chunk
nilfs2: change return type of nilfs_commit_chunk
nilfs2: split nilfs_unlink as nilfs_do_unlink and nilfs_unlink
nilfs2: delete redundant mark_inode_dirty
nilfs2: expand inode_inc_link_count and inode_dec_link_count
nilfs2: delete mark_inode_dirty from nilfs_set_link
nilfs2: delete mark_inode_dirty in nilfs_new_inode
nilfs2: add norecovery mount option
nilfs2: add helper to get if volume is in a valid state
nilfs2: move recovery completion into load_nilfs function
nilfs2: apply readahead for recovery on mount
nilfs2: clean up get/put function of a segment usage
...
Diffstat (limited to 'fs/nilfs2/segbuf.h')
-rw-r--r-- | fs/nilfs2/segbuf.h | 54 |
1 files changed, 18 insertions, 36 deletions
diff --git a/fs/nilfs2/segbuf.h b/fs/nilfs2/segbuf.h index 0c3076f4e59..6af1630fb40 100644 --- a/fs/nilfs2/segbuf.h +++ b/fs/nilfs2/segbuf.h @@ -27,7 +27,6 @@ #include <linux/buffer_head.h> #include <linux/bio.h> #include <linux/completion.h> -#include <linux/backing-dev.h> /** * struct nilfs_segsum_info - On-memory segment summary @@ -77,7 +76,9 @@ struct nilfs_segsum_info { * @sb_rest_blocks: Number of residual blocks in the current segment * @sb_segsum_buffers: List of buffers for segment summaries * @sb_payload_buffers: List of buffers for segment payload - * @sb_io_error: I/O error status + * @sb_nbio: Number of flying bio requests + * @sb_err: I/O error status + * @sb_bio_event: Completion event of log writing */ struct nilfs_segment_buffer { struct super_block *sb_super; @@ -96,7 +97,9 @@ struct nilfs_segment_buffer { struct list_head sb_payload_buffers; /* including super root */ /* io status */ - int sb_io_error; + int sb_nbio; + atomic_t sb_err; + struct completion sb_bio_event; }; #define NILFS_LIST_SEGBUF(head) \ @@ -125,6 +128,8 @@ struct nilfs_segment_buffer *nilfs_segbuf_new(struct super_block *); void nilfs_segbuf_free(struct nilfs_segment_buffer *); void nilfs_segbuf_map(struct nilfs_segment_buffer *, __u64, unsigned long, struct the_nilfs *); +void nilfs_segbuf_map_cont(struct nilfs_segment_buffer *segbuf, + struct nilfs_segment_buffer *prev); void nilfs_segbuf_set_next_segnum(struct nilfs_segment_buffer *, __u64, struct the_nilfs *); int nilfs_segbuf_reset(struct nilfs_segment_buffer *, unsigned, time_t); @@ -161,41 +166,18 @@ nilfs_segbuf_add_file_buffer(struct nilfs_segment_buffer *segbuf, segbuf->sb_sum.nfileblk++; } -void nilfs_release_buffers(struct list_head *); +int nilfs_segbuf_write(struct nilfs_segment_buffer *segbuf, + struct the_nilfs *nilfs); +int nilfs_segbuf_wait(struct nilfs_segment_buffer *segbuf); -static inline void nilfs_segbuf_clear(struct nilfs_segment_buffer *segbuf) +void nilfs_clear_logs(struct list_head *logs); +void nilfs_truncate_logs(struct list_head *logs, + struct nilfs_segment_buffer *last); +int nilfs_wait_on_logs(struct list_head *logs); + +static inline void nilfs_destroy_logs(struct list_head *logs) { - nilfs_release_buffers(&segbuf->sb_segsum_buffers); - nilfs_release_buffers(&segbuf->sb_payload_buffers); + nilfs_truncate_logs(logs, NULL); } -struct nilfs_write_info { - struct bio *bio; - int start, end; /* The region to be submitted */ - int rest_blocks; - int max_pages; - int nr_vecs; - sector_t blocknr; - - int nbio; - atomic_t err; - struct completion bio_event; - /* completion event of segment write */ - - /* - * The following fields must be set explicitly - */ - struct super_block *sb; - struct backing_dev_info *bdi; /* backing dev info */ - struct buffer_head *bh_sr; -}; - - -void nilfs_segbuf_prepare_write(struct nilfs_segment_buffer *, - struct nilfs_write_info *); -int nilfs_segbuf_write(struct nilfs_segment_buffer *, - struct nilfs_write_info *); -int nilfs_segbuf_wait(struct nilfs_segment_buffer *, - struct nilfs_write_info *); - #endif /* _NILFS_SEGBUF_H */ |