File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -1101,6 +1101,7 @@ static inline void wait_on_page_locked(struct page *page)
1101
1101
folio_wait_locked (page_folio (page ));
1102
1102
}
1103
1103
1104
+ void folio_end_read (struct folio * folio , bool success );
1104
1105
void wait_on_page_writeback (struct page * page );
1105
1106
void folio_wait_writeback (struct folio * folio );
1106
1107
int folio_wait_writeback_killable (struct folio * folio );
Original file line number Diff line number Diff line change @@ -1525,6 +1525,28 @@ void folio_unlock(struct folio *folio)
1525
1525
}
1526
1526
EXPORT_SYMBOL (folio_unlock );
1527
1527
1528
+ /**
1529
+ * folio_end_read - End read on a folio.
1530
+ * @folio: The folio.
1531
+ * @success: True if all reads completed successfully.
1532
+ *
1533
+ * When all reads against a folio have completed, filesystems should
1534
+ * call this function to let the pagecache know that no more reads
1535
+ * are outstanding. This will unlock the folio and wake up any thread
1536
+ * sleeping on the lock. The folio will also be marked uptodate if all
1537
+ * reads succeeded.
1538
+ *
1539
+ * Context: May be called from interrupt or process context. May not be
1540
+ * called from NMI context.
1541
+ */
1542
+ void folio_end_read (struct folio * folio , bool success )
1543
+ {
1544
+ if (likely (success ))
1545
+ folio_mark_uptodate (folio );
1546
+ folio_unlock (folio );
1547
+ }
1548
+ EXPORT_SYMBOL (folio_end_read );
1549
+
1528
1550
/**
1529
1551
* folio_end_private_2 - Clear PG_private_2 and wake any waiters.
1530
1552
* @folio: The folio.
You can’t perform that action at this time.
0 commit comments