1 /**
2 * Copyright (c) 2008-2015 Alper Akcan <alper.akcan@gmail.com>
3 * Copyright (c) 2009 Renzo Davoli <renzo@cs.unibo.it>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program (in the main directory of the fuse-ext2
17 * distribution in the file COPYING); if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21 #include "fuse-ext2.h"
22
op_flush(const char * path,struct fuse_file_info * fi)23 int op_flush (const char *path, struct fuse_file_info *fi)
24 {
25 errcode_t rc;
26 ext2_file_t efile = EXT2FS_FILE(fi->fh);
27
28 debugf("enter");
29 debugf("path = %s (%p)", path, efile);
30
31 if (efile == NULL) {
32 return -ENOENT;
33 }
34
35 rc = ext2fs_file_flush(efile);
36 if (rc) {
37 return -EIO;
38 }
39
40 debugf("leave");
41 return 0;
42 }
43