Commit 90088319 authored by Zhang Jingwang's avatar Zhang Jingwang Committed by Dries Kimpe
Browse files

Fix for page cache issue from Gary

Implement zoidfs_commit() call to drop all the page caches belong
to the given file. So that the client can use this call to release
page caches in the server side.
parent d374176f
......@@ -957,9 +957,27 @@ static int zoidfs_posix_remove(const zoidfs_handle_t *parent_handle,
* zoidfs_commit
* This function flushes the buffers associated with the file handle.
*/
static int zoidfs_posix_commit(const zoidfs_handle_t * UNUSED(handle), zoidfs_op_hint_t * UNUSED(op_hint))
static int zoidfs_posix_commit(const zoidfs_handle_t * handle, zoidfs_op_hint_t * UNUSED(op_hint))
/* static int zoidfs_posix_commit(const zoidfs_handle_t * UNUSED(handle), zoidfs_op_hint_t * UNUSED(op_hint)) */
{
/* file descriptor interface is not buffered... */
/* clear page cache */
int file;
int returncode = ZFS_OK;
int ret;
int err;
Descriptor desc;
/* obtain file handle */
ret = getfd_handle (handle, &desc, &err);
if (!ret)
return errno2zfs (err);
file = desc.fd;
posix_fadvise(file,0,0,4);
releasefd_handle (&desc);
return ZFS_OK;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment