diff options
author | Namjae Jeon <namjae.jeon@samsung.com> | 2015-06-09 01:55:03 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2015-06-09 01:55:03 -0400 |
commit | 331573febb6a224bc50322e3670da326cb7f4cfc (patch) | |
tree | a302585d04479bea70f2c60371ff40d57db0f699 /include/trace | |
parent | de92c8caf16ca84926fa31b7a5590c0fb9c0d5ca (diff) | |
download | op-kernel-dev-331573febb6a224bc50322e3670da326cb7f4cfc.zip op-kernel-dev-331573febb6a224bc50322e3670da326cb7f4cfc.tar.gz |
ext4: Add support FALLOC_FL_INSERT_RANGE for fallocate
This patch implements fallocate's FALLOC_FL_INSERT_RANGE for Ext4.
1) Make sure that both offset and len are block size aligned.
2) Update the i_size of inode by len bytes.
3) Compute the file's logical block number against offset. If the computed
block number is not the starting block of the extent, split the extent
such that the block number is the starting block of the extent.
4) Shift all the extents which are lying between [offset, last allocated extent]
towards right by len bytes. This step will make a hole of len bytes
at offset.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/ext4.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h index 08ec3dd..0faf570 100644 --- a/include/trace/events/ext4.h +++ b/include/trace/events/ext4.h @@ -2478,6 +2478,31 @@ TRACE_EVENT(ext4_collapse_range, __entry->offset, __entry->len) ); +TRACE_EVENT(ext4_insert_range, + TP_PROTO(struct inode *inode, loff_t offset, loff_t len), + + TP_ARGS(inode, offset, len), + + TP_STRUCT__entry( + __field(dev_t, dev) + __field(ino_t, ino) + __field(loff_t, offset) + __field(loff_t, len) + ), + + TP_fast_assign( + __entry->dev = inode->i_sb->s_dev; + __entry->ino = inode->i_ino; + __entry->offset = offset; + __entry->len = len; + ), + + TP_printk("dev %d,%d ino %lu offset %lld len %lld", + MAJOR(__entry->dev), MINOR(__entry->dev), + (unsigned long) __entry->ino, + __entry->offset, __entry->len) +); + TRACE_EVENT(ext4_es_shrink, TP_PROTO(struct super_block *sb, int nr_shrunk, u64 scan_time, int nr_skipped, int retried), |