Lines Matching +full:file +full:- +full:entry +full:- +full:cache
16 6 0x0000ffffa762eb14 in ext2fs_close2 (fs=fs@entry=0xaaaaf5c98cc0, flags=flags@entry=0) at closefs…
17 7 0x0000ffffa762eba4 in ext2fs_close_free (fs_ptr=fs_ptr@entry=0xffffc8cbab30) at closefs.c:472
18 8 0x0000aaaadcc39bd8 in preenhalt (ctx=ctx@entry=0xaaaaf5c98460) at util.c:365
21 10 0x0000ffffa7655044 in reuse_cache (block=262206, cache=0xaaaaf5c98f80, data=0xaaaaf5c98f30, chan…
23 …3702c in ll_rw_block (rw=rw@entry=1, op_flags=op_flags@entry=0, nr=<optimized out>, nr@entry=1, bh…
24 13 0x0000aaaadcc375e8 in brelse (bh=<optimized out>, bh@entry=0xaaaaf5cac4a0) at journal.c:217
25 …adcc3ebe0 in do_one_pass (journal=journal@entry=0xaaaaf5c9f590, info=info@entry=0xffffc8cbad60, pa…
31 Signed-off-by: zhanchengbin <zhanchengbin1@huawei.com>
32 Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
33 ---
34 lib/ext2fs/unix_io.c | 63 +++++++++++++++++++++++++++++++++++++---------------
35 1 file changed, 45 insertions(+), 18 deletions(-)
37 diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c
39 --- a/lib/ext2fs/unix_io.c
41 @@ -210,7 +210,8 @@ static char *safe_getenv(const char *arg)
45 - int count, void *bufv)
51 @@ -331,16 +332,22 @@ error_unlock:
54 memset((char *) buf+actual, 0, size-actual);
55 - if (channel->read_error)
56 + if (channel->read_error) {
59 retval = (channel->read_error)(channel, block, count, buf,
70 - int count, const void *bufv)
76 @@ -482,9 +489,14 @@ bounce_write:
80 - if (channel->write_error)
81 + if (channel->write_error) {
84 retval = (channel->write_error)(channel, block, count, buf,
92 @@ -576,16 +588,22 @@ static struct unix_cache *find_cached_block(struct unix_private_data *data,
94 * Reuse a particular cache entry for another block.
96 -static void reuse_cache(io_channel channel, struct unix_private_data *data,
98 struct unix_cache *cache, unsigned long long block)
100 - if (cache->dirty && cache->in_use)
101 - raw_write_blk(channel, data, cache->block, 1, cache->buf);
103 + if (cache->dirty && cache->in_use) {
104 + retval = raw_write_blk(channel, data, cache->block, 1, cache->buf, 1);
109 cache->in_use = 1;
110 cache->dirty = 0;
111 cache->block = block;
112 cache->access_time = ++data->access_time;
118 @@ -616,7 +634,8 @@ static errcode_t flush_cached_blocks(io_channel channel,
122 - cache->block, 1, cache->buf);
123 + cache->block, 1, cache->buf,
128 @@ -984,10 +1003,10 @@ static errcode_t unix_read_blk64(io_channel channel, unsigned long long bloc…
132 - return raw_read_blk(channel, data, block, count, buf);
135 if (data->flags & IO_FLAG_NOCACHE)
136 - return raw_read_blk(channel, data, block, count, buf);
139 * If we're doing an odd-sized read or a very large read,
140 * flush out the cache and then do a direct read.
141 @@ -995,7 +1014,7 @@ static errcode_t unix_read_blk64(io_channel channel, unsigned long long block,
145 - return raw_read_blk(channel, data, block, count, buf);
150 @@ -1024,14 +1043,18 @@ static errcode_t unix_read_blk64(io_channel channel, unsigned long long blo…
154 - if ((retval = raw_read_blk(channel, data, block, i, cp)))
159 /* Save the results in the cache */
161 if (!find_cached_block(data, block, &cache)) {
162 - reuse_cache(channel, data, cache, block);
163 + retval = reuse_cache(channel, data, cache, block);
168 memcpy(cache->buf, cp, channel->block_size);
170 count--;
171 @@ -1064,10 +1087,10 @@ static errcode_t unix_write_blk64(io_channel channel, unsigned long long bl…
175 - return raw_write_blk(channel, data, block, count, buf);
178 if (data->flags & IO_FLAG_NOCACHE)
179 - return raw_write_blk(channel, data, block, count, buf);
182 * If we're doing an odd-sized write or a very large write,
183 * flush out the cache completely and then do a direct write.
184 @@ -1076,7 +1099,7 @@ static errcode_t unix_write_blk64(io_channel channel, unsigned long long bloc…
188 - return raw_write_blk(channel, data, block, count, buf);
193 @@ -1086,7 +1109,7 @@ static errcode_t unix_write_blk64(io_channel channel, unsigned long long bloc…
195 writethrough = channel->flags & CHANNEL_FLAGS_WRITETHROUGH;
197 - retval = raw_write_blk(channel, data, block, count, buf);
202 @@ -1094,7 +1117,11 @@ static errcode_t unix_write_blk64(io_channel channel, unsigned long long blo…
203 cache = find_cached_block(data, block, &reuse);
204 if (!cache) {
205 cache = reuse;
206 - reuse_cache(channel, data, cache, block);
207 + retval = reuse_cache(channel, data, cache, block);
213 if (cache->buf != cp)
214 memcpy(cache->buf, cp, channel->block_size);
215 --