aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/fs.h3
-rw-r--r--include/linux/mbcache.h12
-rw-r--r--include/trace/events/ext4.h102
3 files changed, 80 insertions, 37 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index a877ed3f389f..ea80f1cdff06 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2572,6 +2572,9 @@ static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb,
2572void inode_dio_wait(struct inode *inode); 2572void inode_dio_wait(struct inode *inode);
2573void inode_dio_done(struct inode *inode); 2573void inode_dio_done(struct inode *inode);
2574 2574
2575extern void inode_set_flags(struct inode *inode, unsigned int flags,
2576 unsigned int mask);
2577
2575extern const struct file_operations generic_ro_fops; 2578extern const struct file_operations generic_ro_fops;
2576 2579
2577#define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m)) 2580#define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m))
diff --git a/include/linux/mbcache.h b/include/linux/mbcache.h
index 5525d370701d..6a392e7a723a 100644
--- a/include/linux/mbcache.h
+++ b/include/linux/mbcache.h
@@ -3,19 +3,21 @@
3 3
4 (C) 2001 by Andreas Gruenbacher, <a.gruenbacher@computer.org> 4 (C) 2001 by Andreas Gruenbacher, <a.gruenbacher@computer.org>
5*/ 5*/
6
7struct mb_cache_entry { 6struct mb_cache_entry {
8 struct list_head e_lru_list; 7 struct list_head e_lru_list;
9 struct mb_cache *e_cache; 8 struct mb_cache *e_cache;
10 unsigned short e_used; 9 unsigned short e_used;
11 unsigned short e_queued; 10 unsigned short e_queued;
11 atomic_t e_refcnt;
12 struct block_device *e_bdev; 12 struct block_device *e_bdev;
13 sector_t e_block; 13 sector_t e_block;
14 struct list_head e_block_list; 14 struct hlist_bl_node e_block_list;
15 struct { 15 struct {
16 struct list_head o_list; 16 struct hlist_bl_node o_list;
17 unsigned int o_key; 17 unsigned int o_key;
18 } e_index; 18 } e_index;
19 struct hlist_bl_head *e_block_hash_p;
20 struct hlist_bl_head *e_index_hash_p;
19}; 21};
20 22
21struct mb_cache { 23struct mb_cache {
@@ -25,8 +27,8 @@ struct mb_cache {
25 int c_max_entries; 27 int c_max_entries;
26 int c_bucket_bits; 28 int c_bucket_bits;
27 struct kmem_cache *c_entry_cache; 29 struct kmem_cache *c_entry_cache;
28 struct list_head *c_block_hash; 30 struct hlist_bl_head *c_block_hash;
29 struct list_head *c_index_hash; 31 struct hlist_bl_head *c_index_hash;
30}; 32};
31 33
32/* Functions on caches */ 34/* Functions on caches */
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index 197d3125df2a..010ea89eeb0e 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -16,6 +16,15 @@ struct mpage_da_data;
16struct ext4_map_blocks; 16struct ext4_map_blocks;
17struct extent_status; 17struct extent_status;
18 18
19/* shim until we merge in the xfs_collapse_range branch */
20#ifndef FALLOC_FL_COLLAPSE_RANGE
21#define FALLOC_FL_COLLAPSE_RANGE 0x08
22#endif
23
24#ifndef FALLOC_FL_ZERO_RANGE
25#define FALLOC_FL_ZERO_RANGE 0x10
26#endif
27
19#define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode)) 28#define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode))
20 29
21#define show_mballoc_flags(flags) __print_flags(flags, "|", \ 30#define show_mballoc_flags(flags) __print_flags(flags, "|", \
@@ -68,6 +77,13 @@ struct extent_status;
68 { EXTENT_STATUS_DELAYED, "D" }, \ 77 { EXTENT_STATUS_DELAYED, "D" }, \
69 { EXTENT_STATUS_HOLE, "H" }) 78 { EXTENT_STATUS_HOLE, "H" })
70 79
80#define show_falloc_mode(mode) __print_flags(mode, "|", \
81 { FALLOC_FL_KEEP_SIZE, "KEEP_SIZE"}, \
82 { FALLOC_FL_PUNCH_HOLE, "PUNCH_HOLE"}, \
83 { FALLOC_FL_NO_HIDE_STALE, "NO_HIDE_STALE"}, \
84 { FALLOC_FL_COLLAPSE_RANGE, "COLLAPSE_RANGE"}, \
85 { FALLOC_FL_ZERO_RANGE, "ZERO_RANGE"})
86
71 87
72TRACE_EVENT(ext4_free_inode, 88TRACE_EVENT(ext4_free_inode,
73 TP_PROTO(struct inode *inode), 89 TP_PROTO(struct inode *inode),
@@ -1328,7 +1344,7 @@ TRACE_EVENT(ext4_direct_IO_exit,
1328 __entry->rw, __entry->ret) 1344 __entry->rw, __entry->ret)
1329); 1345);
1330 1346
1331TRACE_EVENT(ext4_fallocate_enter, 1347DECLARE_EVENT_CLASS(ext4__fallocate_mode,
1332 TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode), 1348 TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
1333 1349
1334 TP_ARGS(inode, offset, len, mode), 1350 TP_ARGS(inode, offset, len, mode),
@@ -1336,23 +1352,45 @@ TRACE_EVENT(ext4_fallocate_enter,
1336 TP_STRUCT__entry( 1352 TP_STRUCT__entry(
1337 __field( dev_t, dev ) 1353 __field( dev_t, dev )
1338 __field( ino_t, ino ) 1354 __field( ino_t, ino )
1339 __field( loff_t, pos ) 1355 __field( loff_t, offset )
1340 __field( loff_t, len ) 1356 __field( loff_t, len )
1341 __field( int, mode ) 1357 __field( int, mode )
1342 ), 1358 ),
1343 1359
1344 TP_fast_assign( 1360 TP_fast_assign(
1345 __entry->dev = inode->i_sb->s_dev; 1361 __entry->dev = inode->i_sb->s_dev;
1346 __entry->ino = inode->i_ino; 1362 __entry->ino = inode->i_ino;
1347 __entry->pos = offset; 1363 __entry->offset = offset;
1348 __entry->len = len; 1364 __entry->len = len;
1349 __entry->mode = mode; 1365 __entry->mode = mode;
1350 ), 1366 ),
1351 1367
1352 TP_printk("dev %d,%d ino %lu pos %lld len %lld mode %d", 1368 TP_printk("dev %d,%d ino %lu offset %lld len %lld mode %s",
1353 MAJOR(__entry->dev), MINOR(__entry->dev), 1369 MAJOR(__entry->dev), MINOR(__entry->dev),
1354 (unsigned long) __entry->ino, __entry->pos, 1370 (unsigned long) __entry->ino,
1355 __entry->len, __entry->mode) 1371 __entry->offset, __entry->len,
1372 show_falloc_mode(__entry->mode))
1373);
1374
1375DEFINE_EVENT(ext4__fallocate_mode, ext4_fallocate_enter,
1376
1377 TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
1378
1379 TP_ARGS(inode, offset, len, mode)
1380);
1381
1382DEFINE_EVENT(ext4__fallocate_mode, ext4_punch_hole,
1383
1384 TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
1385
1386 TP_ARGS(inode, offset, len, mode)
1387);
1388
1389DEFINE_EVENT(ext4__fallocate_mode, ext4_zero_range,
1390
1391 TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
1392
1393 TP_ARGS(inode, offset, len, mode)
1356); 1394);
1357 1395
1358TRACE_EVENT(ext4_fallocate_exit, 1396TRACE_EVENT(ext4_fallocate_exit,
@@ -1384,31 +1422,6 @@ TRACE_EVENT(ext4_fallocate_exit,
1384 __entry->ret) 1422 __entry->ret)
1385); 1423);
1386 1424
1387TRACE_EVENT(ext4_punch_hole,
1388 TP_PROTO(struct inode *inode, loff_t offset, loff_t len),
1389
1390 TP_ARGS(inode, offset, len),
1391
1392 TP_STRUCT__entry(
1393 __field( dev_t, dev )
1394 __field( ino_t, ino )
1395 __field( loff_t, offset )
1396 __field( loff_t, len )
1397 ),
1398
1399 TP_fast_assign(
1400 __entry->dev = inode->i_sb->s_dev;
1401 __entry->ino = inode->i_ino;
1402 __entry->offset = offset;
1403 __entry->len = len;
1404 ),
1405
1406 TP_printk("dev %d,%d ino %lu offset %lld len %lld",
1407 MAJOR(__entry->dev), MINOR(__entry->dev),
1408 (unsigned long) __entry->ino,
1409 __entry->offset, __entry->len)
1410);
1411
1412TRACE_EVENT(ext4_unlink_enter, 1425TRACE_EVENT(ext4_unlink_enter,
1413 TP_PROTO(struct inode *parent, struct dentry *dentry), 1426 TP_PROTO(struct inode *parent, struct dentry *dentry),
1414 1427
@@ -2410,6 +2423,31 @@ TRACE_EVENT(ext4_es_shrink_exit,
2410 __entry->shrunk_nr, __entry->cache_cnt) 2423 __entry->shrunk_nr, __entry->cache_cnt)
2411); 2424);
2412 2425
2426TRACE_EVENT(ext4_collapse_range,
2427 TP_PROTO(struct inode *inode, loff_t offset, loff_t len),
2428
2429 TP_ARGS(inode, offset, len),
2430
2431 TP_STRUCT__entry(
2432 __field(dev_t, dev)
2433 __field(ino_t, ino)
2434 __field(loff_t, offset)
2435 __field(loff_t, len)
2436 ),
2437
2438 TP_fast_assign(
2439 __entry->dev = inode->i_sb->s_dev;
2440 __entry->ino = inode->i_ino;
2441 __entry->offset = offset;
2442 __entry->len = len;
2443 ),
2444
2445 TP_printk("dev %d,%d ino %lu offset %lld len %lld",
2446 MAJOR(__entry->dev), MINOR(__entry->dev),
2447 (unsigned long) __entry->ino,
2448 __entry->offset, __entry->len)
2449);
2450
2413#endif /* _TRACE_EXT4_H */ 2451#endif /* _TRACE_EXT4_H */
2414 2452
2415/* This part must be outside protection */ 2453/* This part must be outside protection */