return kmalloc(size, flags);
}
+static inline void *f2fs_getname(struct f2fs_sb_info *sbi)
+{
+ if (time_to_inject(sbi, FAULT_KMALLOC))
+ return NULL;
+
+ return __getname();
+}
+
+static inline void f2fs_putname(char *buf)
+{
+ __putname(buf);
+}
+
static inline void *f2fs_kzalloc(struct f2fs_sb_info *sbi,
size_t size, gfp_t flags)
{
struct inode *inode = file_inode(iocb->ki_filp);
char *buf, *path;
- buf = f2fs_kmalloc(F2FS_I_SB(inode), PATH_MAX, GFP_KERNEL);
+ buf = f2fs_getname(F2FS_I_SB(inode));
if (!buf)
return;
path = dentry_path_raw(file_dentry(iocb->ki_filp), buf, PATH_MAX);
trace_f2fs_dataread_start(inode, iocb->ki_pos, count,
current->pid, path, current->comm);
free_buf:
- kfree(buf);
+ f2fs_putname(buf);
}
static ssize_t f2fs_file_read_iter(struct kiocb *iocb, struct iov_iter *to)