Lines Matching defs:file

2 /** @file
3 * vboxsf - VBox Linux Shared Folders, Regular file inode and file operations.
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
95 * Read from a regular file.
97 * @param file the file
100 * @param off offset within the file
103 static ssize_t sf_reg_read(struct file *file, char *buf, size_t size, loff_t *off)
111 struct inode *inode = GET_F_DENTRY(file)->d_inode;
113 struct sf_reg_info *sf_r = file->private_data;
119 LogFunc(("read from non regular file %d\n", inode->i_mode));
170 * Write to a regular file.
172 * @param file the file
175 * @param off offset within the file
178 static ssize_t sf_reg_write(struct file *file, const char *buf, size_t size, loff_t *off)
186 struct inode *inode = GET_F_DENTRY(file)->d_inode;
189 struct sf_reg_info *sf_r = file->private_data;
199 LogFunc(("write to non regular file %d\n", inode->i_mode));
204 if (file->f_flags & O_APPEND)
270 * Open a regular file.
273 * @param file the file
276 static int sf_reg_open(struct inode *inode, struct file *file)
302 * O_CREAT, O_TRUNC: inherent true (file was just created). Not sure
308 sf_i->file = file;
309 file->private_data = sf_r;
322 if (file->f_flags & O_CREAT)
328 if (file->f_flags & O_TRUNC)
340 if (file->f_flags & O_TRUNC)
350 switch (file->f_flags & O_ACCMODE)
369 if (file->f_flags & O_APPEND)
376 LogFunc(("sf_reg_open: calling vboxCallCreate, file %s, flags=%#x, %#x\n",
377 sf_i->path->String.utf8 , file->f_flags, params.CreateFlags));
382 file->f_flags, params.CreateFlags, rc));
405 sf_i->file = file;
406 file->private_data = sf_r;
411 * Close a regular file.
414 * @param file the file
417 static int sf_reg_release(struct inode *inode, struct file *file)
426 sf_r = file->private_data;
432 /* See the smbfs source (file.c). mmap in particular can cause data to be
433 * written to the file after it is closed, which we can't cope with. We
446 sf_i->file = NULL;
448 file->private_data = NULL;
467 struct file *file = vma->vm_file;
468 struct inode *inode = GET_F_DENTRY(file)->d_inode;
470 struct sf_reg_info *sf_r = file->private_data;
551 static int sf_reg_mmap(struct file *file, struct vm_area_struct *vma)
606 static int sf_readpage(struct file *file, struct page *page)
608 struct inode *inode = GET_F_DENTRY(file)->d_inode;
610 struct sf_reg_info *sf_r = file->private_data;
643 struct file *file = sf_i->file;
644 struct sf_reg_info *sf_r = file->private_data;
680 int sf_write_begin(struct file *file, struct address_space *mapping, loff_t pos,
685 return simple_write_begin(file, mapping, pos, len, flags, pagep, fsdata);
688 int sf_write_end(struct file *file, struct address_space *mapping, loff_t pos,
693 struct sf_reg_info *sf_r = file->private_data;