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 static int vxfs_immed_read_folio(struct file *, struct folio *);
20 * Address space operations for immed files and directories.
22 const struct address_space_operations vxfs_immed_aops = {
23 .read_folio = vxfs_immed_read_folio,
27 * vxfs_immed_read_folio - read part of an immed inode into pagecache
28 * @file: file context (unused)
29 * @folio: folio to fill in.
32 * vxfs_immed_read_folio reads a part of the immed area of the
33 * file that hosts @pp into the pagecache.
36 * Zero on success, else a negative error code.
39 * @folio is locked and will be unlocked.
42 vxfs_immed_read_folio(struct file *fp, struct folio *folio)
44 struct page *pp = &folio->page;
45 struct vxfs_inode_info *vip = VXFS_INO(pp->mapping->host);
46 u_int64_t offset = (u_int64_t)pp->index << PAGE_SHIFT;
50 memcpy(kaddr, vip->vii_immed.vi_immed + offset, PAGE_SIZE);
53 flush_dcache_page(pp);