]> git.proxmox.com Git - mirror_zfs.git/commit - module/zfs/zfs_vnops.c
Add ZFS specific mmap() checks
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 1 Jul 2011 18:25:07 +0000 (11:25 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 1 Jul 2011 19:23:46 +0000 (12:23 -0700)
commite2e7aa2df88708cdcae87688a69ba3f5d1cc43ed
tree392911d19bf1a0e0b1fd0e8862de029fa47e7be6
parentf0b2486034f6a4d8cd1a139ff4604e6b9629a64e
Add ZFS specific mmap() checks

Under Linux the VFS handles virtually all of the mmap() access
checks.  Filesystem specific checks are left to be handled in
the .mmap() hook and normally there arn't any.

However, ZFS provides a few attributes which can influence the
mmap behavior and should be honored.  Note, currently the code
to modify these attributes has not been implemented under Linux.

* ZFS_IMMUTABLE | ZFS_READONLY | ZFS_APPENDONLY: when any of these
  attributes are set a file may not be mmaped with write access.

* ZFS_AV_QUARANTINED: when set a file file may not be mmaped with
  read or exec access.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
include/sys/zfs_vnops.h
module/zfs/zfs_vnops.c
module/zfs/zpl_file.c