HomeFreeBSD

Use truncate_setsize in zfs_setattr

Description

Use truncate_setsize in zfs_setattr

According to Linux kernel commit 2c27c65e, using truncate_setsize in
setattr simplifies the code. Therefore, the patch replaces the call
to vmtruncate() with truncate_setsize().

zfs_setattr uses zfs_freesp to free the disk space belonging to the
file. As truncate_setsize may release the page cache and flushing
the dirty data to disk, it must be called before the zfs_freesp.

Suggested-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Prasad Joshi <pjoshi@stec-inc.com>
Closes #255

Details

Provenance
Prasad Joshi <pjoshi@stec-inc.com>Authored on Jun 25 2011, 2:06 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Jun 27 2011, 4:59 PM
Parents
rGb312979252c5: Tear down and flush the mmap region
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG218b8eafbdcb: Use truncate_setsize in zfs_setattr (authored by Prasad Joshi <pjoshi@stec-inc.com>).Jun 27 2011, 4:59 PM