@@ -1447,13 +1447,8 @@ static void aio_complete_rw(struct kiocb *kiocb, long res)
1447
1447
if (kiocb -> ki_flags & IOCB_WRITE ) {
1448
1448
struct inode * inode = file_inode (kiocb -> ki_filp );
1449
1449
1450
- /*
1451
- * Tell lockdep we inherited freeze protection from submission
1452
- * thread.
1453
- */
1454
1450
if (S_ISREG (inode -> i_mode ))
1455
- __sb_writers_acquired (inode -> i_sb , SB_FREEZE_WRITE );
1456
- file_end_write (kiocb -> ki_filp );
1451
+ kiocb_end_write (kiocb );
1457
1452
}
1458
1453
1459
1454
iocb -> ki_res .res = res ;
@@ -1581,17 +1576,8 @@ static int aio_write(struct kiocb *req, const struct iocb *iocb,
1581
1576
return ret ;
1582
1577
ret = rw_verify_area (WRITE , file , & req -> ki_pos , iov_iter_count (& iter ));
1583
1578
if (!ret ) {
1584
- /*
1585
- * Open-code file_start_write here to grab freeze protection,
1586
- * which will be released by another thread in
1587
- * aio_complete_rw(). Fool lockdep by telling it the lock got
1588
- * released so that it doesn't complain about the held lock when
1589
- * we return to userspace.
1590
- */
1591
- if (S_ISREG (file_inode (file )-> i_mode )) {
1592
- sb_start_write (file_inode (file )-> i_sb );
1593
- __sb_writers_release (file_inode (file )-> i_sb , SB_FREEZE_WRITE );
1594
- }
1579
+ if (S_ISREG (file_inode (file )-> i_mode ))
1580
+ kiocb_start_write (req );
1595
1581
req -> ki_flags |= IOCB_WRITE ;
1596
1582
aio_rw_done (req , call_write_iter (file , req , & iter ));
1597
1583
}
0 commit comments