mpage.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636
  1. /*
  2. * fs/mpage.c
  3. *
  4. * Copyright (C) 2002, Linus Torvalds.
  5. *
  6. * Contains functions related to preparing and submitting BIOs which contain
  7. * multiple pagecache pages.
  8. *
  9. * 15May2002 Andrew Morton
  10. * Initial version
  11. * 27Jun2002 axboe@suse.de
  12. * use bio_add_page() to build bio's just the right size
  13. */
  14. /*
  15. * Copyright (C) 2012-2013 Samsung Electronics Co., Ltd.
  16. *
  17. * This program is free software; you can redistribute it and/or
  18. * modify it under the terms of the GNU General Public License
  19. * as published by the Free Software Foundation; either version 2
  20. * of the License, or (at your option) any later version.
  21. *
  22. * This program is distributed in the hope that it will be useful,
  23. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  25. * GNU General Public License for more details.
  26. *
  27. * You should have received a copy of the GNU General Public License
  28. * along with this program; if not, see <http://www.gnu.org/licenses/>.
  29. */
  30. /************************************************************************/
  31. /* */
  32. /* PROJECT : exFAT & FAT12/16/32 File System */
  33. /* FILE : core.c */
  34. /* PURPOSE : sdFAT glue layer for supporting VFS */
  35. /* */
  36. /*----------------------------------------------------------------------*/
  37. /* NOTES */
  38. /* */
  39. /* */
  40. /************************************************************************/
  41. #include <linux/version.h>
  42. #include <linux/module.h>
  43. #include <linux/time.h>
  44. #include <linux/buffer_head.h>
  45. #include <linux/exportfs.h>
  46. #include <linux/mount.h>
  47. #include <linux/vfs.h>
  48. #include <linux/parser.h>
  49. #include <linux/uio.h>
  50. #include <linux/writeback.h>
  51. #include <linux/log2.h>
  52. #include <linux/hash.h>
  53. #include <linux/backing-dev.h>
  54. #include <linux/sched.h>
  55. #include <linux/fs_struct.h>
  56. #include <linux/namei.h>
  57. #include <linux/bio.h>
  58. #include <linux/blkdev.h>
  59. #include <linux/swap.h> /* for mark_page_accessed() */
  60. #include <asm/current.h>
  61. #include <asm/unaligned.h>
  62. #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
  63. #include <linux/aio.h>
  64. #endif
  65. #include "sdfat.h"
  66. #ifdef CONFIG_SDFAT_ALIGNED_MPAGE_WRITE
  67. /*************************************************************************
  68. * INNER FUNCTIONS FOR FUNCTIONS WHICH HAS KERNEL VERSION DEPENDENCY
  69. *************************************************************************/
  70. static void __mpage_write_end_io(struct bio *bio, int err);
  71. /*************************************************************************
  72. * FUNCTIONS WHICH HAS KERNEL VERSION DEPENDENCY
  73. *************************************************************************/
  74. #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
  75. /* EMPTY */
  76. #else /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0) */
  77. static inline void bio_set_dev(struct bio *bio, struct block_device *bdev)
  78. {
  79. bio->bi_bdev = bdev;
  80. }
  81. #endif
  82. #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
  83. static inline void __sdfat_clean_bdev_aliases(struct block_device *bdev, sector_t block)
  84. {
  85. clean_bdev_aliases(bdev, block, 1);
  86. }
  87. #else /* LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0) */
  88. static inline void __sdfat_clean_bdev_aliases(struct block_device *bdev, sector_t block)
  89. {
  90. unmap_underlying_metadata(bdev, block);
  91. }
  92. #endif
  93. #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
  94. static inline void __sdfat_submit_bio_write2(int flags, struct bio *bio)
  95. {
  96. bio_set_op_attrs(bio, REQ_OP_WRITE, flags);
  97. submit_bio(bio);
  98. }
  99. #else /* LINUX_VERSION_CODE < KERNEL_VERSION(4,8,0) */
  100. static inline void __sdfat_submit_bio_write2(int flags, struct bio *bio)
  101. {
  102. submit_bio(WRITE | flags, bio);
  103. }
  104. #endif
  105. #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)
  106. static inline int bio_get_nr_vecs(struct block_device *bdev)
  107. {
  108. return BIO_MAX_PAGES;
  109. }
  110. #else /* LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) */
  111. /* EMPTY */
  112. #endif
  113. #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
  114. static inline sector_t __sdfat_bio_sector(struct bio *bio)
  115. {
  116. return bio->bi_iter.bi_sector;
  117. }
  118. static inline void __sdfat_set_bio_sector(struct bio *bio, sector_t sector)
  119. {
  120. bio->bi_iter.bi_sector = sector;
  121. }
  122. static inline unsigned int __sdfat_bio_size(struct bio *bio)
  123. {
  124. return bio->bi_iter.bi_size;
  125. }
  126. static inline void __sdfat_set_bio_size(struct bio *bio, unsigned int size)
  127. {
  128. bio->bi_iter.bi_size = size;
  129. }
  130. #else /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0) */
  131. static inline sector_t __sdfat_bio_sector(struct bio *bio)
  132. {
  133. return bio->bi_sector;
  134. }
  135. static inline void __sdfat_set_bio_sector(struct bio *bio, sector_t sector)
  136. {
  137. bio->bi_sector = sector;
  138. }
  139. static inline unsigned int __sdfat_bio_size(struct bio *bio)
  140. {
  141. return bio->bi_size;
  142. }
  143. static inline void __sdfat_set_bio_size(struct bio *bio, unsigned int size)
  144. {
  145. bio->bi_size = size;
  146. }
  147. #endif
  148. /*************************************************************************
  149. * MORE FUNCTIONS WHICH HAS KERNEL VERSION DEPENDENCY
  150. *************************************************************************/
  151. #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0)
  152. static void mpage_write_end_io(struct bio *bio)
  153. {
  154. __mpage_write_end_io(bio, blk_status_to_errno(bio->bi_status));
  155. }
  156. #elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
  157. static void mpage_write_end_io(struct bio *bio)
  158. {
  159. __mpage_write_end_io(bio, bio->bi_error);
  160. }
  161. #else /* LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0) */
  162. static void mpage_write_end_io(struct bio *bio, int err)
  163. {
  164. if (test_bit(BIO_UPTODATE, &bio->bi_flags))
  165. err = 0;
  166. __mpage_write_end_io(bio, err);
  167. }
  168. #endif
  169. /* __check_dfr_on() and __dfr_writepage_end_io() functions
  170. * are copied from sdfat.c
  171. * Each function should be same perfectly
  172. */
  173. static inline int __check_dfr_on(struct inode *inode, loff_t start, loff_t end, const char *fname)
  174. {
  175. #ifdef CONFIG_SDFAT_DFR
  176. struct defrag_info *ino_dfr = &(SDFAT_I(inode)->dfr_info);
  177. if ((atomic_read(&ino_dfr->stat) == DFR_INO_STAT_REQ) &&
  178. fsapi_dfr_check_dfr_on(inode, start, end, 0, fname))
  179. return 1;
  180. #endif
  181. return 0;
  182. }
  183. static inline int __dfr_writepage_end_io(struct page *page)
  184. {
  185. #ifdef CONFIG_SDFAT_DFR
  186. struct defrag_info *ino_dfr = &(SDFAT_I(page->mapping->host)->dfr_info);
  187. if (atomic_read(&ino_dfr->stat) == DFR_INO_STAT_REQ)
  188. fsapi_dfr_writepage_endio(page);
  189. #endif
  190. return 0;
  191. }
  192. static inline unsigned int __calc_size_to_align(struct super_block *sb)
  193. {
  194. struct block_device *bdev = sb->s_bdev;
  195. struct gendisk *disk;
  196. struct request_queue *queue;
  197. struct queue_limits *limit;
  198. unsigned int max_sectors;
  199. unsigned int aligned = 0;
  200. disk = bdev->bd_disk;
  201. if (!disk)
  202. goto out;
  203. queue = disk->queue;
  204. if (!queue)
  205. goto out;
  206. limit = &queue->limits;
  207. max_sectors = limit->max_sectors;
  208. aligned = 1 << ilog2(max_sectors);
  209. if (aligned && (max_sectors & (aligned - 1)))
  210. aligned = 0;
  211. out:
  212. return aligned;
  213. }
  214. struct mpage_data {
  215. struct bio *bio;
  216. sector_t last_block_in_bio;
  217. get_block_t *get_block;
  218. unsigned int use_writepage;
  219. unsigned int size_to_align;
  220. };
  221. /*
  222. * I/O completion handler for multipage BIOs.
  223. *
  224. * The mpage code never puts partial pages into a BIO (except for end-of-file).
  225. * If a page does not map to a contiguous run of blocks then it simply falls
  226. * back to block_read_full_page().
  227. *
  228. * Why is this? If a page's completion depends on a number of different BIOs
  229. * which can complete in any order (or at the same time) then determining the
  230. * status of that page is hard. See end_buffer_async_read() for the details.
  231. * There is no point in duplicating all that complexity.
  232. */
  233. static void __mpage_write_end_io(struct bio *bio, int err)
  234. {
  235. struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1;
  236. ASSERT(bio_data_dir(bio) == WRITE); /* only write */
  237. do {
  238. struct page *page = bvec->bv_page;
  239. if (--bvec >= bio->bi_io_vec)
  240. prefetchw(&bvec->bv_page->flags);
  241. if (err) {
  242. SetPageError(page);
  243. if (page->mapping)
  244. mapping_set_error(page->mapping, err);
  245. }
  246. __dfr_writepage_end_io(page);
  247. end_page_writeback(page);
  248. } while (bvec >= bio->bi_io_vec);
  249. bio_put(bio);
  250. }
  251. static struct bio *mpage_bio_submit_write(int flags, struct bio *bio)
  252. {
  253. bio->bi_end_io = mpage_write_end_io;
  254. __sdfat_submit_bio_write2(flags, bio);
  255. return NULL;
  256. }
  257. static struct bio *
  258. mpage_alloc(struct block_device *bdev,
  259. sector_t first_sector, int nr_vecs,
  260. gfp_t gfp_flags)
  261. {
  262. struct bio *bio;
  263. bio = bio_alloc(gfp_flags, nr_vecs);
  264. if (bio == NULL && (current->flags & PF_MEMALLOC)) {
  265. while (!bio && (nr_vecs /= 2))
  266. bio = bio_alloc(gfp_flags, nr_vecs);
  267. }
  268. if (bio) {
  269. bio_set_dev(bio, bdev);
  270. __sdfat_set_bio_sector(bio, first_sector);
  271. }
  272. return bio;
  273. }
  274. static int sdfat_mpage_writepage(struct page *page,
  275. struct writeback_control *wbc, void *data)
  276. {
  277. struct mpage_data *mpd = data;
  278. struct bio *bio = mpd->bio;
  279. struct address_space *mapping = page->mapping;
  280. struct inode *inode = page->mapping->host;
  281. const unsigned int blkbits = inode->i_blkbits;
  282. const unsigned int blocks_per_page = PAGE_SIZE >> blkbits;
  283. sector_t last_block;
  284. sector_t block_in_file;
  285. sector_t blocks[MAX_BUF_PER_PAGE];
  286. unsigned int page_block;
  287. unsigned int first_unmapped = blocks_per_page;
  288. struct block_device *bdev = NULL;
  289. int boundary = 0;
  290. sector_t boundary_block = 0;
  291. struct block_device *boundary_bdev = NULL;
  292. int length;
  293. struct buffer_head map_bh;
  294. loff_t i_size = i_size_read(inode);
  295. unsigned long end_index = i_size >> PAGE_SHIFT;
  296. int ret = 0;
  297. if (page_has_buffers(page)) {
  298. struct buffer_head *head = page_buffers(page);
  299. struct buffer_head *bh = head;
  300. /* If they're all mapped and dirty, do it */
  301. page_block = 0;
  302. do {
  303. BUG_ON(buffer_locked(bh));
  304. if (!buffer_mapped(bh)) {
  305. /*
  306. * unmapped dirty buffers are created by
  307. * __set_page_dirty_buffers -> mmapped data
  308. */
  309. if (buffer_dirty(bh))
  310. goto confused;
  311. if (first_unmapped == blocks_per_page)
  312. first_unmapped = page_block;
  313. continue;
  314. }
  315. if (first_unmapped != blocks_per_page)
  316. goto confused; /* hole -> non-hole */
  317. if (!buffer_dirty(bh) || !buffer_uptodate(bh))
  318. goto confused;
  319. /* bh should be mapped if delay is set */
  320. if (buffer_delay(bh)) {
  321. sector_t blk_in_file =
  322. (sector_t)(page->index << (PAGE_SHIFT - blkbits)) + page_block;
  323. BUG_ON(bh->b_size != (1 << blkbits));
  324. if (page->index > end_index) {
  325. MMSG("%s(inode:%p) "
  326. "over end with delayed buffer"
  327. "(page_idx:%u, end_idx:%u)\n",
  328. __func__, inode,
  329. (u32)page->index,
  330. (u32)end_index);
  331. goto confused;
  332. }
  333. ret = mpd->get_block(inode, blk_in_file, bh, 1);
  334. if (ret) {
  335. MMSG("%s(inode:%p) "
  336. "failed to getblk(ret:%d)\n",
  337. __func__, inode, ret);
  338. goto confused;
  339. }
  340. BUG_ON(buffer_delay(bh));
  341. if (buffer_new(bh)) {
  342. clear_buffer_new(bh);
  343. __sdfat_clean_bdev_aliases(bh->b_bdev, bh->b_blocknr);
  344. }
  345. }
  346. if (page_block) {
  347. if (bh->b_blocknr != blocks[page_block-1] + 1) {
  348. MMSG("%s(inode:%p) pblk(%d) "
  349. "no_seq(prev:%lld, new:%lld)\n",
  350. __func__, inode, page_block,
  351. (u64)blocks[page_block-1],
  352. (u64)bh->b_blocknr);
  353. goto confused;
  354. }
  355. }
  356. blocks[page_block++] = bh->b_blocknr;
  357. boundary = buffer_boundary(bh);
  358. if (boundary) {
  359. boundary_block = bh->b_blocknr;
  360. boundary_bdev = bh->b_bdev;
  361. }
  362. bdev = bh->b_bdev;
  363. } while ((bh = bh->b_this_page) != head);
  364. if (first_unmapped)
  365. goto page_is_mapped;
  366. /*
  367. * Page has buffers, but they are all unmapped. The page was
  368. * created by pagein or read over a hole which was handled by
  369. * block_read_full_page(). If this address_space is also
  370. * using mpage_readpages then this can rarely happen.
  371. */
  372. goto confused;
  373. }
  374. /*
  375. * The page has no buffers: map it to disk
  376. */
  377. BUG_ON(!PageUptodate(page));
  378. block_in_file = (sector_t)page->index << (PAGE_SHIFT - blkbits);
  379. last_block = (i_size - 1) >> blkbits;
  380. map_bh.b_page = page;
  381. for (page_block = 0; page_block < blocks_per_page; ) {
  382. map_bh.b_state = 0;
  383. map_bh.b_size = 1 << blkbits;
  384. if (mpd->get_block(inode, block_in_file, &map_bh, 1))
  385. goto confused;
  386. if (buffer_new(&map_bh))
  387. __sdfat_clean_bdev_aliases(map_bh.b_bdev, map_bh.b_blocknr);
  388. if (buffer_boundary(&map_bh)) {
  389. boundary_block = map_bh.b_blocknr;
  390. boundary_bdev = map_bh.b_bdev;
  391. }
  392. if (page_block) {
  393. if (map_bh.b_blocknr != blocks[page_block-1] + 1)
  394. goto confused;
  395. }
  396. blocks[page_block++] = map_bh.b_blocknr;
  397. boundary = buffer_boundary(&map_bh);
  398. bdev = map_bh.b_bdev;
  399. if (block_in_file == last_block)
  400. break;
  401. block_in_file++;
  402. }
  403. BUG_ON(page_block == 0);
  404. first_unmapped = page_block;
  405. page_is_mapped:
  406. if (page->index >= end_index) {
  407. /*
  408. * The page straddles i_size. It must be zeroed out on each
  409. * and every writepage invocation because it may be mmapped.
  410. * "A file is mapped in multiples of the page size. For a file
  411. * that is not a multiple of the page size, the remaining memory
  412. * is zeroed when mapped, and writes to that region are not
  413. * written out to the file."
  414. */
  415. unsigned int offset = i_size & (PAGE_SIZE - 1);
  416. if (page->index > end_index || !offset) {
  417. MMSG("%s(inode:%p) over end "
  418. "(page_idx:%u, end_idx:%u off:%u)\n",
  419. __func__, inode, (u32)page->index,
  420. (u32)end_index, (u32)offset);
  421. goto confused;
  422. }
  423. zero_user_segment(page, offset, PAGE_SIZE);
  424. }
  425. /*
  426. * This page will go to BIO. Do we need to send this BIO off first?
  427. *
  428. * REMARK : added ELSE_IF for ALIGNMENT_MPAGE_WRITE of SDFAT
  429. */
  430. if (bio) {
  431. if (mpd->last_block_in_bio != blocks[0] - 1) {
  432. bio = mpage_bio_submit_write(0, bio);
  433. } else if (mpd->size_to_align) {
  434. unsigned int mask = mpd->size_to_align - 1;
  435. sector_t max_end_block =
  436. (__sdfat_bio_sector(bio) & ~(mask)) + mask;
  437. if ((__sdfat_bio_size(bio) != (1 << (mask + 1))) &&
  438. (mpd->last_block_in_bio == max_end_block)) {
  439. MMSG("%s(inode:%p) alignment mpage_bio_submit"
  440. "(start:%u, len:%u aligned:%u)\n",
  441. __func__, inode,
  442. (unsigned int)__sdfat_bio_sector(bio),
  443. (unsigned int)(mpd->last_block_in_bio -
  444. __sdfat_bio_sector(bio) + 1),
  445. (unsigned int)mpd->size_to_align);
  446. bio = mpage_bio_submit_write(REQ_NOMERGE, bio);
  447. }
  448. }
  449. }
  450. alloc_new:
  451. if (!bio) {
  452. bio = mpage_alloc(bdev, blocks[0] << (blkbits - 9),
  453. bio_get_nr_vecs(bdev), GFP_NOFS|__GFP_HIGH);
  454. if (!bio)
  455. goto confused;
  456. }
  457. /*
  458. * Must try to add the page before marking the buffer clean or
  459. * the confused fail path above (OOM) will be very confused when
  460. * it finds all bh marked clean (i.e. it will not write anything)
  461. */
  462. length = first_unmapped << blkbits;
  463. if (bio_add_page(bio, page, length, 0) < length) {
  464. bio = mpage_bio_submit_write(0, bio);
  465. goto alloc_new;
  466. }
  467. /*
  468. * OK, we have our BIO, so we can now mark the buffers clean. Make
  469. * sure to only clean buffers which we know we'll be writing.
  470. */
  471. if (page_has_buffers(page)) {
  472. struct buffer_head *head = page_buffers(page);
  473. struct buffer_head *bh = head;
  474. unsigned int buffer_counter = 0;
  475. do {
  476. if (buffer_counter++ == first_unmapped)
  477. break;
  478. clear_buffer_dirty(bh);
  479. bh = bh->b_this_page;
  480. } while (bh != head);
  481. /*
  482. * we cannot drop the bh if the page is not uptodate
  483. * or a concurrent readpage would fail to serialize with the bh
  484. * and it would read from disk before we reach the platter.
  485. */
  486. if (buffer_heads_over_limit && PageUptodate(page))
  487. try_to_free_buffers(page);
  488. }
  489. BUG_ON(PageWriteback(page));
  490. set_page_writeback(page);
  491. /*
  492. * FIXME FOR DEFRAGMENTATION : CODE REVIEW IS REQUIRED
  493. *
  494. * Turn off MAPPED flag in victim's bh if defrag on.
  495. * Another write_begin can starts after get_block for defrag victims
  496. * called.
  497. * In this case, write_begin calls get_block and get original block
  498. * number and previous defrag will be canceled.
  499. */
  500. if (unlikely(__check_dfr_on(inode, (loff_t)(page->index << PAGE_SHIFT),
  501. (loff_t)((page->index + 1) << PAGE_SHIFT), __func__))) {
  502. struct buffer_head *head = page_buffers(page);
  503. struct buffer_head *bh = head;
  504. do {
  505. clear_buffer_mapped(bh);
  506. bh = bh->b_this_page;
  507. } while (bh != head);
  508. }
  509. unlock_page(page);
  510. if (boundary || (first_unmapped != blocks_per_page)) {
  511. bio = mpage_bio_submit_write(0, bio);
  512. if (boundary_block) {
  513. write_boundary_block(boundary_bdev,
  514. boundary_block, 1 << blkbits);
  515. }
  516. } else {
  517. mpd->last_block_in_bio = blocks[blocks_per_page - 1];
  518. }
  519. goto out;
  520. confused:
  521. if (bio)
  522. bio = mpage_bio_submit_write(0, bio);
  523. if (mpd->use_writepage) {
  524. ret = mapping->a_ops->writepage(page, wbc);
  525. } else {
  526. ret = -EAGAIN;
  527. goto out;
  528. }
  529. /*
  530. * The caller has a ref on the inode, so *mapping is stable
  531. */
  532. mapping_set_error(mapping, ret);
  533. out:
  534. mpd->bio = bio;
  535. return ret;
  536. }
  537. int sdfat_mpage_writepages(struct address_space *mapping,
  538. struct writeback_control *wbc, get_block_t *get_block)
  539. {
  540. struct blk_plug plug;
  541. int ret;
  542. struct mpage_data mpd = {
  543. .bio = NULL,
  544. .last_block_in_bio = 0,
  545. .get_block = get_block,
  546. .use_writepage = 1,
  547. .size_to_align = __calc_size_to_align(mapping->host->i_sb),
  548. };
  549. BUG_ON(!get_block);
  550. blk_start_plug(&plug);
  551. ret = write_cache_pages(mapping, wbc, sdfat_mpage_writepage, &mpd);
  552. if (mpd.bio)
  553. mpage_bio_submit_write(0, mpd.bio);
  554. blk_finish_plug(&plug);
  555. return ret;
  556. }
  557. #endif /* CONFIG_SDFAT_ALIGNED_MPAGE_WRITE */