@@ -145,7 +145,7 @@ _xfs_buf_alloc(
145145 * We don't want certain flags to appear in b_flags unless they are
146146 * specifically set by later operations on the buffer.
147147 */
148- flags &= ~(XBF_UNMAPPED | XBF_TRYLOCK | XBF_ASYNC | XBF_READ_AHEAD );
148+ flags &= ~(XBF_TRYLOCK | XBF_ASYNC | XBF_READ_AHEAD );
149149
150150 /*
151151 * A new buffer is held and locked by the owner. This ensures that the
@@ -289,9 +289,7 @@ xfs_buf_alloc_kmem(
289289 *
290290 * The third type of buffer is the multi-page buffer. These are always made
291291 * up of single pages so that they can be fed to vmap_ram() to return a
292- * contiguous memory region we can access the data through, or mark it as
293- * XBF_UNMAPPED and access the data directly through individual page_address()
294- * calls.
292+ * contiguous memory region we can access the data through.
295293 */
296294static int
297295xfs_buf_alloc_backing_mem (
@@ -413,8 +411,6 @@ _xfs_buf_map_pages(
413411 if (bp -> b_page_count == 1 ) {
414412 /* A single page buffer is always mappable */
415413 bp -> b_addr = page_address (bp -> b_pages [0 ]);
416- } else if (flags & XBF_UNMAPPED ) {
417- bp -> b_addr = NULL ;
418414 } else {
419415 int retried = 0 ;
420416 unsigned nofs_flag ;
@@ -1345,7 +1341,7 @@ __xfs_buf_ioend(
13451341 trace_xfs_buf_iodone (bp , _RET_IP_ );
13461342
13471343 if (bp -> b_flags & XBF_READ ) {
1348- if (!bp -> b_error && bp -> b_addr && is_vmalloc_addr (bp -> b_addr ))
1344+ if (!bp -> b_error && is_vmalloc_addr (bp -> b_addr ))
13491345 invalidate_kernel_vmap_range (bp -> b_addr ,
13501346 xfs_buf_vmap_len (bp ));
13511347 if (!bp -> b_error && bp -> b_ops )
@@ -1526,7 +1522,7 @@ xfs_buf_submit_bio(
15261522 __bio_add_page (bio , bp -> b_pages [p ], PAGE_SIZE , 0 );
15271523 bio -> bi_iter .bi_size = size ; /* limit to the actual size used */
15281524
1529- if (bp -> b_addr && is_vmalloc_addr (bp -> b_addr ))
1525+ if (is_vmalloc_addr (bp -> b_addr ))
15301526 flush_kernel_vmap_range (bp -> b_addr ,
15311527 xfs_buf_vmap_len (bp ));
15321528 }
@@ -1657,52 +1653,6 @@ xfs_buf_submit(
16571653 xfs_buf_submit_bio (bp );
16581654}
16591655
1660- void *
1661- xfs_buf_offset (
1662- struct xfs_buf * bp ,
1663- size_t offset )
1664- {
1665- struct page * page ;
1666-
1667- if (bp -> b_addr )
1668- return bp -> b_addr + offset ;
1669-
1670- page = bp -> b_pages [offset >> PAGE_SHIFT ];
1671- return page_address (page ) + (offset & (PAGE_SIZE - 1 ));
1672- }
1673-
1674- void
1675- xfs_buf_zero (
1676- struct xfs_buf * bp ,
1677- size_t boff ,
1678- size_t bsize )
1679- {
1680- size_t bend ;
1681-
1682- if (bp -> b_addr ) {
1683- memset (bp -> b_addr + boff , 0 , bsize );
1684- return ;
1685- }
1686-
1687- bend = boff + bsize ;
1688- while (boff < bend ) {
1689- struct page * page ;
1690- int page_index , page_offset , csize ;
1691-
1692- page_index = boff >> PAGE_SHIFT ;
1693- page_offset = boff & ~PAGE_MASK ;
1694- page = bp -> b_pages [page_index ];
1695- csize = min_t (size_t , PAGE_SIZE - page_offset ,
1696- BBTOB (bp -> b_length ) - boff );
1697-
1698- ASSERT ((csize + page_offset ) <= PAGE_SIZE );
1699-
1700- memset (page_address (page ) + page_offset , 0 , csize );
1701-
1702- boff += csize ;
1703- }
1704- }
1705-
17061656/*
17071657 * Log a message about and stale a buffer that a caller has decided is corrupt.
17081658 *
0 commit comments