~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/fs/exofs/file.c

Version: ~ [ linux-5.16 ] ~ [ linux-5.15.13 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.90 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.170 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.224 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.261 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.296 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.298 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Copyright (C) 2005, 2006
  3  * Avishay Traeger (avishay@gmail.com)
  4  * Copyright (C) 2008, 2009
  5  * Boaz Harrosh <ooo@electrozaur.com>
  6  *
  7  * Copyrights for code taken from ext2:
  8  *     Copyright (C) 1992, 1993, 1994, 1995
  9  *     Remy Card (card@masi.ibp.fr)
 10  *     Laboratoire MASI - Institut Blaise Pascal
 11  *     Universite Pierre et Marie Curie (Paris VI)
 12  *     from
 13  *     linux/fs/minix/inode.c
 14  *     Copyright (C) 1991, 1992  Linus Torvalds
 15  *
 16  * This file is part of exofs.
 17  *
 18  * exofs is free software; you can redistribute it and/or modify
 19  * it under the terms of the GNU General Public License as published by
 20  * the Free Software Foundation.  Since it is based on ext2, and the only
 21  * valid version of GPL for the Linux kernel is version 2, the only valid
 22  * version of GPL for exofs is version 2.
 23  *
 24  * exofs is distributed in the hope that it will be useful,
 25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 27  * GNU General Public License for more details.
 28  *
 29  * You should have received a copy of the GNU General Public License
 30  * along with exofs; if not, write to the Free Software
 31  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 32  */
 33 #include "exofs.h"
 34 
 35 static int exofs_release_file(struct inode *inode, struct file *filp)
 36 {
 37         return 0;
 38 }
 39 
 40 /* exofs_file_fsync - flush the inode to disk
 41  *
 42  *   Note, in exofs all metadata is written as part of inode, regardless.
 43  *   The writeout is synchronous
 44  */
 45 static int exofs_file_fsync(struct file *filp, loff_t start, loff_t end,
 46                             int datasync)
 47 {
 48         struct inode *inode = filp->f_mapping->host;
 49         int ret;
 50 
 51         ret = filemap_write_and_wait_range(inode->i_mapping, start, end);
 52         if (ret)
 53                 return ret;
 54 
 55         inode_lock(inode);
 56         ret = sync_inode_metadata(filp->f_mapping->host, 1);
 57         inode_unlock(inode);
 58         return ret;
 59 }
 60 
 61 static int exofs_flush(struct file *file, fl_owner_t id)
 62 {
 63         int ret = vfs_fsync(file, 0);
 64         /* TODO: Flush the OSD target */
 65         return ret;
 66 }
 67 
 68 const struct file_operations exofs_file_operations = {
 69         .llseek         = generic_file_llseek,
 70         .read_iter      = generic_file_read_iter,
 71         .write_iter     = generic_file_write_iter,
 72         .mmap           = generic_file_mmap,
 73         .open           = generic_file_open,
 74         .release        = exofs_release_file,
 75         .fsync          = exofs_file_fsync,
 76         .flush          = exofs_flush,
 77         .splice_read    = generic_file_splice_read,
 78         .splice_write   = iter_file_splice_write,
 79 };
 80 
 81 const struct inode_operations exofs_file_inode_operations = {
 82         .setattr        = exofs_setattr,
 83 };
 84 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp