History

ext4: lookup block mapping in extent status tree

After tracking all extent status, we already have a extent cache in memory. Every time we want to lookup a block mapping, we can first try to lookup it in extent status tree to avoid a potential disk I/O. A new function called ext4_es_lookup_extent is defined to finish this work. When we try to lookup a block mapping, we always call ext4_map_blocks and/or ext4_da_map_blocks. So in these functions we first try to lookup a block mapping in extent status tree. A new flag EXT4_GET_BLOCKS_NO_PUT_HOLE is used in ext4_da_map_blocks in order not to put a hole into extent status tree because this hole will be converted to delayed extent in the tree immediately.

Zheng Liu committed 13 years ago

Commit d100eef1 parent f7fec036 files · +192 −3Browse files

Showing the changes to include/trace (1 of 6 files). Show all

Unified · Split

include/trace/events/ext4.h+56−0
@@ -2199,6 +2199,62 @@ TRACE_EVENT(ext4_es_find_delayed_extent_exit, · 2198 unmodified lines
2199 __entry->pblk, __entry->status)2199 __entry->pblk, __entry->status)
2200);2200);
2201 2201
2202TRACE_EVENT(ext4_es_lookup_extent_enter,
2203 TP_PROTO(struct inode *inode, ext4_lblk_t lblk),
2204
2205 TP_ARGS(inode, lblk),
2206
2207 TP_STRUCT__entry(
2208 __field( dev_t, dev )
2209 __field( ino_t, ino )
2210 __field( ext4_lblk_t, lblk )
2211 ),
2212
2213 TP_fast_assign(
2214 __entry->dev = inode->i_sb->s_dev;
2215 __entry->ino = inode->i_ino;
2216 __entry->lblk = lblk;
2217 ),
2218
2219 TP_printk("dev %d,%d ino %lu lblk %u",
2220 MAJOR(__entry->dev), MINOR(__entry->dev),
2221 (unsigned long) __entry->ino, __entry->lblk)
2222);
2223
2224TRACE_EVENT(ext4_es_lookup_extent_exit,
2225 TP_PROTO(struct inode *inode, struct extent_status *es,
2226 int found),
2227
2228 TP_ARGS(inode, es, found),
2229
2230 TP_STRUCT__entry(
2231 __field( dev_t, dev )
2232 __field( ino_t, ino )
2233 __field( ext4_lblk_t, lblk )
2234 __field( ext4_lblk_t, len )
2235 __field( ext4_fsblk_t, pblk )
2236 __field( unsigned long long, status )
2237 __field( int, found )
2238 ),
2239
2240 TP_fast_assign(
2241 __entry->dev = inode->i_sb->s_dev;
2242 __entry->ino = inode->i_ino;
2243 __entry->lblk = es->es_lblk;
2244 __entry->len = es->es_len;
2245 __entry->pblk = ext4_es_pblock(es);
2246 __entry->status = ext4_es_status(es);
2247 __entry->found = found;
2248 ),
2249
2250 TP_printk("dev %d,%d ino %lu found %d [%u/%u) %llu %llx",
2251 MAJOR(__entry->dev), MINOR(__entry->dev),
2252 (unsigned long) __entry->ino, __entry->found,
2253 __entry->lblk, __entry->len,
2254 __entry->found ? __entry->pblk : 0,
2255 __entry->found ? __entry->status : 0)
2256);
2257
2202#endif /* _TRACE_EXT4_H */2258#endif /* _TRACE_EXT4_H */
2203 2259
2204/* This part must be outside protection */2260/* This part must be outside protection */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t