file.c (651a88798412e216f337d70181127e847f00a4b7) file.c (4b4db9b4c7269a9a78cd3b334254c89c564f0636)
1// SPDX-License-Identifier: MIT
2/*
3 * VirtualBox Guest Shared Folders support: Regular file inode and file ops.
4 *
5 * Copyright (C) 2006-2018 Oracle Corporation
6 */
7
8#include <linux/mm.h>

--- 211 unchanged lines hidden (view full) ---

220 .splice_read = generic_file_splice_read,
221};
222
223const struct inode_operations vboxsf_reg_iops = {
224 .getattr = vboxsf_getattr,
225 .setattr = vboxsf_setattr
226};
227
1// SPDX-License-Identifier: MIT
2/*
3 * VirtualBox Guest Shared Folders support: Regular file inode and file ops.
4 *
5 * Copyright (C) 2006-2018 Oracle Corporation
6 */
7
8#include <linux/mm.h>

--- 211 unchanged lines hidden (view full) ---

220 .splice_read = generic_file_splice_read,
221};
222
223const struct inode_operations vboxsf_reg_iops = {
224 .getattr = vboxsf_getattr,
225 .setattr = vboxsf_setattr
226};
227
228static int vboxsf_readpage(struct file *file, struct page *page)
228static int vboxsf_read_folio(struct file *file, struct folio *folio)
229{
229{
230 struct page *page = &folio->page;
230 struct vboxsf_handle *sf_handle = file->private_data;
231 loff_t off = page_offset(page);
232 u32 nread = PAGE_SIZE;
233 u8 *buf;
234 int err;
235
236 buf = kmap(page);
237

--- 109 unchanged lines hidden (view full) ---

347}
348
349/*
350 * Note simple_write_begin does not read the page from disk on partial writes
351 * this is ok since vboxsf_write_end only writes the written parts of the
352 * page and it does not call SetPageUptodate for partial writes.
353 */
354const struct address_space_operations vboxsf_reg_aops = {
231 struct vboxsf_handle *sf_handle = file->private_data;
232 loff_t off = page_offset(page);
233 u32 nread = PAGE_SIZE;
234 u8 *buf;
235 int err;
236
237 buf = kmap(page);
238

--- 109 unchanged lines hidden (view full) ---

348}
349
350/*
351 * Note simple_write_begin does not read the page from disk on partial writes
352 * this is ok since vboxsf_write_end only writes the written parts of the
353 * page and it does not call SetPageUptodate for partial writes.
354 */
355const struct address_space_operations vboxsf_reg_aops = {
355 .readpage = vboxsf_readpage,
356 .read_folio = vboxsf_read_folio,
356 .writepage = vboxsf_writepage,
357 .dirty_folio = filemap_dirty_folio,
358 .write_begin = simple_write_begin,
359 .write_end = vboxsf_write_end,
360};
361
362static const char *vboxsf_get_link(struct dentry *dentry, struct inode *inode,
363 struct delayed_call *done)

--- 33 unchanged lines hidden ---
357 .writepage = vboxsf_writepage,
358 .dirty_folio = filemap_dirty_folio,
359 .write_begin = simple_write_begin,
360 .write_end = vboxsf_write_end,
361};
362
363static const char *vboxsf_get_link(struct dentry *dentry, struct inode *inode,
364 struct delayed_call *done)

--- 33 unchanged lines hidden ---