xfs_aops.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (c) 2000-2005 Silicon Graphics, Inc.
  4. * Copyright (c) 2016-2018 Christoph Hellwig.
  5. * All Rights Reserved.
  6. */
  7. #include "xfs.h"
  8. #include "xfs_shared.h"
  9. #include "xfs_format.h"
  10. #include "xfs_log_format.h"
  11. #include "xfs_trans_resv.h"
  12. #include "xfs_mount.h"
  13. #include "xfs_inode.h"
  14. #include "xfs_trans.h"
  15. #include "xfs_iomap.h"
  16. #include "xfs_trace.h"
  17. #include "xfs_bmap.h"
  18. #include "xfs_bmap_util.h"
  19. #include "xfs_reflink.h"
  20. #include "xfs_errortag.h"
  21. #include "xfs_error.h"
  22. #include "xfs_icache.h"
  23. struct xfs_writepage_ctx {
  24. struct iomap_writepage_ctx ctx;
  25. unsigned int data_seq;
  26. unsigned int cow_seq;
  27. };
  28. static inline struct xfs_writepage_ctx *
  29. XFS_WPC(struct iomap_writepage_ctx *ctx)
  30. {
  31. return container_of(ctx, struct xfs_writepage_ctx, ctx);
  32. }
  33. /*
  34. * Fast and loose check if this write could update the on-disk inode size.
  35. */
  36. static inline bool xfs_ioend_is_append(struct iomap_ioend *ioend)
  37. {
  38. return ioend->io_offset + ioend->io_size >
  39. XFS_I(ioend->io_inode)->i_disk_size;
  40. }
  41. /*
  42. * Update on-disk file size now that data has been written to disk.
  43. */
  44. int
  45. xfs_setfilesize(
  46. struct xfs_inode *ip,
  47. xfs_off_t offset,
  48. size_t size)
  49. {
  50. struct xfs_mount *mp = ip->i_mount;
  51. struct xfs_trans *tp;
  52. xfs_fsize_t isize;
  53. int error;
  54. error = xfs_trans_alloc(mp, &M_RES(mp)->tr_fsyncts, 0, 0, 0, &tp);
  55. if (error)
  56. return error;
  57. xfs_ilock(ip, XFS_ILOCK_EXCL);
  58. isize = xfs_new_eof(ip, offset + size);
  59. if (!isize) {
  60. xfs_iunlock(ip, XFS_ILOCK_EXCL);
  61. xfs_trans_cancel(tp);
  62. return 0;
  63. }
  64. trace_xfs_setfilesize(ip, offset, size);
  65. ip->i_disk_size = isize;
  66. xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
  67. xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
  68. return xfs_trans_commit(tp);
  69. }
  70. /*
  71. * IO write completion.
  72. */
  73. STATIC void
  74. xfs_end_ioend(
  75. struct iomap_ioend *ioend)
  76. {
  77. struct xfs_inode *ip = XFS_I(ioend->io_inode);
  78. struct xfs_mount *mp = ip->i_mount;
  79. xfs_off_t offset = ioend->io_offset;
  80. size_t size = ioend->io_size;
  81. unsigned int nofs_flag;
  82. int error;
  83. /*
  84. * We can allocate memory here while doing writeback on behalf of
  85. * memory reclaim. To avoid memory allocation deadlocks set the
  86. * task-wide nofs context for the following operations.
  87. */
  88. nofs_flag = memalloc_nofs_save();
  89. /*
  90. * Just clean up the in-memory structures if the fs has been shut down.
  91. */
  92. if (xfs_is_shutdown(mp)) {
  93. error = -EIO;
  94. goto done;
  95. }
  96. /*
  97. * Clean up all COW blocks and underlying data fork delalloc blocks on
  98. * I/O error. The delalloc punch is required because this ioend was
  99. * mapped to blocks in the COW fork and the associated pages are no
  100. * longer dirty. If we don't remove delalloc blocks here, they become
  101. * stale and can corrupt free space accounting on unmount.
  102. */
  103. error = blk_status_to_errno(ioend->io_bio.bi_status);
  104. if (unlikely(error)) {
  105. if (ioend->io_flags & IOMAP_F_SHARED) {
  106. xfs_reflink_cancel_cow_range(ip, offset, size, true);
  107. xfs_bmap_punch_delalloc_range(ip, XFS_DATA_FORK, offset,
  108. offset + size);
  109. }
  110. goto done;
  111. }
  112. /*
  113. * Success: commit the COW or unwritten blocks if needed.
  114. */
  115. if (ioend->io_flags & IOMAP_F_SHARED)
  116. error = xfs_reflink_end_cow(ip, offset, size);
  117. else if (ioend->io_type == IOMAP_UNWRITTEN)
  118. error = xfs_iomap_write_unwritten(ip, offset, size, false);
  119. if (!error && xfs_ioend_is_append(ioend))
  120. error = xfs_setfilesize(ip, ioend->io_offset, ioend->io_size);
  121. done:
  122. iomap_finish_ioends(ioend, error);
  123. memalloc_nofs_restore(nofs_flag);
  124. }
  125. /*
  126. * Finish all pending IO completions that require transactional modifications.
  127. *
  128. * We try to merge physical and logically contiguous ioends before completion to
  129. * minimise the number of transactions we need to perform during IO completion.
  130. * Both unwritten extent conversion and COW remapping need to iterate and modify
  131. * one physical extent at a time, so we gain nothing by merging physically
  132. * discontiguous extents here.
  133. *
  134. * The ioend chain length that we can be processing here is largely unbound in
  135. * length and we may have to perform significant amounts of work on each ioend
  136. * to complete it. Hence we have to be careful about holding the CPU for too
  137. * long in this loop.
  138. */
  139. void
  140. xfs_end_io(
  141. struct work_struct *work)
  142. {
  143. struct xfs_inode *ip =
  144. container_of(work, struct xfs_inode, i_ioend_work);
  145. struct iomap_ioend *ioend;
  146. struct list_head tmp;
  147. unsigned long flags;
  148. spin_lock_irqsave(&ip->i_ioend_lock, flags);
  149. list_replace_init(&ip->i_ioend_list, &tmp);
  150. spin_unlock_irqrestore(&ip->i_ioend_lock, flags);
  151. iomap_sort_ioends(&tmp);
  152. while ((ioend = list_first_entry_or_null(&tmp, struct iomap_ioend,
  153. io_list))) {
  154. list_del_init(&ioend->io_list);
  155. iomap_ioend_try_merge(ioend, &tmp);
  156. xfs_end_ioend(ioend);
  157. cond_resched();
  158. }
  159. }
  160. STATIC void
  161. xfs_end_bio(
  162. struct bio *bio)
  163. {
  164. struct iomap_ioend *ioend = iomap_ioend_from_bio(bio);
  165. struct xfs_inode *ip = XFS_I(ioend->io_inode);
  166. unsigned long flags;
  167. spin_lock_irqsave(&ip->i_ioend_lock, flags);
  168. if (list_empty(&ip->i_ioend_list))
  169. WARN_ON_ONCE(!queue_work(ip->i_mount->m_unwritten_workqueue,
  170. &ip->i_ioend_work));
  171. list_add_tail(&ioend->io_list, &ip->i_ioend_list);
  172. spin_unlock_irqrestore(&ip->i_ioend_lock, flags);
  173. }
  174. /*
  175. * Fast revalidation of the cached writeback mapping. Return true if the current
  176. * mapping is valid, false otherwise.
  177. */
  178. static bool
  179. xfs_imap_valid(
  180. struct iomap_writepage_ctx *wpc,
  181. struct xfs_inode *ip,
  182. loff_t offset)
  183. {
  184. if (offset < wpc->iomap.offset ||
  185. offset >= wpc->iomap.offset + wpc->iomap.length)
  186. return false;
  187. /*
  188. * If this is a COW mapping, it is sufficient to check that the mapping
  189. * covers the offset. Be careful to check this first because the caller
  190. * can revalidate a COW mapping without updating the data seqno.
  191. */
  192. if (wpc->iomap.flags & IOMAP_F_SHARED)
  193. return true;
  194. /*
  195. * This is not a COW mapping. Check the sequence number of the data fork
  196. * because concurrent changes could have invalidated the extent. Check
  197. * the COW fork because concurrent changes since the last time we
  198. * checked (and found nothing at this offset) could have added
  199. * overlapping blocks.
  200. */
  201. if (XFS_WPC(wpc)->data_seq != READ_ONCE(ip->i_df.if_seq)) {
  202. trace_xfs_wb_data_iomap_invalid(ip, &wpc->iomap,
  203. XFS_WPC(wpc)->data_seq, XFS_DATA_FORK);
  204. return false;
  205. }
  206. if (xfs_inode_has_cow_data(ip) &&
  207. XFS_WPC(wpc)->cow_seq != READ_ONCE(ip->i_cowfp->if_seq)) {
  208. trace_xfs_wb_cow_iomap_invalid(ip, &wpc->iomap,
  209. XFS_WPC(wpc)->cow_seq, XFS_COW_FORK);
  210. return false;
  211. }
  212. return true;
  213. }
  214. static int
  215. xfs_map_blocks(
  216. struct iomap_writepage_ctx *wpc,
  217. struct inode *inode,
  218. loff_t offset,
  219. unsigned int len)
  220. {
  221. struct xfs_inode *ip = XFS_I(inode);
  222. struct xfs_mount *mp = ip->i_mount;
  223. ssize_t count = i_blocksize(inode);
  224. xfs_fileoff_t offset_fsb = XFS_B_TO_FSBT(mp, offset);
  225. xfs_fileoff_t end_fsb = XFS_B_TO_FSB(mp, offset + count);
  226. xfs_fileoff_t cow_fsb;
  227. int whichfork;
  228. struct xfs_bmbt_irec imap;
  229. struct xfs_iext_cursor icur;
  230. int retries = 0;
  231. int error = 0;
  232. unsigned int *seq;
  233. if (xfs_is_shutdown(mp))
  234. return -EIO;
  235. XFS_ERRORTAG_DELAY(mp, XFS_ERRTAG_WB_DELAY_MS);
  236. /*
  237. * COW fork blocks can overlap data fork blocks even if the blocks
  238. * aren't shared. COW I/O always takes precedent, so we must always
  239. * check for overlap on reflink inodes unless the mapping is already a
  240. * COW one, or the COW fork hasn't changed from the last time we looked
  241. * at it.
  242. *
  243. * It's safe to check the COW fork if_seq here without the ILOCK because
  244. * we've indirectly protected against concurrent updates: writeback has
  245. * the page locked, which prevents concurrent invalidations by reflink
  246. * and directio and prevents concurrent buffered writes to the same
  247. * page. Changes to if_seq always happen under i_lock, which protects
  248. * against concurrent updates and provides a memory barrier on the way
  249. * out that ensures that we always see the current value.
  250. */
  251. if (xfs_imap_valid(wpc, ip, offset))
  252. return 0;
  253. /*
  254. * If we don't have a valid map, now it's time to get a new one for this
  255. * offset. This will convert delayed allocations (including COW ones)
  256. * into real extents. If we return without a valid map, it means we
  257. * landed in a hole and we skip the block.
  258. */
  259. retry:
  260. cow_fsb = NULLFILEOFF;
  261. whichfork = XFS_DATA_FORK;
  262. xfs_ilock(ip, XFS_ILOCK_SHARED);
  263. ASSERT(!xfs_need_iread_extents(&ip->i_df));
  264. /*
  265. * Check if this is offset is covered by a COW extents, and if yes use
  266. * it directly instead of looking up anything in the data fork.
  267. */
  268. if (xfs_inode_has_cow_data(ip) &&
  269. xfs_iext_lookup_extent(ip, ip->i_cowfp, offset_fsb, &icur, &imap))
  270. cow_fsb = imap.br_startoff;
  271. if (cow_fsb != NULLFILEOFF && cow_fsb <= offset_fsb) {
  272. XFS_WPC(wpc)->cow_seq = READ_ONCE(ip->i_cowfp->if_seq);
  273. xfs_iunlock(ip, XFS_ILOCK_SHARED);
  274. whichfork = XFS_COW_FORK;
  275. goto allocate_blocks;
  276. }
  277. /*
  278. * No COW extent overlap. Revalidate now that we may have updated
  279. * ->cow_seq. If the data mapping is still valid, we're done.
  280. */
  281. if (xfs_imap_valid(wpc, ip, offset)) {
  282. xfs_iunlock(ip, XFS_ILOCK_SHARED);
  283. return 0;
  284. }
  285. /*
  286. * If we don't have a valid map, now it's time to get a new one for this
  287. * offset. This will convert delayed allocations (including COW ones)
  288. * into real extents.
  289. */
  290. if (!xfs_iext_lookup_extent(ip, &ip->i_df, offset_fsb, &icur, &imap))
  291. imap.br_startoff = end_fsb; /* fake a hole past EOF */
  292. XFS_WPC(wpc)->data_seq = READ_ONCE(ip->i_df.if_seq);
  293. xfs_iunlock(ip, XFS_ILOCK_SHARED);
  294. /* landed in a hole or beyond EOF? */
  295. if (imap.br_startoff > offset_fsb) {
  296. imap.br_blockcount = imap.br_startoff - offset_fsb;
  297. imap.br_startoff = offset_fsb;
  298. imap.br_startblock = HOLESTARTBLOCK;
  299. imap.br_state = XFS_EXT_NORM;
  300. }
  301. /*
  302. * Truncate to the next COW extent if there is one. This is the only
  303. * opportunity to do this because we can skip COW fork lookups for the
  304. * subsequent blocks in the mapping; however, the requirement to treat
  305. * the COW range separately remains.
  306. */
  307. if (cow_fsb != NULLFILEOFF &&
  308. cow_fsb < imap.br_startoff + imap.br_blockcount)
  309. imap.br_blockcount = cow_fsb - imap.br_startoff;
  310. /* got a delalloc extent? */
  311. if (imap.br_startblock != HOLESTARTBLOCK &&
  312. isnullstartblock(imap.br_startblock))
  313. goto allocate_blocks;
  314. xfs_bmbt_to_iomap(ip, &wpc->iomap, &imap, 0, 0, XFS_WPC(wpc)->data_seq);
  315. trace_xfs_map_blocks_found(ip, offset, count, whichfork, &imap);
  316. return 0;
  317. allocate_blocks:
  318. /*
  319. * Convert a dellalloc extent to a real one. The current page is held
  320. * locked so nothing could have removed the block backing offset_fsb,
  321. * although it could have moved from the COW to the data fork by another
  322. * thread.
  323. */
  324. if (whichfork == XFS_COW_FORK)
  325. seq = &XFS_WPC(wpc)->cow_seq;
  326. else
  327. seq = &XFS_WPC(wpc)->data_seq;
  328. error = xfs_bmapi_convert_delalloc(ip, whichfork, offset,
  329. &wpc->iomap, seq);
  330. if (error) {
  331. /*
  332. * If we failed to find the extent in the COW fork we might have
  333. * raced with a COW to data fork conversion or truncate.
  334. * Restart the lookup to catch the extent in the data fork for
  335. * the former case, but prevent additional retries to avoid
  336. * looping forever for the latter case.
  337. */
  338. if (error == -EAGAIN && whichfork == XFS_COW_FORK && !retries++)
  339. goto retry;
  340. ASSERT(error != -EAGAIN);
  341. return error;
  342. }
  343. /*
  344. * Due to merging the return real extent might be larger than the
  345. * original delalloc one. Trim the return extent to the next COW
  346. * boundary again to force a re-lookup.
  347. */
  348. if (whichfork != XFS_COW_FORK && cow_fsb != NULLFILEOFF) {
  349. loff_t cow_offset = XFS_FSB_TO_B(mp, cow_fsb);
  350. if (cow_offset < wpc->iomap.offset + wpc->iomap.length)
  351. wpc->iomap.length = cow_offset - wpc->iomap.offset;
  352. }
  353. ASSERT(wpc->iomap.offset <= offset);
  354. ASSERT(wpc->iomap.offset + wpc->iomap.length > offset);
  355. trace_xfs_map_blocks_alloc(ip, offset, count, whichfork, &imap);
  356. return 0;
  357. }
  358. static int
  359. xfs_prepare_ioend(
  360. struct iomap_ioend *ioend,
  361. int status)
  362. {
  363. unsigned int nofs_flag;
  364. /*
  365. * We can allocate memory here while doing writeback on behalf of
  366. * memory reclaim. To avoid memory allocation deadlocks set the
  367. * task-wide nofs context for the following operations.
  368. */
  369. nofs_flag = memalloc_nofs_save();
  370. /* Convert CoW extents to regular */
  371. if (!status && (ioend->io_flags & IOMAP_F_SHARED)) {
  372. status = xfs_reflink_convert_cow(XFS_I(ioend->io_inode),
  373. ioend->io_offset, ioend->io_size);
  374. }
  375. memalloc_nofs_restore(nofs_flag);
  376. /* send ioends that might require a transaction to the completion wq */
  377. if (xfs_ioend_is_append(ioend) || ioend->io_type == IOMAP_UNWRITTEN ||
  378. (ioend->io_flags & IOMAP_F_SHARED))
  379. ioend->io_bio.bi_end_io = xfs_end_bio;
  380. return status;
  381. }
  382. /*
  383. * If the folio has delalloc blocks on it, the caller is asking us to punch them
  384. * out. If we don't, we can leave a stale delalloc mapping covered by a clean
  385. * page that needs to be dirtied again before the delalloc mapping can be
  386. * converted. This stale delalloc mapping can trip up a later direct I/O read
  387. * operation on the same region.
  388. *
  389. * We prevent this by truncating away the delalloc regions on the folio. Because
  390. * they are delalloc, we can do this without needing a transaction. Indeed - if
  391. * we get ENOSPC errors, we have to be able to do this truncation without a
  392. * transaction as there is no space left for block reservation (typically why
  393. * we see a ENOSPC in writeback).
  394. */
  395. static void
  396. xfs_discard_folio(
  397. struct folio *folio,
  398. loff_t pos)
  399. {
  400. struct xfs_inode *ip = XFS_I(folio->mapping->host);
  401. struct xfs_mount *mp = ip->i_mount;
  402. if (xfs_is_shutdown(mp))
  403. return;
  404. xfs_alert_ratelimited(mp,
  405. "page discard on page "PTR_FMT", inode 0x%llx, pos %llu.",
  406. folio, ip->i_ino, pos);
  407. /*
  408. * The end of the punch range is always the offset of the first
  409. * byte of the next folio. Hence the end offset is only dependent on the
  410. * folio itself and not the start offset that is passed in.
  411. */
  412. xfs_bmap_punch_delalloc_range(ip, XFS_DATA_FORK, pos,
  413. folio_pos(folio) + folio_size(folio));
  414. }
  415. static const struct iomap_writeback_ops xfs_writeback_ops = {
  416. .map_blocks = xfs_map_blocks,
  417. .prepare_ioend = xfs_prepare_ioend,
  418. .discard_folio = xfs_discard_folio,
  419. };
  420. STATIC int
  421. xfs_vm_writepages(
  422. struct address_space *mapping,
  423. struct writeback_control *wbc)
  424. {
  425. struct xfs_writepage_ctx wpc = { };
  426. xfs_iflags_clear(XFS_I(mapping->host), XFS_ITRUNCATED);
  427. return iomap_writepages(mapping, wbc, &wpc.ctx, &xfs_writeback_ops);
  428. }
  429. STATIC int
  430. xfs_dax_writepages(
  431. struct address_space *mapping,
  432. struct writeback_control *wbc)
  433. {
  434. struct xfs_inode *ip = XFS_I(mapping->host);
  435. xfs_iflags_clear(ip, XFS_ITRUNCATED);
  436. return dax_writeback_mapping_range(mapping,
  437. xfs_inode_buftarg(ip)->bt_daxdev, wbc);
  438. }
  439. STATIC sector_t
  440. xfs_vm_bmap(
  441. struct address_space *mapping,
  442. sector_t block)
  443. {
  444. struct xfs_inode *ip = XFS_I(mapping->host);
  445. trace_xfs_vm_bmap(ip);
  446. /*
  447. * The swap code (ab-)uses ->bmap to get a block mapping and then
  448. * bypasses the file system for actual I/O. We really can't allow
  449. * that on reflinks inodes, so we have to skip out here. And yes,
  450. * 0 is the magic code for a bmap error.
  451. *
  452. * Since we don't pass back blockdev info, we can't return bmap
  453. * information for rt files either.
  454. */
  455. if (xfs_is_cow_inode(ip) || XFS_IS_REALTIME_INODE(ip))
  456. return 0;
  457. return iomap_bmap(mapping, block, &xfs_read_iomap_ops);
  458. }
  459. STATIC int
  460. xfs_vm_read_folio(
  461. struct file *unused,
  462. struct folio *folio)
  463. {
  464. return iomap_read_folio(folio, &xfs_read_iomap_ops);
  465. }
  466. STATIC void
  467. xfs_vm_readahead(
  468. struct readahead_control *rac)
  469. {
  470. iomap_readahead(rac, &xfs_read_iomap_ops);
  471. }
  472. static int
  473. xfs_vm_swap_activate(
  474. struct swap_info_struct *sis,
  475. struct file *swap_file,
  476. sector_t *span)
  477. {
  478. struct xfs_inode *ip = XFS_I(file_inode(swap_file));
  479. /*
  480. * Swap file activation can race against concurrent shared extent
  481. * removal in files that have been cloned. If this happens,
  482. * iomap_swapfile_iter() can fail because it encountered a shared
  483. * extent even though an operation is in progress to remove those
  484. * shared extents.
  485. *
  486. * This race becomes problematic when we defer extent removal
  487. * operations beyond the end of a syscall (i.e. use async background
  488. * processing algorithms). Users think the extents are no longer
  489. * shared, but iomap_swapfile_iter() still sees them as shared
  490. * because the refcountbt entries for the extents being removed have
  491. * not yet been updated. Hence the swapon call fails unexpectedly.
  492. *
  493. * The race condition is currently most obvious from the unlink()
  494. * operation as extent removal is deferred until after the last
  495. * reference to the inode goes away. We then process the extent
  496. * removal asynchronously, hence triggers the "syscall completed but
  497. * work not done" condition mentioned above. To close this race
  498. * window, we need to flush any pending inodegc operations to ensure
  499. * they have updated the refcountbt records before we try to map the
  500. * swapfile.
  501. */
  502. xfs_inodegc_flush(ip->i_mount);
  503. /*
  504. * Direct the swap code to the correct block device when this file
  505. * sits on the RT device.
  506. */
  507. sis->bdev = xfs_inode_buftarg(ip)->bt_bdev;
  508. return iomap_swapfile_activate(sis, swap_file, span,
  509. &xfs_read_iomap_ops);
  510. }
  511. const struct address_space_operations xfs_address_space_operations = {
  512. .read_folio = xfs_vm_read_folio,
  513. .readahead = xfs_vm_readahead,
  514. .writepages = xfs_vm_writepages,
  515. .dirty_folio = iomap_dirty_folio,
  516. .release_folio = iomap_release_folio,
  517. .invalidate_folio = iomap_invalidate_folio,
  518. .bmap = xfs_vm_bmap,
  519. .migrate_folio = filemap_migrate_folio,
  520. .is_partially_uptodate = iomap_is_partially_uptodate,
  521. .error_remove_folio = generic_error_remove_folio,
  522. .swap_activate = xfs_vm_swap_activate,
  523. };
  524. const struct address_space_operations xfs_dax_aops = {
  525. .writepages = xfs_dax_writepages,
  526. .dirty_folio = noop_dirty_folio,
  527. .swap_activate = xfs_vm_swap_activate,
  528. };