Lines Matching refs:page

27  * map_mft_record_page - map the page in which a specific mft record resides
28 * @ni: ntfs inode whose mft record page to map
30 * This maps the page in which the mft record of the ntfs inode @ni is situated
31 * and returns a pointer to the mft record within the mapped page.
41 struct page *page;
45 BUG_ON(ni->page);
47 * The index into the page cache and the offset within the page cache
48 * page of the wanted mft record. FIXME: We need to check for
57 /* The maximum valid index into the page cache for $MFT's data. */
64 page = ERR_PTR(-ENOENT);
72 /* Read, map, and pin the page. */
73 page = ntfs_map_page(mft_vi->i_mapping, index);
74 if (!IS_ERR(page)) {
76 if (likely(ntfs_is_mft_recordp((le32*)(page_address(page) +
78 ni->page = page;
80 return page_address(page) + ofs;
84 ntfs_unmap_page(page);
85 page = ERR_PTR(-EIO);
89 ni->page = NULL;
91 return (void*)page;
101 * The page of the record is mapped using map_mft_record_page() before being
104 * This in turn uses ntfs_map_page() to get the page containing the wanted mft
106 * necessary, increments the use count on the page so that it cannot disappear
107 * under us and returns a reference to the page cache page).
109 * If read_cache_page() invokes ntfs_readpage() to load the page from disk, it
110 * sets PG_locked and clears PG_uptodate on the page. Once I/O has completed
111 * and the post-read mst fixups on each mft record in the page have been
112 * performed, the page gets PG_uptodate set and PG_locked cleared (this is done
116 * sufficient protection against races when reading/using the page.
120 * PG_locked and clear PG_uptodate making sure nobody is touching the page
122 * the page cache code paths is automatically sufficiently locked with us as
123 * we will not touch a page that has been locked or is not uptodate. The only
124 * locking problem then is them locking the page while we are accessing it.
127 * records/inodes present in the page before I/O can proceed. In that case we
167 * unmap_mft_record_page - unmap the page in which a specific mft record resides
168 * @ni: ntfs inode whose mft record page to unmap
170 * This unmaps the page in which the mft record of the ntfs inode @ni is
174 * count on the page thus releasing it from the pinned state.
176 * We do not actually unmap the page from memory of course, as that will be
177 * done by the page cache code itself when memory pressure increases or
182 BUG_ON(!ni->page);
185 ntfs_unmap_page(ni->page);
186 ni->page = NULL;
195 * We release the page mapping and the mrec_lock mutex which unmaps the mft
204 struct page *page = ni->page;
206 BUG_ON(!page);
362 * __mark_mft_record_dirty - set the mft record and the page containing it dirty
368 * as well as the page containing the mft record, dirty. Also, mark the base
374 * it is dirty in the inode meta data rather than the data page cache of the
390 mark_ntfs_record_dirty(ni->page, ni->page_ofs);
413 * bypassing the page cache and the $MFTMirr inode itself.
457 struct page *page;
479 /* Get the page containing the mirror copy of the mft record @m. */
480 page = ntfs_map_page(vol->mftmirr_ino->i_mapping, mft_no >>
482 if (IS_ERR(page)) {
483 ntfs_error(vol->sb, "Failed to map mft mirror page.");
484 err = PTR_ERR(page);
487 lock_page(page);
488 BUG_ON(!PageUptodate(page));
489 ClearPageUptodate(page);
490 /* Offset of the mft mirror record inside the page. */
492 /* The address in the page of the mirror copy of the mft record @m. */
493 kmirr = page_address(page) + page_ofs;
497 if (unlikely(!page_has_buffers(page))) {
500 bh = head = alloc_page_buffers(page, blocksize, true);
507 attach_page_private(page, head);
509 bh = head = page_buffers(page);
514 m_start = kmirr - (u8*)page_address(page);
596 * Set the buffer uptodate so the page and
610 flush_dcache_page(page);
611 SetPageUptodate(page);
612 unlock_page(page);
613 ntfs_unmap_page(page);
663 struct page *page = ni->page;
676 BUG_ON(!PageLocked(page));
685 * for the mft record @m and the page it is in.
689 bh = head = page_buffers(page);
796 * Set the buffer uptodate so the page and buffer
799 if (PageUptodate(page))
857 * The caller has locked the page and cleared the uptodate flag on it which
883 * locked before the page is locked but we already have the page locked here
957 * inode write via the inode dirty code paths and the page
1133 struct page *page;
1183 * If we are still within the active pass, search the next page
1187 page = ntfs_map_page(mftbmp_mapping,
1189 if (IS_ERR(page)) {
1192 return PTR_ERR(page);
1194 buf = (u8*)page_address(page) + page_ofs;
1209 ntfs_unmap_page(page);
1213 flush_dcache_page(page);
1214 set_page_dirty(page);
1215 ntfs_unmap_page(page);
1227 ntfs_unmap_page(page);
1278 struct page *page;
1325 page = ntfs_map_page(vol->lcnbmp_ino->i_mapping,
1327 if (IS_ERR(page)) {
1330 return PTR_ERR(page);
1332 b = (u8*)page_address(page) + (ll & ~PAGE_MASK);
1338 flush_dcache_page(page);
1339 set_page_dirty(page);
1341 ntfs_unmap_page(page);
1349 ntfs_unmap_page(page);
2092 struct page *page;
2100 * The index into the page cache and the offset within the page cache
2101 * page of the wanted mft record.
2105 /* The maximum valid index into the page cache for $MFT's data. */
2116 /* Read, map, and pin the page containing the mft record. */
2117 page = ntfs_map_page(mft_vi->i_mapping, index);
2118 if (IS_ERR(page)) {
2119 ntfs_error(vol->sb, "Failed to map page containing mft record "
2121 return PTR_ERR(page);
2123 lock_page(page);
2124 BUG_ON(!PageUptodate(page));
2125 ClearPageUptodate(page);
2126 m = (MFT_RECORD*)((u8*)page_address(page) + ofs);
2131 SetPageUptodate(page);
2132 unlock_page(page);
2133 ntfs_unmap_page(page);
2136 flush_dcache_page(page);
2137 SetPageUptodate(page);
2138 unlock_page(page);
2144 mark_ntfs_record_dirty(page, ofs);
2145 ntfs_unmap_page(page);
2246 struct page *page;
2513 * index of and the offset within the page cache page the record is in.
2517 /* Read, map, and pin the page containing the mft record. */
2518 page = ntfs_map_page(vol->mft_ino->i_mapping, index);
2519 if (IS_ERR(page)) {
2520 ntfs_error(vol->sb, "Failed to map page containing allocated "
2522 err = PTR_ERR(page);
2525 lock_page(page);
2526 BUG_ON(!PageUptodate(page));
2527 ClearPageUptodate(page);
2528 m = (MFT_RECORD*)((u8*)page_address(page) + ofs);
2540 SetPageUptodate(page);
2541 unlock_page(page);
2542 ntfs_unmap_page(page);
2559 SetPageUptodate(page);
2560 unlock_page(page);
2561 ntfs_unmap_page(page);
2573 flush_dcache_page(page);
2574 SetPageUptodate(page);
2598 flush_dcache_page(page);
2600 mark_ntfs_record_dirty(page, ofs);
2601 unlock_page(page);
2602 ntfs_unmap_page(page);
2613 mark_ntfs_record_dirty(page, ofs);
2614 unlock_page(page);
2616 * Need to unmap the page since map_extent_mft_record() mapped
2619 ntfs_unmap_page(page);
2632 flush_dcache_page(page);
2634 mark_ntfs_record_dirty(page, ofs);
2635 unlock_page(page);
2636 ntfs_unmap_page(page);
2697 * have its page mapped and it is very easy to do.
2701 ni->page = page;
2713 mark_ntfs_record_dirty(page, ofs);
2714 unlock_page(page);