Signed-off-by: Hou Pengyang <houpengy...@huawei.com>
---
 fs/f2fs/super.c             | 7 +++++--
 include/trace/events/f2fs.h | 7 +++++++
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 751e106..746296e 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -624,6 +624,7 @@ static struct inode *f2fs_alloc_inode(struct super_block 
*sb)
 
 static int f2fs_drop_inode(struct inode *inode)
 {
+       int ret;
        /*
         * This is to avoid a deadlock condition like below.
         * writeback_single_inode(inode)
@@ -656,10 +657,12 @@ static int f2fs_drop_inode(struct inode *inode)
                        spin_lock(&inode->i_lock);
                        atomic_dec(&inode->i_count);
                }
+               trace_f2fs_drop_inode(inode, 0);
                return 0;
        }
-
-       return generic_drop_inode(inode);
+       ret = generic_drop_inode(inode);
+       trace_f2fs_drop_inode(inode, ret);
+       return ret;
 }
 
 int f2fs_inode_dirtied(struct inode *inode, bool sync)
diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
index ff31ccf..c80fcad0 100644
--- a/include/trace/events/f2fs.h
+++ b/include/trace/events/f2fs.h
@@ -315,6 +315,13 @@ DEFINE_EVENT(f2fs__inode_exit, f2fs_unlink_exit,
        TP_ARGS(inode, ret)
 );
 
+DEFINE_EVENT(f2fs__inode_exit, f2fs_drop_inode,
+
+       TP_PROTO(struct inode *inode, int ret),
+
+       TP_ARGS(inode, ret)
+);
+
 DEFINE_EVENT(f2fs__inode, f2fs_truncate,
 
        TP_PROTO(struct inode *inode),
-- 
2.10.1


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to