1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2000-2001 Christoph Hellwig.
7 * Veritas filesystem driver - support for 'immed' inodes.
10 #include <linux/pagemap.h>
13 #include "vxfs_extern.h"
14 #include "vxfs_inode.h"
17 * vxfs_immed_read_folio - read part of an immed inode into pagecache
18 * @file: file context (unused)
19 * @folio: folio to fill in.
22 * vxfs_immed_read_folio reads a part of the immed area of the
23 * file that hosts @folio into the pagecache.
26 * Zero on success, else a negative error code.
29 * @folio is locked and will be unlocked.
31 static int vxfs_immed_read_folio(struct file *fp, struct folio *folio)
33 struct vxfs_inode_info *vip = VXFS_INO(folio->mapping->host);
34 void *src = vip->vii_immed.vi_immed + folio_pos(folio);
37 for (i = 0; i < folio_nr_pages(folio); i++) {
38 memcpy_to_page(folio_page(folio, i), 0, src, PAGE_SIZE);
42 folio_mark_uptodate(folio);
49 * Address space operations for immed files and directories.
51 const struct address_space_operations vxfs_immed_aops = {
52 .read_folio = vxfs_immed_read_folio,