tail_conversion.c (e5451c8f8330e03ad3cfa16048b4daf961af434f) | tail_conversion.c (09cbfeaf1a5a67bfb3201e0c83c810cecb2efa5a) |
---|---|
1/* 2 * Copyright 1999 Hans Reiser, see reiserfs/README for licensing and copyright 3 * details 4 */ 5 6#include <linux/time.h> 7#include <linux/pagemap.h> 8#include <linux/buffer_head.h> --- 137 unchanged lines hidden (view full) --- 146 147 } 148 /* 149 * if we've copied bytes from disk into the page, we need to zero 150 * out the unused part of the block (it was not up to date before) 151 */ 152 if (up_to_date_bh) { 153 unsigned pgoff = | 1/* 2 * Copyright 1999 Hans Reiser, see reiserfs/README for licensing and copyright 3 * details 4 */ 5 6#include <linux/time.h> 7#include <linux/pagemap.h> 8#include <linux/buffer_head.h> --- 137 unchanged lines hidden (view full) --- 146 147 } 148 /* 149 * if we've copied bytes from disk into the page, we need to zero 150 * out the unused part of the block (it was not up to date before) 151 */ 152 if (up_to_date_bh) { 153 unsigned pgoff = |
154 (tail_offset + total_tail - 1) & (PAGE_CACHE_SIZE - 1); | 154 (tail_offset + total_tail - 1) & (PAGE_SIZE - 1); |
155 char *kaddr = kmap_atomic(up_to_date_bh->b_page); 156 memset(kaddr + pgoff, 0, blk_size - total_tail); 157 kunmap_atomic(kaddr); 158 } 159 160 REISERFS_I(inode)->i_first_direct_byte = U32_MAX; 161 162 return 0; --- 103 unchanged lines hidden (view full) --- 266 pos1 + 1, TYPE_DIRECT, round_tail_len, 267 0xffff /*ih_free_space */ ); 268 269 /* 270 * we want a pointer to the first byte of the tail in the page. 271 * the page was locked and this part of the page was up to date when 272 * indirect2direct was called, so we know the bytes are still valid 273 */ | 155 char *kaddr = kmap_atomic(up_to_date_bh->b_page); 156 memset(kaddr + pgoff, 0, blk_size - total_tail); 157 kunmap_atomic(kaddr); 158 } 159 160 REISERFS_I(inode)->i_first_direct_byte = U32_MAX; 161 162 return 0; --- 103 unchanged lines hidden (view full) --- 266 pos1 + 1, TYPE_DIRECT, round_tail_len, 267 0xffff /*ih_free_space */ ); 268 269 /* 270 * we want a pointer to the first byte of the tail in the page. 271 * the page was locked and this part of the page was up to date when 272 * indirect2direct was called, so we know the bytes are still valid 273 */ |
274 tail = tail + (pos & (PAGE_CACHE_SIZE - 1)); | 274 tail = tail + (pos & (PAGE_SIZE - 1)); |
275 276 PATH_LAST_POSITION(path)++; 277 278 key = *item_key; 279 set_cpu_key_k_type(&key, TYPE_DIRECT); 280 key.key_length = 4; 281 /* Insert tail as new direct item in the tree */ 282 if (reiserfs_insert_item(th, path, &key, &s_ih, inode, --- 35 unchanged lines hidden --- | 275 276 PATH_LAST_POSITION(path)++; 277 278 key = *item_key; 279 set_cpu_key_k_type(&key, TYPE_DIRECT); 280 key.key_length = 4; 281 /* Insert tail as new direct item in the tree */ 282 if (reiserfs_insert_item(th, path, &key, &s_ih, inode, --- 35 unchanged lines hidden --- |