/linux/fs/iomap/ |
H A 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 …]
|
H A 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 …]
|
H A 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 …]
|
H A 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, bool atomic) in iomap_dio_bio_opflags() argument 295 const struct iomap *iomap = &iter->iomap; in iomap_dio_bio_iter() local 312 if ((pos | length) & (bdev_logical_block_size(iomap->bdev) - 1) || in iomap_dio_bio_iter() 313 !bdev_iter_is_aligned(iomap->bdev, dio->submit.iter)) in iomap_dio_bio_iter() 316 if (iomap->type == IOMAP_UNWRITTEN) { in iomap_dio_bio_iter() 321 if (iomap->flags & IOMAP_F_SHARED) in iomap_dio_bio_iter() 324 if (iomap->flags & IOMAP_F_NEW) { in iomap_dio_bio_iter() [all …]
|
H A 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/include/linux/ |
H A 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 …]
|
H A D | iomap.h | 98 struct iomap { struct 112 static inline sector_t iomap_sector(const struct iomap *iomap, loff_t pos) in iomap_sector() argument 114 return (iomap->addr + pos - iomap->offset) >> SECTOR_SHIFT; in iomap_sector() 120 static inline void *iomap_inline_data(const struct iomap *iomap, loff_t pos) in iomap_inline_data() argument 122 return iomap->inline_data + pos - iomap->offset; in iomap_inline_data() 130 static inline bool iomap_inline_data_valid(const struct iomap *iomap) in iomap_inline_data_valid() argument 132 return iomap->length <= PAGE_SIZE - offset_in_page(iomap->inline_data); in iomap_inline_data_valid() 166 bool (*iomap_valid)(struct inode *inode, const struct iomap *iomap); 194 unsigned flags, struct iomap *iomap, 195 struct iomap *srcmap); [all …]
|
/linux/drivers/ata/ |
H A 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 …]
|
H A 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/fs/xfs/ |
H A D | xfs_iomap.c | 76 const struct iomap *iomap) in xfs_iomap_valid() argument 80 if (iomap->validity_cookie != in xfs_iomap_valid() 81 xfs_iomap_inode_sequence(ip, iomap->flags)) { in xfs_iomap_valid() 82 trace_xfs_iomap_invalid(ip, iomap); in xfs_iomap_valid() 97 struct iomap *iomap, in xfs_bmbt_to_iomap() argument 112 iomap->addr = IOMAP_NULL_ADDR; in xfs_bmbt_to_iomap() 113 iomap->type = IOMAP_HOLE; in xfs_bmbt_to_iomap() 116 iomap->addr = IOMAP_NULL_ADDR; in xfs_bmbt_to_iomap() 117 iomap->type = IOMAP_DELALLOC; in xfs_bmbt_to_iomap() 121 iomap->addr = BBTOB(daddr); in xfs_bmbt_to_iomap() [all …]
|
H A 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 …]
|
H A D | xfs_pnfs.h | 8 struct iomap *iomap, bool write, u32 *device_generation); 9 int xfs_fs_commit_blocks(struct inode *inode, struct iomap *maps, int nr_maps,
|
/linux/fs/gfs2/ |
H A 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 …]
|
H A D | bmap.h | 53 struct iomap *iomap); 55 struct iomap *iomap);
|
/linux/fs/zonefs/ |
H A 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 …]
|
H A 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/fs/erofs/ |
H A D | data.c | 271 unsigned int flags, struct iomap *iomap, struct iomap *srcmap) in erofs_iomap_begin() argument 293 iomap->offset = map.m_la; in erofs_iomap_begin() 295 iomap->dax_dev = mdev.m_dif->dax_dev; in erofs_iomap_begin() 297 iomap->bdev = mdev.m_bdev; in erofs_iomap_begin() 298 iomap->length = map.m_llen; in erofs_iomap_begin() 299 iomap->flags = 0; in erofs_iomap_begin() 300 iomap->private = NULL; in erofs_iomap_begin() 303 iomap->type = IOMAP_HOLE; in erofs_iomap_begin() 304 iomap->addr = IOMAP_NULL_ADDR; in erofs_iomap_begin() 305 if (!iomap->length) in erofs_iomap_begin() [all …]
|
/linux/fs/nfsd/ |
H A 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/fs/ |
H A 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/Documentation/filesystems/iomap/ |
H A 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 …]
|
H A 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 …]
|
H A 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/fs/hpfs/ |
H A 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()
|
/linux/fs/btrfs/ |
H A D | direct-io.c | 355 loff_t length, unsigned int flags, struct iomap *iomap, in btrfs_dio_iomap_begin() argument 356 struct iomap *srcmap) in btrfs_dio_iomap_begin() 358 struct iomap_iter *iter = container_of(iomap, struct iomap_iter, iomap); in btrfs_dio_iomap_begin() 558 iomap->addr = IOMAP_NULL_ADDR; in btrfs_dio_iomap_begin() 559 iomap->type = IOMAP_HOLE; in btrfs_dio_iomap_begin() 561 iomap->addr = extent_map_block_start(em) + (start - em->start); in btrfs_dio_iomap_begin() 562 iomap->type = IOMAP_MAPPED; in btrfs_dio_iomap_begin() 564 iomap->offset = start; in btrfs_dio_iomap_begin() 565 iomap->bdev = fs_info->fs_devices->latest_dev->bdev; in btrfs_dio_iomap_begin() 566 iomap->length = len; in btrfs_dio_iomap_begin() [all …]
|
/linux/block/ |
H A D | fops.c | 389 unsigned int flags, struct iomap *iomap, struct iomap *srcmap) in blkdev_iomap_begin() argument 397 iomap->bdev = bdev; in blkdev_iomap_begin() 398 iomap->offset = ALIGN_DOWN(offset, bdev_logical_block_size(bdev)); in blkdev_iomap_begin() 399 iomap->type = IOMAP_MAPPED; in blkdev_iomap_begin() 400 iomap->addr = iomap->offset; in blkdev_iomap_begin() 401 iomap->length = isize - iomap->offset; in blkdev_iomap_begin() 402 iomap->flags |= IOMAP_F_BUFFER_HEAD; /* noop for !CONFIG_BUFFER_HEAD */ in blkdev_iomap_begin() 498 if (offset >= wpc->iomap.offset && in blkdev_map_blocks() 499 offset < wpc->iomap.offset + wpc->iomap.length) in blkdev_map_blocks() 502 IOMAP_WRITE, &wpc->iomap, NULL); in blkdev_map_blocks()
|