@@ -620,7 +620,8 @@ int f2fs_init_write_merge_io(struct f2fs_sb_info *sbi)
620620 for (j = HOT ; j < n ; j ++ ) {
621621 struct f2fs_bio_info * io = & sbi -> write_io [i ][j ];
622622
623- init_f2fs_rwsem (& io -> io_rwsem );
623+ init_f2fs_rwsem_trace (& io -> io_rwsem , sbi ,
624+ LOCK_NAME_IO_RWSEM );
624625 io -> sbi = sbi ;
625626 io -> bio = NULL ;
626627 io -> last_block_in_bio = 0 ;
@@ -644,8 +645,9 @@ static void __f2fs_submit_merged_write(struct f2fs_sb_info *sbi,
644645{
645646 enum page_type btype = PAGE_TYPE_OF_BIO (type );
646647 struct f2fs_bio_info * io = sbi -> write_io [btype ] + temp ;
648+ struct f2fs_lock_context lc ;
647649
648- f2fs_down_write (& io -> io_rwsem );
650+ f2fs_down_write_trace (& io -> io_rwsem , & lc );
649651
650652 if (!io -> bio )
651653 goto unlock_out ;
@@ -659,7 +661,7 @@ static void __f2fs_submit_merged_write(struct f2fs_sb_info *sbi,
659661 }
660662 __submit_merged_bio (io );
661663unlock_out :
662- f2fs_up_write (& io -> io_rwsem );
664+ f2fs_up_write_trace (& io -> io_rwsem , & lc );
663665}
664666
665667static void __submit_merged_write_cond (struct f2fs_sb_info * sbi ,
@@ -674,10 +676,11 @@ static void __submit_merged_write_cond(struct f2fs_sb_info *sbi,
674676 if (!force ) {
675677 enum page_type btype = PAGE_TYPE_OF_BIO (type );
676678 struct f2fs_bio_info * io = sbi -> write_io [btype ] + temp ;
679+ struct f2fs_lock_context lc ;
677680
678- f2fs_down_read (& io -> io_rwsem );
681+ f2fs_down_read_trace (& io -> io_rwsem , & lc );
679682 ret = __has_merged_page (io -> bio , inode , folio , ino );
680- f2fs_up_read (& io -> io_rwsem );
683+ f2fs_up_read_trace (& io -> io_rwsem , & lc );
681684 }
682685 if (ret ) {
683686 __f2fs_submit_merged_write (sbi , type , temp );
@@ -987,11 +990,12 @@ void f2fs_submit_page_write(struct f2fs_io_info *fio)
987990 enum page_type btype = PAGE_TYPE_OF_BIO (fio -> type );
988991 struct f2fs_bio_info * io = sbi -> write_io [btype ] + fio -> temp ;
989992 struct folio * bio_folio ;
993+ struct f2fs_lock_context lc ;
990994 enum count_type type ;
991995
992996 f2fs_bug_on (sbi , is_read_io (fio -> op ));
993997
994- f2fs_down_write (& io -> io_rwsem );
998+ f2fs_down_write_trace (& io -> io_rwsem , & lc );
995999next :
9961000#ifdef CONFIG_BLK_DEV_ZONED
9971001 if (f2fs_sb_has_blkzoned (sbi ) && btype < META && io -> zone_pending_bio ) {
@@ -1073,7 +1077,7 @@ void f2fs_submit_page_write(struct f2fs_io_info *fio)
10731077 if (is_sbi_flag_set (sbi , SBI_IS_SHUTDOWN ) ||
10741078 !f2fs_is_checkpoint_ready (sbi ))
10751079 __submit_merged_bio (io );
1076- f2fs_up_write (& io -> io_rwsem );
1080+ f2fs_up_write_trace (& io -> io_rwsem , & lc );
10771081}
10781082
10791083static struct bio * f2fs_grab_read_bio (struct inode * inode , block_t blkaddr ,
0 commit comments