···11-/*22- * fsync.c33- *44- * PURPOSE55- * Fsync handling routines for the OSTA-UDF(tm) filesystem.66- *77- * COPYRIGHT88- * This file is distributed under the terms of the GNU General Public99- * License (GPL). Copies of the GPL can be obtained from:1010- * ftp://prep.ai.mit.edu/pub/gnu/GPL1111- * Each contributing author retains all rights to their own work.1212- *1313- * (C) 1999-2001 Ben Fennema1414- * (C) 1999-2000 Stelias Computing Inc1515- *1616- * HISTORY1717- *1818- * 05/22/99 blf Created.1919- */2020-2121-#include "udfdecl.h"2222-2323-#include <linux/fs.h>2424-2525-static int udf_fsync_inode(struct inode *, int);2626-2727-/*2828- * File may be NULL when we are called. Perhaps we shouldn't2929- * even pass file to fsync ?3030- */3131-3232-int udf_fsync_file(struct file *file, struct dentry *dentry, int datasync)3333-{3434- struct inode *inode = dentry->d_inode;3535-3636- return udf_fsync_inode(inode, datasync);3737-}3838-3939-static int udf_fsync_inode(struct inode *inode, int datasync)4040-{4141- int err;4242-4343- err = sync_mapping_buffers(inode->i_mapping);4444- if (!(inode->i_state & I_DIRTY))4545- return err;4646- if (datasync && !(inode->i_state & I_DIRTY_DATASYNC))4747- return err;4848-4949- err |= udf_sync_inode(inode);5050-5151- return err ? -EIO : 0;5252-}