mirror of
https://github.com/libfuse/libfuse.git
synced 2024-11-23 12:14:15 +08:00
fix
This commit is contained in:
parent
e109e285e0
commit
6bab4809f3
@ -1,3 +1,11 @@
|
||||
2006-02-21 Miklos Szeredi <miklos@szeredi.hu>
|
||||
|
||||
* fusexmp_fh: implement flush() method and call close() on the
|
||||
open file descriptor. This is needed if used on an NFS
|
||||
filesystem, which buffers data until file is closed. Franco Broi
|
||||
spotted the situation when 'cp -p' failed to set the modification
|
||||
time because of this.
|
||||
|
||||
2006-02-20 Miklos Szeredi <miklos@szeredi.hu>
|
||||
|
||||
* Released 2.6.0-pre1
|
||||
|
@ -311,6 +311,23 @@ static int xmp_statfs(const char *path, struct statvfs *stbuf)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_flush(const char *path, struct fuse_file_info *fi)
|
||||
{
|
||||
int res;
|
||||
|
||||
(void) path;
|
||||
/* This is called from every close on an open file, so call the
|
||||
close on the underlying filesystem. But since flush may be
|
||||
called multiple times for an open file, this must not really
|
||||
close the file. This is important if used on a network
|
||||
filesystem like NFS which flush the data/metadata on close() */
|
||||
res = close(dup(fi->fh));
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_release(const char *path, struct fuse_file_info *fi)
|
||||
{
|
||||
(void) path;
|
||||
@ -401,6 +418,7 @@ static struct fuse_operations xmp_oper = {
|
||||
.read = xmp_read,
|
||||
.write = xmp_write,
|
||||
.statfs = xmp_statfs,
|
||||
.flush = xmp_flush,
|
||||
.release = xmp_release,
|
||||
.fsync = xmp_fsync,
|
||||
#ifdef HAVE_SETXATTR
|
||||
|
Loading…
Reference in New Issue
Block a user