Home
last modified time | relevance | path

Searched refs:iomap (Results 1 – 25 of 64) sorted by relevance

123

/linux/fs/exfat/
H A Diomap.c42 unsigned int flags, struct iomap *iomap, bool may_alloc) in __exfat_iomap_begin() argument
55 iomap->type = IOMAP_HOLE; in __exfat_iomap_begin()
56 iomap->addr = IOMAP_NULL_ADDR; in __exfat_iomap_begin()
57 iomap->offset = offset; in __exfat_iomap_begin()
58 iomap->length = length; in __exfat_iomap_begin()
72 iomap->bdev = inode->i_sb->s_bdev; in __exfat_iomap_begin()
73 iomap->offset = offset; in __exfat_iomap_begin()
83 iomap->length = min_t(loff_t, length, cluster_length - cluster_offset); in __exfat_iomap_begin()
84 iomap->addr = exfat_cluster_to_phys_bytes(sbi, cluster) + cluster_offset; in __exfat_iomap_begin()
85 iomap->type = IOMAP_MAPPED; in __exfat_iomap_begin()
[all …]
/linux/fs/iomap/
H A Dswapfile.c12 struct iomap iomap; /* accumulated iomap */ member
29 struct iomap *iomap = &isi->iomap; in iomap_swapfile_add_extent() local
45 first_ppage = ALIGN(iomap->addr, PAGE_SIZE) >> PAGE_SHIFT; in iomap_swapfile_add_extent()
46 next_ppage = ALIGN_DOWN(iomap->addr + iomap->length, PAGE_SIZE) >> in iomap_swapfile_add_extent()
61 if (iomap->offset == 0) in iomap_swapfile_add_extent()
95 struct iomap *iomap, struct iomap_swapfile_info *isi) in iomap_swapfile_iter() argument
97 switch (iomap->type) { in iomap_swapfile_iter()
110 if (iomap->flags & IOMAP_F_DIRTY) in iomap_swapfile_iter()
112 if (iomap->flags & IOMAP_F_SHARED) in iomap_swapfile_iter()
116 if (iomap->bdev != isi->sis->bdev) in iomap_swapfile_iter()
[all …]
H A Dfiemap.c10 const struct iomap *iomap, u32 flags) in iomap_to_fiemap() argument
12 switch (iomap->type) { in iomap_to_fiemap()
29 if (iomap->flags & IOMAP_F_MERGED) in iomap_to_fiemap()
31 if (iomap->flags & IOMAP_F_SHARED) in iomap_to_fiemap()
34 return fiemap_fill_next_extent(fi, iomap->offset, in iomap_to_fiemap()
35 iomap->addr != IOMAP_NULL_ADDR ? iomap->addr : 0, in iomap_to_fiemap()
36 iomap->length, flags); in iomap_to_fiemap()
40 struct fiemap_extent_info *fi, struct iomap *prev) in iomap_fiemap_iter()
44 if (iter->iomap.type == IOMAP_HOLE) in iomap_fiemap_iter()
48 *prev = iter->iomap; in iomap_fiemap_iter()
[all …]
H A Dbuffered-io.c385 const struct iomap *srcmap = iomap_iter_srcmap(iter); in iomap_block_needs_zeroing()
421 const struct iomap *iomap = iomap_iter_srcmap(iter); in iomap_read_inline_data() local
422 size_t size = i_size_read(iter->inode) - iomap->offset; in iomap_read_inline_data()
423 size_t offset = offset_in_folio(folio, iomap->offset); in iomap_read_inline_data()
425 if (WARN_ON_ONCE(!iomap->inline_data)) in iomap_read_inline_data()
431 if (WARN_ON_ONCE(size > iomap->length)) { in iomap_read_inline_data()
433 iomap->offset, size, -EIO, GFP_NOFS); in iomap_read_inline_data()
439 folio_fill_tail(folio, offset, iomap->inline_data, size); in iomap_read_inline_data()
560 const struct iomap *iomap = &iter->iomap; in iomap_read_folio_iter() local
570 if (iomap->type == IOMAP_INLINE) { in iomap_read_folio_iter()
[all …]
H A Dbio.c87 if (iter->iomap.flags & IOMAP_F_INTEGRITY) in iomap_bio_submit_read_endio()
111 const struct iomap *iomap = &iter->iomap; in iomap_read_alloc_bio() local
132 bio = bio_alloc_bioset(iomap->bdev, bio_max_segs(nr_vecs), REQ_OP_READ, in iomap_read_alloc_bio()
135 bio = bio_alloc_bioset(iomap->bdev, 1, REQ_OP_READ, orig_gfp, in iomap_read_alloc_bio()
139 bio->bi_iter.bi_sector = iomap_sector(iomap, iter->pos); in iomap_read_alloc_bio()
153 bio_end_sector(bio) != iomap_sector(&iter->iomap, iter->pos) || in iomap_bio_read_folio_range()
154 bio->bi_iter.bi_size > iomap_max_bio_size(&iter->iomap) - plen || in iomap_bio_read_folio_range()
170 const struct iomap *srcmap = iomap_iter_srcmap(iter); in iomap_bio_read_folio_range_sync()
H A Ddirect-io.c59 return bio_alloc_bioset(iter->iomap.bdev, nr_vecs, opf, in iomap_dio_alloc_bio()
61 return bio_alloc(iter->iomap.bdev, nr_vecs, opf, GFP_KERNEL); in iomap_dio_alloc_bio()
80 WARN_ON_ONCE(iter->iomap.flags & IOMAP_F_ANON_WRITE); in iomap_dio_submit_bio()
320 bio->bi_iter.bi_sector = iomap_sector(&iter->iomap, pos); in iomap_dio_zero()
350 bio->bi_iter.bi_sector = iomap_sector(&iter->iomap, pos); in iomap_dio_bio_iter_one()
359 iomap_max_bio_size(&iter->iomap), alignment); in iomap_dio_bio_iter_one()
377 if (iter->iomap.flags & IOMAP_F_INTEGRITY) { in iomap_dio_bio_iter_one()
418 const struct iomap *iomap = &iter->iomap; in iomap_dio_bio_iter() local
434 alignment = iomap_dio_alignment(inode, iomap->bdev, dio->flags); in iomap_dio_bio_iter()
442 switch (iomap->type) { in iomap_dio_bio_iter()
[all …]
H A DMakefile9 obj-$(CONFIG_FS_IOMAP) += iomap.o
11 iomap-y += trace.o \
14 iomap-$(CONFIG_BLOCK) += direct-io.o \
19 iomap-$(CONFIG_SWAP) += swapfile.o
H A Dioend.c143 if (WARN_ON_ONCE(wpc->iomap.flags & IOMAP_F_ANON_WRITE)) in iomap_ioend_writeback_submit()
152 if (wpc->iomap.flags & IOMAP_F_INTEGRITY) in iomap_ioend_writeback_submit()
164 bio = bio_alloc_bioset(wpc->iomap.bdev, BIO_MAX_VECS, in iomap_alloc_ioend()
167 bio->bi_iter.bi_sector = iomap_sector(&wpc->iomap, pos); in iomap_alloc_ioend()
180 iomap_max_bio_size(&wpc->iomap) - map_len) in iomap_can_add_to_ioend()
189 if (!(wpc->iomap.flags & IOMAP_F_ANON_WRITE) && in iomap_can_add_to_ioend()
190 iomap_sector(&wpc->iomap, pos) != bio_end_sector(&ioend->io_bio)) in iomap_can_add_to_ioend()
220 wpc->iomap.offset + wpc->iomap.length - pos); in iomap_add_to_ioend()
223 trace_iomap_add_to_ioend(wpc->inode, pos, dirty_len, &wpc->iomap); in iomap_add_to_ioend()
227 switch (wpc->iomap.type) { in iomap_add_to_ioend()
[all …]
/linux/include/linux/
H A Dio-mapping.h42 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 Diomap.h130 struct iomap { struct
143 static inline sector_t iomap_sector(const struct iomap *iomap, loff_t pos) in iomap_sector() argument
145 if (iomap->flags & IOMAP_F_ANON_WRITE) in iomap_sector()
147 return (iomap->addr + pos - iomap->offset) >> SECTOR_SHIFT; in iomap_sector()
153 static inline void *iomap_inline_data(const struct iomap *iomap, loff_t pos) in iomap_inline_data() argument
155 return iomap->inline_data + pos - iomap->offset; in iomap_inline_data()
184 bool (*iomap_valid)(struct inode *inode, const struct iomap *iomap);
222 loff_t length, unsigned flags, struct iomap *iomap,
223 struct iomap *srcmap);
232 ssize_t written, unsigned flags, struct iomap *iomap);
[all …]
/linux/drivers/ata/
H A Dpata_cs5520.c121 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 …]
/linux/fs/gfs2/
H A Dbmap.c586 struct metapath *mp, struct iomap *iomap) in gfs2_hole_size() argument
601 iomap->length = hole_size << inode->i_blkbits; in gfs2_hole_size()
662 static int __gfs2_iomap_alloc(struct inode *inode, struct iomap *iomap, in __gfs2_iomap_alloc() argument
670 size_t dblks = iomap->length >> inode->i_blkbits; in __gfs2_iomap_alloc()
766 iomap->addr = bn << inode->i_blkbits; in __gfs2_iomap_alloc()
767 iomap->flags |= IOMAP_F_MERGED | IOMAP_F_NEW; in __gfs2_iomap_alloc()
772 } while (iomap->addr == IOMAP_NULL_ADDR); in __gfs2_iomap_alloc()
774 iomap->type = IOMAP_MAPPED; in __gfs2_iomap_alloc()
775 iomap->length = (u64)dblks << inode->i_blkbits; in __gfs2_iomap_alloc()
842 unsigned flags, struct iomap *iomap, in __gfs2_iomap_get() argument
[all …]
H A Dbmap.h54 struct iomap *iomap);
56 struct iomap *iomap);
H A Dfile.c394 struct iomap iomap = { }; in gfs2_allocate_folio_backing() local
396 if (gfs2_iomap_alloc(folio->mapping->host, pos, length, &iomap)) in gfs2_allocate_folio_backing()
399 if (length < iomap.length) in gfs2_allocate_folio_backing()
400 iomap.length = length; in gfs2_allocate_folio_backing()
401 length -= iomap.length; in gfs2_allocate_folio_backing()
402 pos += iomap.length; in gfs2_allocate_folio_backing()
1201 struct iomap iomap = { }; in fallocate_chunk() local
1203 error = gfs2_iomap_alloc(inode, offset, end - offset, &iomap); in fallocate_chunk()
1206 offset = iomap.offset + iomap.length; in fallocate_chunk()
1207 if (!(iomap.flags & IOMAP_F_NEW)) in fallocate_chunk()
[all …]
/linux/fs/xfs/
H A Dxfs_aops.c303 if (offset < wpc->iomap.offset || in xfs_imap_valid()
304 offset >= wpc->iomap.offset + wpc->iomap.length) in xfs_imap_valid()
311 if (wpc->iomap.flags & IOMAP_F_SHARED) in xfs_imap_valid()
322 trace_xfs_wb_data_iomap_invalid(ip, &wpc->iomap, in xfs_imap_valid()
328 trace_xfs_wb_cow_iomap_invalid(ip, &wpc->iomap, in xfs_imap_valid()
446 xfs_bmbt_to_iomap(ip, &wpc->iomap, &imap, 0, 0, XFS_WPC(wpc)->data_seq); in xfs_map_blocks()
462 &wpc->iomap, seq); in xfs_map_blocks()
485 if (cow_offset < wpc->iomap.offset + wpc->iomap.length) in xfs_map_blocks()
486 wpc->iomap.length = cow_offset - wpc->iomap.offset; in xfs_map_blocks()
489 ASSERT(wpc->iomap.offset <= offset); in xfs_map_blocks()
[all …]
/linux/Documentation/filesystems/iomap/
H A Dporting.rst20 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 Doperations.rst17 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
70 bool (*iomap_valid)(struct inode *inode, const struct iomap *iomap);
75 iomap calls these functions:
79 If this function is not provided, iomap will call
87 If this function is not provided, iomap will ``folio_unlock`` and
107 lock has been taken so that iomap can manage the folio correctly.
117 ``->iomap_begin`` function may set ``struct iomap::validity_cookie``
[all …]
/linux/fs/ntfs3/
H A Dinode.c920 #define WB_NO_DA (struct iomap *)1
934 unsigned int flags, struct iomap *iomap, in ntfs_iomap_begin() argument
935 struct iomap *srcmap) in ntfs_iomap_begin()
999 iomap->flags = new_clst ? IOMAP_F_NEW : 0; in ntfs_iomap_begin()
1012 iomap->private = iomap->inline_data = res; in ntfs_iomap_begin()
1013 iomap->type = IOMAP_INLINE; in ntfs_iomap_begin()
1014 iomap->offset = 0; in ntfs_iomap_begin()
1015 iomap->length = clen; /* resident size in bytes. */ in ntfs_iomap_begin()
1024 iomap->bdev = inode->i_sb->s_bdev; in ntfs_iomap_begin()
1025 iomap->offset = offset; in ntfs_iomap_begin()
[all …]
/linux/fs/btrfs/
H A Ddirect-io.c370 loff_t length, unsigned int flags, struct iomap *iomap, in btrfs_dio_iomap_begin() argument
371 struct iomap *srcmap) in btrfs_dio_iomap_begin()
373 struct iomap_iter *iter = container_of(iomap, struct iomap_iter, iomap); in btrfs_dio_iomap_begin()
573 iomap->addr = IOMAP_NULL_ADDR; in btrfs_dio_iomap_begin()
574 iomap->type = IOMAP_HOLE; in btrfs_dio_iomap_begin()
576 iomap->addr = btrfs_extent_map_block_start(em) + (start - em->start); in btrfs_dio_iomap_begin()
577 iomap->type = IOMAP_MAPPED; in btrfs_dio_iomap_begin()
579 iomap->offset = start; in btrfs_dio_iomap_begin()
580 iomap->bdev = fs_info->fs_devices->latest_dev->bdev; in btrfs_dio_iomap_begin()
581 iomap->length = len; in btrfs_dio_iomap_begin()
[all …]
/linux/fs/nfsd/
H A Dblocklayoutxdr.h8 struct iomap;
72 struct iomap **iomapp, int *nr_iomapsp, u32 block_size);
74 struct iomap **iomapp, int *nr_iomapsp, u32 block_size);
H A Dblocklayoutxdr.c152 nfsd4_block_decode_layoutupdate(struct xdr_stream *xdr, struct iomap **iomapp, in nfsd4_block_decode_layoutupdate()
155 struct iomap *iomaps; in nfsd4_block_decode_layoutupdate()
246 nfsd4_scsi_decode_layoutupdate(struct xdr_stream *xdr, struct iomap **iomapp, in nfsd4_scsi_decode_layoutupdate()
249 struct iomap *iomaps; in nfsd4_scsi_decode_layoutupdate()
/linux/block/
H A Dfops.c439 unsigned int flags, struct iomap *iomap, struct iomap *srcmap) in blkdev_iomap_begin() argument
447 iomap->bdev = bdev; in blkdev_iomap_begin()
448 iomap->offset = ALIGN_DOWN(offset, bdev_logical_block_size(bdev)); in blkdev_iomap_begin()
449 iomap->type = IOMAP_MAPPED; in blkdev_iomap_begin()
450 iomap->addr = iomap->offset; in blkdev_iomap_begin()
451 iomap->length = isize - iomap->offset; in blkdev_iomap_begin()
452 iomap->flags |= IOMAP_F_BUFFER_HEAD; /* noop for !CONFIG_BUFFER_HEAD */ in blkdev_iomap_begin()
532 if (offset < wpc->iomap.offset || in blkdev_writeback_range()
533 offset >= wpc->iomap.offset + wpc->iomap.length) { in blkdev_writeback_range()
537 IOMAP_WRITE, &wpc->iomap, NULL); in blkdev_writeback_range()
/linux/fs/erofs/
H A Dzmap.c795 struct iomap *iomap, struct iomap *srcmap) in z_erofs_iomap_begin_report() argument
805 iomap->bdev = inode->i_sb->s_bdev; in z_erofs_iomap_begin_report()
806 iomap->offset = map.m_la; in z_erofs_iomap_begin_report()
807 iomap->length = map.m_llen; in z_erofs_iomap_begin_report()
809 iomap->type = IOMAP_MAPPED; in z_erofs_iomap_begin_report()
810 iomap->addr = IOMAP_NULL_ADDR; in z_erofs_iomap_begin_report()
812 iomap->type = IOMAP_MAPPED; in z_erofs_iomap_begin_report()
813 iomap->addr = map.m_pa; in z_erofs_iomap_begin_report()
815 iomap->type = IOMAP_HOLE; in z_erofs_iomap_begin_report()
816 iomap->addr = IOMAP_NULL_ADDR; in z_erofs_iomap_begin_report()
[all …]
/linux/drivers/gpu/drm/i915/
H A Di915_mm.h19 struct io_mapping *iomap);
24 struct io_mapping *iomap) in remap_io_mapping() argument
/linux/drivers/pcmcia/
H A Dpcmcia_resource.c483 pccard_io_map iomap; in pcmcia_enable_device() local
585 iomap.speed = io_speed; in pcmcia_enable_device()
588 iomap.map = i; in pcmcia_enable_device()
589 iomap.flags = MAP_ACTIVE; in pcmcia_enable_device()
592 iomap.flags |= MAP_16BIT; break; in pcmcia_enable_device()
594 iomap.flags |= MAP_AUTOSZ; break; in pcmcia_enable_device()
598 iomap.start = s->io[i].res->start; in pcmcia_enable_device()
599 iomap.stop = s->io[i].res->end; in pcmcia_enable_device()
600 s->ops->set_io_map(s, &iomap); in pcmcia_enable_device()

123