5 #include <linux/time.h>
22 struct buffer_head *up_to_date_bh;
24 unsigned long total_tail = 0;
36 REISERFS_SB(sb)->s_direct2indirect++;
43 set_le_ih_k_offset(&ind_ih, tail_offset);
52 "pasted or inserted byte exists in "
53 "the tree %K. Use fsck to repair.", &end_key);
62 if (is_statdata_le_ih(p_le_ih)) {
96 "direct item (%K) not found", &end_key);
98 RFALSE(!is_direct_le_ih(p_le_ih),
99 "vs-14055: direct item expected(%K), found %h",
101 tail_size = (le_ih_k_offset(p_le_ih) & (blk_size - 1))
110 if (!unbh->b_page || buffer_uptodate(unbh)
111 || PageUptodate(unbh->b_page)) {
112 up_to_date_bh =
NULL;
114 up_to_date_bh = unbh;
120 if (tail_size == retval)
132 memset(kaddr + pgoff, 0, blk_size - total_tail);
136 REISERFS_I(inode)->i_first_direct_byte =
U32_MAX;
145 if (buffer_journaled(bh) || buffer_journal_dirty(bh)) {
148 clear_buffer_dirty(bh);
152 if ((!list_empty(&bh->b_assoc_buffers) || bh->b_private) && bh->b_page) {
153 struct inode *
inode = bh->b_page->mapping->host;
156 list_del_init(&bh->b_assoc_buffers);
160 clear_buffer_mapped(bh);
161 clear_buffer_req(bh);
162 clear_buffer_new(bh);
176 const struct cpu_key *item_key,
179 loff_t n_new_file_size,
186 int tail_len, round_tail_len;
192 REISERFS_SB(sb)->s_indirect2direct++;
199 tail_len = (n_new_file_size & (block_size - 1));
201 round_tail_len =
ROUND_UP(tail_len);
203 round_tail_len = tail_len;
214 tail = (
char *)
kmap(page);
221 "item to be converted %K does not exist",
224 #ifdef CONFIG_REISERFS_CHECK
225 pos = le_ih_k_offset(&s_ih) - 1 +
230 "changed while we were reading it");
252 tail ? tail :
NULL) < 0) {
260 return block_size - round_tail_len;
265 reiserfs_update_sd(th, inode);
277 REISERFS_I(inode)->i_first_direct_byte = pos1 + 1;
279 return block_size - round_tail_len;