Lines Matching +full:block +full:- +full:offset
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * NTFS block device I/O.
13 * ntfs_bdev_read - Read data directly from block device using bio
14 * @bdev: block device to read from
16 * @start: starting byte offset on the block device
19 * Reads @size bytes starting from byte offset @start directly from the block
23 * The @start offset must be sector-aligned (512 bytes). If it is not aligned,
24 * the function will return -EINVAL.
39 if (start & (SECTOR_SIZE - 1)) in ntfs_bdev_read()
40 return -EINVAL; in ntfs_bdev_read()
49 bio->bi_iter.bi_sector = sector; in ntfs_bdev_read()
52 added = bio_add_vmalloc_chunk(bio, data + done, size - done); in ntfs_bdev_read()
56 bio = bio_alloc(prev->bi_bdev, in ntfs_bdev_read()
57 bio_max_segs(DIV_ROUND_UP(size - done, PAGE_SIZE)), in ntfs_bdev_read()
58 prev->bi_opf, GFP_KERNEL); in ntfs_bdev_read()
59 bio->bi_iter.bi_sector = bio_end_sector(prev); in ntfs_bdev_read()
75 * ntfs_bdev_write - Update block device contents via page cache
76 * @sb: super block of the mounted NTFS filesystem
78 * @start: starting byte offset on the block device
81 * Writes @size bytes from @buf to the block device (sb->s_bdev) starting
82 * at byte offset @start. The write is performed entirely through the page
83 * cache of the block device's address space.
88 loff_t offset, end = start + size; in ntfs_bdev_write() local
102 folio = read_mapping_folio(sb->s_bdev->bd_mapping, idx, NULL); in ntfs_bdev_write()
108 offset = (loff_t)idx << PAGE_SHIFT; in ntfs_bdev_write()
109 to = min_t(u32, end - offset, PAGE_SIZE); in ntfs_bdev_write()
110 len = to - from; in ntfs_bdev_write()