ANDROID: GKI: Add vendor hook define for f2fs create

Files stored in UFS SLC have approximately 20% better random read performance compared to TLC.
Storing some frequently and randomly accessed files in the SLC area can enhance user experience.

Bug: 407795181
Change-Id: I571cb8b3821fb43dd4708c49c896e33e9942ab5e
Signed-off-by: Rui Chen <chenrui9@honor.com>
This commit is contained in:
Rui Chen
2025-03-29 10:19:56 +08:00
committed by rui chen
parent c785c4c1ec
commit 06d2d8d207
3 changed files with 9 additions and 0 deletions
+1
View File
@@ -146,6 +146,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_f2fs_down_read);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_f2fs_improve_priority);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_f2fs_restore_priority);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_f2fs_printk);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_f2fs_create);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_io_statistics);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cgroup_attach);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_iommu_setup_dma_ops);
+4
View File
@@ -22,6 +22,9 @@
#include "acl.h"
#include <trace/events/f2fs.h>
#undef CREATE_TRACE_POINTS
#include <trace/hooks/fs.h>
static inline bool is_extension_exist(const unsigned char *s, const char *sub,
bool tmp_ext, bool tmp_dot)
{
@@ -376,6 +379,7 @@ static int f2fs_create(struct mnt_idmap *idmap, struct inode *dir,
inode->i_mapping->a_ops = &f2fs_dblock_aops;
ino = inode->i_ino;
trace_android_vh_f2fs_create(inode, dentry);
f2fs_lock_op(sbi);
err = f2fs_add_link(dentry, inode);
if (err)
+4
View File
@@ -27,6 +27,10 @@ DECLARE_HOOK(android_vh_f2fs_printk,
TP_PROTO(struct f2fs_sb_info *sbi, struct va_format *vaf, int level, bool limit_rate),
TP_ARGS(sbi, vaf, level, limit_rate));
DECLARE_HOOK(android_vh_f2fs_create,
TP_PROTO(struct inode *inode, struct dentry *dentry),
TP_ARGS(inode, dentry));
DECLARE_HOOK(android_vh_wb_dirty_limits,
TP_PROTO(unsigned long *thresh, struct bdi_writeback *wb),
TP_ARGS(thresh, wb));