diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-11 14:49:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-11 14:49:18 -0500 |
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 0c3076f4e592..6af1630fb401 100644 --- a/fs/nilfs2/segbuf.h +++ b/fs/nilfs2/segbuf.h | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <linux/buffer_head.h> | 27 | #include <linux/buffer_head.h> |
28 | #include <linux/bio.h> | 28 | #include <linux/bio.h> |
29 | #include <linux/completion.h> | 29 | #include <linux/completion.h> |
30 | #include <linux/backing-dev.h> | ||
31 | 30 | ||
32 | /** | 31 | /** |
33 | * struct nilfs_segsum_info - On-memory segment summary | 32 | * struct nilfs_segsum_info - On-memory segment summary |
@@ -77,7 +76,9 @@ struct nilfs_segsum_info { | |||
77 | * @sb_rest_blocks: Number of residual blocks in the current segment | 76 | * @sb_rest_blocks: Number of residual blocks in the current segment |
78 | * @sb_segsum_buffers: List of buffers for segment summaries | 77 | * @sb_segsum_buffers: List of buffers for segment summaries |
79 | * @sb_payload_buffers: List of buffers for segment payload | 78 | * @sb_payload_buffers: List of buffers for segment payload |
80 | * @sb_io_error: I/O error status | 79 | * @sb_nbio: Number of flying bio requests |
80 | * @sb_err: I/O error status | ||
81 | * @sb_bio_event: Completion event of log writing | ||
81 | */ | 82 | */ |
82 | struct nilfs_segment_buffer { | 83 | struct nilfs_segment_buffer { |
83 | struct super_block *sb_super; | 84 | struct super_block *sb_super; |
@@ -96,7 +97,9 @@ struct nilfs_segment_buffer { | |||
96 | struct list_head sb_payload_buffers; /* including super root */ | 97 | struct list_head sb_payload_buffers; /* including super root */ |
97 | 98 | ||
98 | /* io status */ | 99 | /* io status */ |
99 | int sb_io_error; | 100 | int sb_nbio; |
101 | atomic_t sb_err; | ||
102 | struct completion sb_bio_event; | ||
100 | }; | 103 | }; |
101 | 104 | ||
102 | #define NILFS_LIST_SEGBUF(head) \ | 105 | #define NILFS_LIST_SEGBUF(head) \ |
@@ -125,6 +128,8 @@ struct nilfs_segment_buffer *nilfs_segbuf_new(struct super_block *); | |||
125 | void nilfs_segbuf_free(struct nilfs_segment_buffer *); | 128 | void nilfs_segbuf_free(struct nilfs_segment_buffer *); |
126 | void nilfs_segbuf_map(struct nilfs_segment_buffer *, __u64, unsigned long, | 129 | void nilfs_segbuf_map(struct nilfs_segment_buffer *, __u64, unsigned long, |
127 | struct the_nilfs *); | 130 | struct the_nilfs *); |
131 | void nilfs_segbuf_map_cont(struct nilfs_segment_buffer *segbuf, | ||
132 | struct nilfs_segment_buffer *prev); | ||
128 | void nilfs_segbuf_set_next_segnum(struct nilfs_segment_buffer *, __u64, | 133 | void nilfs_segbuf_set_next_segnum(struct nilfs_segment_buffer *, __u64, |
129 | struct the_nilfs *); | 134 | struct the_nilfs *); |
130 | int nilfs_segbuf_reset(struct nilfs_segment_buffer *, unsigned, time_t); | 135 | 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, | |||
161 | segbuf->sb_sum.nfileblk++; | 166 | segbuf->sb_sum.nfileblk++; |
162 | } | 167 | } |
163 | 168 | ||
164 | void nilfs_release_buffers(struct list_head *); | 169 | int nilfs_segbuf_write(struct nilfs_segment_buffer *segbuf, |
170 | struct the_nilfs *nilfs); | ||
171 | int nilfs_segbuf_wait(struct nilfs_segment_buffer *segbuf); | ||
165 | 172 | ||
166 | static inline void nilfs_segbuf_clear(struct nilfs_segment_buffer *segbuf) | 173 | void nilfs_clear_logs(struct list_head *logs); |
174 | void nilfs_truncate_logs(struct list_head *logs, | ||
175 | struct nilfs_segment_buffer *last); | ||
176 | int nilfs_wait_on_logs(struct list_head *logs); | ||
177 | |||
178 | static inline void nilfs_destroy_logs(struct list_head *logs) | ||
167 | { | 179 | { |
168 | nilfs_release_buffers(&segbuf->sb_segsum_buffers); | 180 | nilfs_truncate_logs(logs, NULL); |
169 | nilfs_release_buffers(&segbuf->sb_payload_buffers); | ||
170 | } | 181 | } |
171 | 182 | ||
172 | struct nilfs_write_info { | ||
173 | struct bio *bio; | ||
174 | int start, end; /* The region to be submitted */ | ||
175 | int rest_blocks; | ||
176 | int max_pages; | ||
177 | int nr_vecs; | ||
178 | sector_t blocknr; | ||
179 | |||
180 | int nbio; | ||
181 | atomic_t err; | ||
182 | struct completion bio_event; | ||
183 | /* completion event of segment write */ | ||
184 | |||
185 | /* | ||
186 | * The following fields must be set explicitly | ||
187 | */ | ||
188 | struct super_block *sb; | ||
189 | struct backing_dev_info *bdi; /* backing dev info */ | ||
190 | struct buffer_head *bh_sr; | ||
191 | }; | ||
192 | |||
193 | |||
194 | void nilfs_segbuf_prepare_write(struct nilfs_segment_buffer *, | ||
195 | struct nilfs_write_info *); | ||
196 | int nilfs_segbuf_write(struct nilfs_segment_buffer *, | ||
197 | struct nilfs_write_info *); | ||
198 | int nilfs_segbuf_wait(struct nilfs_segment_buffer *, | ||
199 | struct nilfs_write_info *); | ||
200 | |||
201 | #endif /* _NILFS_SEGBUF_H */ | 183 | #endif /* _NILFS_SEGBUF_H */ |