ia64/linux-2.6.18-xen.hg

view fs/udf/fsync.c @ 524:7f8b544237bf

netfront: Allow netfront in domain 0.

This is useful if your physical network device is in a utility domain.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Apr 15 15:18:58 2008 +0100 (2008-04-15)
parents 831230e53067
children
line source
1 /*
2 * fsync.c
3 *
4 * PURPOSE
5 * Fsync handling routines for the OSTA-UDF(tm) filesystem.
6 *
7 * COPYRIGHT
8 * This file is distributed under the terms of the GNU General Public
9 * License (GPL). Copies of the GPL can be obtained from:
10 * ftp://prep.ai.mit.edu/pub/gnu/GPL
11 * Each contributing author retains all rights to their own work.
12 *
13 * (C) 1999-2001 Ben Fennema
14 * (C) 1999-2000 Stelias Computing Inc
15 *
16 * HISTORY
17 *
18 * 05/22/99 blf Created.
19 */
21 #include "udfdecl.h"
23 #include <linux/fs.h>
24 #include <linux/smp_lock.h>
26 static int udf_fsync_inode(struct inode *, int);
28 /*
29 * File may be NULL when we are called. Perhaps we shouldn't
30 * even pass file to fsync ?
31 */
33 int udf_fsync_file(struct file * file, struct dentry *dentry, int datasync)
34 {
35 struct inode *inode = dentry->d_inode;
36 return udf_fsync_inode(inode, datasync);
37 }
39 static int udf_fsync_inode(struct inode *inode, int datasync)
40 {
41 int err;
43 err = sync_mapping_buffers(inode->i_mapping);
44 if (!(inode->i_state & I_DIRTY))
45 return err;
46 if (datasync && !(inode->i_state & I_DIRTY_DATASYNC))
47 return err;
49 err |= udf_sync_inode (inode);
50 return err ? -EIO : 0;
51 }