/linux-6.12.1/fs/iomap/ |
D | swapfile.c | 15 struct iomap iomap; /* accumulated iomap */ member 32 struct iomap *iomap = &isi->iomap; in iomap_swapfile_add_extent() local 48 first_ppage = ALIGN(iomap->addr, PAGE_SIZE) >> PAGE_SHIFT; in iomap_swapfile_add_extent() 49 next_ppage = ALIGN_DOWN(iomap->addr + iomap->length, PAGE_SIZE) >> in iomap_swapfile_add_extent() 64 if (iomap->offset == 0) in iomap_swapfile_add_extent() 98 struct iomap *iomap, struct iomap_swapfile_info *isi) in iomap_swapfile_iter() argument 100 switch (iomap->type) { in iomap_swapfile_iter() 113 if (iomap->flags & IOMAP_F_DIRTY) in iomap_swapfile_iter() 115 if (iomap->flags & IOMAP_F_SHARED) in iomap_swapfile_iter() 119 if (iomap->bdev != isi->sis->bdev) in iomap_swapfile_iter() [all …]
|
D | fiemap.c | 13 const struct iomap *iomap, u32 flags) in iomap_to_fiemap() argument 15 switch (iomap->type) { in iomap_to_fiemap() 32 if (iomap->flags & IOMAP_F_MERGED) in iomap_to_fiemap() 34 if (iomap->flags & IOMAP_F_SHARED) in iomap_to_fiemap() 37 return fiemap_fill_next_extent(fi, iomap->offset, in iomap_to_fiemap() 38 iomap->addr != IOMAP_NULL_ADDR ? iomap->addr : 0, in iomap_to_fiemap() 39 iomap->length, flags); in iomap_to_fiemap() 43 struct fiemap_extent_info *fi, struct iomap *prev) in iomap_fiemap_iter() 47 if (iter->iomap.type == IOMAP_HOLE) in iomap_fiemap_iter() 51 *prev = iter->iomap; in iomap_fiemap_iter() [all …]
|
D | iter.c | 24 bool stale = iter->iomap.flags & IOMAP_F_STALE; in iomap_iter_advance() 27 if (iter->iomap.length) { in iomap_iter_advance() 42 memset(&iter->iomap, 0, sizeof(iter->iomap)); in iomap_iter_advance() 49 WARN_ON_ONCE(iter->iomap.offset > iter->pos); in iomap_iter_done() 50 WARN_ON_ONCE(iter->iomap.length == 0); in iomap_iter_done() 51 WARN_ON_ONCE(iter->iomap.offset + iter->iomap.length <= iter->pos); in iomap_iter_done() 52 WARN_ON_ONCE(iter->iomap.flags & IOMAP_F_STALE); in iomap_iter_done() 54 trace_iomap_iter_dstmap(iter->inode, &iter->iomap); in iomap_iter_done() 78 if (iter->iomap.length && ops->iomap_end) { in iomap_iter() 81 iter->flags, &iter->iomap); in iomap_iter() [all …]
|
D | trace.h | 18 #define TRACE_SYSTEM iomap 117 TP_PROTO(struct inode *inode, struct iomap *iomap), 118 TP_ARGS(inode, iomap), 132 __entry->addr = iomap->addr; 133 __entry->offset = iomap->offset; 134 __entry->length = iomap->length; 135 __entry->type = iomap->type; 136 __entry->flags = iomap->flags; 137 __entry->bdev = iomap->bdev ? iomap->bdev->bd_dev : 0; 153 TP_PROTO(struct inode *inode, struct iomap *iomap), \ [all …]
|
D | buffered-io.c | 342 const struct iomap *iomap = iomap_iter_srcmap(iter); in iomap_read_inline_data() local 343 size_t size = i_size_read(iter->inode) - iomap->offset; in iomap_read_inline_data() 344 size_t offset = offset_in_folio(folio, iomap->offset); in iomap_read_inline_data() 349 if (WARN_ON_ONCE(size > iomap->length)) in iomap_read_inline_data() 354 folio_fill_tail(folio, offset, iomap->inline_data, size); in iomap_read_inline_data() 362 const struct iomap *srcmap = iomap_iter_srcmap(iter); in iomap_block_needs_zeroing() 372 const struct iomap *iomap = &iter->iomap; in iomap_readpage_iter() local 381 if (iomap->type == IOMAP_INLINE) in iomap_readpage_iter() 403 sector = iomap_sector(iomap, pos); in iomap_readpage_iter() 416 ctx->bio = bio_alloc(iomap->bdev, bio_max_segs(nr_vecs), in iomap_readpage_iter() [all …]
|
D | direct-io.c | 66 return bio_alloc_bioset(iter->iomap.bdev, nr_vecs, opf, in iomap_dio_alloc_bio() 68 return bio_alloc(iter->iomap.bdev, nr_vecs, opf, GFP_KERNEL); in iomap_dio_alloc_bio() 259 bio->bi_iter.bi_sector = iomap_sector(&iter->iomap, pos); in iomap_dio_zero() 274 const struct iomap *iomap, bool use_fua) in iomap_dio_bio_opflags() argument 293 const struct iomap *iomap = &iter->iomap; in iomap_dio_bio_iter() local 306 if ((pos | length) & (bdev_logical_block_size(iomap->bdev) - 1) || in iomap_dio_bio_iter() 307 !bdev_iter_is_aligned(iomap->bdev, dio->submit.iter)) in iomap_dio_bio_iter() 310 if (iomap->type == IOMAP_UNWRITTEN) { in iomap_dio_bio_iter() 315 if (iomap->flags & IOMAP_F_SHARED) in iomap_dio_bio_iter() 318 if (iomap->flags & IOMAP_F_NEW) { in iomap_dio_bio_iter() [all …]
|
D | Makefile | 9 obj-$(CONFIG_FS_IOMAP) += iomap.o 11 iomap-y += trace.o \ 13 iomap-$(CONFIG_BLOCK) += buffered-io.o \ 17 iomap-$(CONFIG_SWAP) += swapfile.o
|
/linux-6.12.1/include/linux/ |
D | io-mapping.h | 42 io_mapping_init_wc(struct io_mapping *iomap, in io_mapping_init_wc() argument 51 iomap->base = base; in io_mapping_init_wc() 52 iomap->size = size; in io_mapping_init_wc() 53 iomap->prot = prot; in io_mapping_init_wc() 54 return iomap; in io_mapping_init_wc() 131 io_mapping_init_wc(struct io_mapping *iomap, in io_mapping_init_wc() argument 135 iomap->iomem = ioremap_wc(base, size); in io_mapping_init_wc() 136 if (!iomap->iomem) in io_mapping_init_wc() 139 iomap->base = base; in io_mapping_init_wc() 140 iomap->size = size; in io_mapping_init_wc() [all …]
|
D | iomap.h | 94 struct iomap { struct 108 static inline sector_t iomap_sector(const struct iomap *iomap, loff_t pos) in iomap_sector() argument 110 return (iomap->addr + pos - iomap->offset) >> SECTOR_SHIFT; in iomap_sector() 116 static inline void *iomap_inline_data(const struct iomap *iomap, loff_t pos) in iomap_inline_data() argument 118 return iomap->inline_data + pos - iomap->offset; in iomap_inline_data() 126 static inline bool iomap_inline_data_valid(const struct iomap *iomap) in iomap_inline_data_valid() argument 128 return iomap->length <= PAGE_SIZE - offset_in_page(iomap->inline_data); in iomap_inline_data_valid() 162 bool (*iomap_valid)(struct inode *inode, const struct iomap *iomap); 189 unsigned flags, struct iomap *iomap, 190 struct iomap *srcmap); [all …]
|
/linux-6.12.1/drivers/ata/ |
D | pata_cs5520.c | 121 void __iomem *iomap[5]; in cs5520_init_one() local 160 iomap[0] = devm_ioport_map(&pdev->dev, cmd_port[0], 8); in cs5520_init_one() 161 iomap[1] = devm_ioport_map(&pdev->dev, ctl_port[0], 1); in cs5520_init_one() 162 iomap[2] = devm_ioport_map(&pdev->dev, cmd_port[1], 8); in cs5520_init_one() 163 iomap[3] = devm_ioport_map(&pdev->dev, ctl_port[1], 1); in cs5520_init_one() 164 iomap[4] = pcim_iomap(pdev, 2, 0); in cs5520_init_one() 166 if (!iomap[0] || !iomap[1] || !iomap[2] || !iomap[3] || !iomap[4]) in cs5520_init_one() 170 ioaddr->cmd_addr = iomap[0]; in cs5520_init_one() 171 ioaddr->ctl_addr = iomap[1]; in cs5520_init_one() 172 ioaddr->altstatus_addr = iomap[1]; in cs5520_init_one() [all …]
|
D | sata_uli.c | 135 void __iomem * const *iomap; in uli_init_one() local 166 iomap = host->iomap; in uli_init_one() 177 ioaddr->cmd_addr = iomap[0] + 8; in uli_init_one() 180 ((unsigned long)iomap[1] | ATA_PCI_CTL_OFS) + 4; in uli_init_one() 181 ioaddr->bmdma_addr = iomap[4] + 16; in uli_init_one() 192 ioaddr->cmd_addr = iomap[2] + 8; in uli_init_one() 195 ((unsigned long)iomap[3] | ATA_PCI_CTL_OFS) + 4; in uli_init_one() 196 ioaddr->bmdma_addr = iomap[4] + 24; in uli_init_one()
|
/linux-6.12.1/fs/xfs/ |
D | xfs_iomap.c | 75 const struct iomap *iomap) in xfs_iomap_valid() argument 79 if (iomap->validity_cookie != in xfs_iomap_valid() 80 xfs_iomap_inode_sequence(ip, iomap->flags)) { in xfs_iomap_valid() 81 trace_xfs_iomap_invalid(ip, iomap); in xfs_iomap_valid() 96 struct iomap *iomap, in xfs_bmbt_to_iomap() argument 111 iomap->addr = IOMAP_NULL_ADDR; in xfs_bmbt_to_iomap() 112 iomap->type = IOMAP_HOLE; in xfs_bmbt_to_iomap() 115 iomap->addr = IOMAP_NULL_ADDR; in xfs_bmbt_to_iomap() 116 iomap->type = IOMAP_DELALLOC; in xfs_bmbt_to_iomap() 118 iomap->addr = BBTOB(xfs_fsb_to_db(ip, imap->br_startblock)); in xfs_bmbt_to_iomap() [all …]
|
D | xfs_aops.c | 204 if (offset < wpc->iomap.offset || in xfs_imap_valid() 205 offset >= wpc->iomap.offset + wpc->iomap.length) in xfs_imap_valid() 212 if (wpc->iomap.flags & IOMAP_F_SHARED) in xfs_imap_valid() 223 trace_xfs_wb_data_iomap_invalid(ip, &wpc->iomap, in xfs_imap_valid() 229 trace_xfs_wb_cow_iomap_invalid(ip, &wpc->iomap, in xfs_imap_valid() 348 xfs_bmbt_to_iomap(ip, &wpc->iomap, &imap, 0, 0, XFS_WPC(wpc)->data_seq); in xfs_map_blocks() 364 &wpc->iomap, seq); in xfs_map_blocks() 387 if (cow_offset < wpc->iomap.offset + wpc->iomap.length) in xfs_map_blocks() 388 wpc->iomap.length = cow_offset - wpc->iomap.offset; in xfs_map_blocks() 391 ASSERT(wpc->iomap.offset <= offset); in xfs_map_blocks() [all …]
|
/linux-6.12.1/fs/gfs2/ |
D | bmap.c | 585 struct metapath *mp, struct iomap *iomap) in gfs2_hole_size() argument 600 iomap->length = hole_size << inode->i_blkbits; in gfs2_hole_size() 661 static int __gfs2_iomap_alloc(struct inode *inode, struct iomap *iomap, in __gfs2_iomap_alloc() argument 669 size_t dblks = iomap->length >> inode->i_blkbits; in __gfs2_iomap_alloc() 765 iomap->addr = bn << inode->i_blkbits; in __gfs2_iomap_alloc() 766 iomap->flags |= IOMAP_F_MERGED | IOMAP_F_NEW; in __gfs2_iomap_alloc() 771 } while (iomap->addr == IOMAP_NULL_ADDR); in __gfs2_iomap_alloc() 773 iomap->type = IOMAP_MAPPED; in __gfs2_iomap_alloc() 774 iomap->length = (u64)dblks << inode->i_blkbits; in __gfs2_iomap_alloc() 841 unsigned flags, struct iomap *iomap, in __gfs2_iomap_get() argument [all …]
|
D | bmap.h | 53 struct iomap *iomap); 55 struct iomap *iomap);
|
/linux-6.12.1/fs/zonefs/ |
D | file.c | 29 struct iomap *iomap, struct iomap *srcmap) in zonefs_read_iomap_begin() argument 41 iomap->bdev = inode->i_sb->s_bdev; in zonefs_read_iomap_begin() 42 iomap->offset = ALIGN_DOWN(offset, sb->s_blocksize); in zonefs_read_iomap_begin() 44 if (iomap->offset >= isize) { in zonefs_read_iomap_begin() 45 iomap->type = IOMAP_HOLE; in zonefs_read_iomap_begin() 46 iomap->addr = IOMAP_NULL_ADDR; in zonefs_read_iomap_begin() 47 iomap->length = length; in zonefs_read_iomap_begin() 49 iomap->type = IOMAP_MAPPED; in zonefs_read_iomap_begin() 50 iomap->addr = (z->z_sector << SECTOR_SHIFT) + iomap->offset; in zonefs_read_iomap_begin() 51 iomap->length = isize - iomap->offset; in zonefs_read_iomap_begin() [all …]
|
D | trace.h | 76 TP_PROTO(struct inode *inode, struct iomap *iomap), 77 TP_ARGS(inode, iomap), 88 __entry->addr = iomap->addr; 89 __entry->offset = iomap->offset; 90 __entry->length = iomap->length;
|
/linux-6.12.1/fs/erofs/ |
D | data.c | 286 unsigned int flags, struct iomap *iomap, struct iomap *srcmap) in erofs_iomap_begin() argument 308 iomap->offset = map.m_la; in erofs_iomap_begin() 310 iomap->dax_dev = mdev.m_daxdev; in erofs_iomap_begin() 312 iomap->bdev = mdev.m_bdev; in erofs_iomap_begin() 313 iomap->length = map.m_llen; in erofs_iomap_begin() 314 iomap->flags = 0; in erofs_iomap_begin() 315 iomap->private = NULL; in erofs_iomap_begin() 318 iomap->type = IOMAP_HOLE; in erofs_iomap_begin() 319 iomap->addr = IOMAP_NULL_ADDR; in erofs_iomap_begin() 320 if (!iomap->length) in erofs_iomap_begin() [all …]
|
/linux-6.12.1/fs/nfsd/ |
D | blocklayout.c | 28 struct iomap iomap; in nfsd4_block_proc_layoutget() local 48 &iomap, seg->iomode != IOMODE_READ, in nfsd4_block_proc_layoutget() 56 if (iomap.length < args->lg_minlength) { in nfsd4_block_proc_layoutget() 61 switch (iomap.type) { in nfsd4_block_proc_layoutget() 67 bex->soff = iomap.addr; in nfsd4_block_proc_layoutget() 80 bex->soff = iomap.addr; in nfsd4_block_proc_layoutget() 92 WARN(1, "pnfsd: filesystem returned %d extent\n", iomap.type); in nfsd4_block_proc_layoutget() 99 bex->foff = iomap.offset; in nfsd4_block_proc_layoutget() 100 bex->len = iomap.length; in nfsd4_block_proc_layoutget() 102 seg->offset = iomap.offset; in nfsd4_block_proc_layoutget() [all …]
|
/linux-6.12.1/Documentation/filesystems/iomap/ |
D | porting.rst | 20 There are several reasons to convert a filesystem to iomap: 31 2. Large folios are only supported via iomap; there are no plans to 35 supported via iomap. 38 iomap handles common pagecache related operations itself, such as 42 filesystem using iomap. 47 First, add ``#include <linux/iomap.h>`` from your source code and add 54 ``->iomap_end`` if necessary) to allow iomap to obtain a read-only 67 Hide behind a debugging knob the ability to switch on the iomap mapping 70 mapping information from the ``iomap`` structure, but the new functions 71 can be tested without needing to implement any iomap APIs. [all …]
|
D | design.rst | 20 iomap is a filesystem library for handling common file operations. 63 the basis of that unit, the iomap model asks the filesystem for the 73 At a high level, an iomap operation `looks like this 91 Each iomap operation will be covered in more detail below. 94 <https://kernelnewbies.org/KernelProjects/iomap>`_. 97 design and capabilities of iomap, followed by a more detailed catalog 98 of the interfaces presented by iomap. 99 If you change iomap, please update this design document. 136 * **iomap internal operation lock**: This is a general term for 137 synchronization primitives that iomap functions take while holding a [all …]
|
D | operations.rst | 17 Below are a discussion of the high level file operations that iomap 29 iomap implements nearly all the folio and pagecache management that 35 linked lists of buffer heads instead of the per-folio bitmaps that iomap 44 The following iomap functions can be referenced directly from the 64 ``struct iomap::folio_ops`` field to an ops structure to override 65 default behaviors of iomap: 74 bool (*iomap_valid)(struct inode *inode, const struct iomap *iomap); 77 iomap calls these functions: 81 If this function is not provided, iomap will call 89 If this function is not provided, iomap will ``folio_unlock`` and [all …]
|
/linux-6.12.1/fs/ |
D | dax.c | 825 static pgoff_t dax_iomap_pgoff(const struct iomap *iomap, loff_t pos) in dax_iomap_pgoff() argument 827 return PHYS_PFN(iomap->addr + (pos & PAGE_MASK) - iomap->offset); in dax_iomap_pgoff() 832 pgoff_t pgoff = dax_iomap_pgoff(&iter->iomap, iter->pos); in copy_cow_page_dax() 838 rc = dax_direct_access(iter->iomap.dax_dev, pgoff, 1, DAX_ACCESS, in copy_cow_page_dax() 859 (iter->iomap.flags & IOMAP_F_DIRTY); in dax_fault_is_synchronous() 877 bool shared = iter->iomap.flags & IOMAP_F_SHARED; in dax_insert_entry() 1066 static int dax_iomap_direct_access(const struct iomap *iomap, loff_t pos, in dax_iomap_direct_access() argument 1069 pgoff_t pgoff = dax_iomap_pgoff(iomap, pos); in dax_iomap_direct_access() 1074 length = dax_direct_access(iomap->dax_dev, pgoff, PHYS_PFN(size), in dax_iomap_direct_access() 1120 const struct iomap *srcmap, void *daddr) in dax_iomap_copy_around() [all …]
|
/linux-6.12.1/fs/fuse/ |
D | dax.c | 388 static void fuse_fill_iomap_hole(struct iomap *iomap, loff_t length) in fuse_fill_iomap_hole() argument 390 iomap->addr = IOMAP_NULL_ADDR; in fuse_fill_iomap_hole() 391 iomap->length = length; in fuse_fill_iomap_hole() 392 iomap->type = IOMAP_HOLE; in fuse_fill_iomap_hole() 396 struct iomap *iomap, struct fuse_dax_mapping *dmap, in fuse_fill_iomap() argument 410 iomap->addr = dmap->window_offset + offset; in fuse_fill_iomap() 411 iomap->length = len; in fuse_fill_iomap() 413 iomap->length = ALIGN(len, PAGE_SIZE); in fuse_fill_iomap() 414 iomap->type = IOMAP_MAPPED; in fuse_fill_iomap() 423 WARN_ON_ONCE(iomap->private); in fuse_fill_iomap() [all …]
|
/linux-6.12.1/fs/hpfs/ |
D | file.c | 121 unsigned flags, struct iomap *iomap, struct iomap *srcmap) in hpfs_iomap_begin() argument 131 iomap->bdev = inode->i_sb->s_bdev; in hpfs_iomap_begin() 132 iomap->offset = offset; in hpfs_iomap_begin() 143 iomap->type = IOMAP_MAPPED; in hpfs_iomap_begin() 144 iomap->flags = IOMAP_F_MERGED; in hpfs_iomap_begin() 145 iomap->addr = (u64)s << blkbits; in hpfs_iomap_begin() 146 iomap->length = (u64)n_secs << blkbits; in hpfs_iomap_begin() 148 iomap->type = IOMAP_HOLE; in hpfs_iomap_begin() 149 iomap->addr = IOMAP_NULL_ADDR; in hpfs_iomap_begin() 150 iomap->length = 1 << blkbits; in hpfs_iomap_begin()
|