kernel - SWAP CACHE part 20/many - add 'cache' and 'noscache' chflags.
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 17 Feb 2010 07:52:14 +0000 (23:52 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 17 Feb 2010 07:52:14 +0000 (23:52 -0800)
commite9b560582904689977f992db6d5a91304b89ec4a
treeb53c58df4e97a1a05f6d7ac4bd648f39d36abd8c
parentd7be93f61f54ec4deb27f147693b949ca531e0bb
kernel - SWAP CACHE part 20/many - add 'cache' and 'noscache' chflags.

* Allow directory hierarchies to be selected for data caching when
  using vm.swapcache.data_enable.

* Add the vm.swapcache.use_chflags sysctl which defaults to ON and
  enables use of the new chflags flags to determine what directory
  trees the swapcache will cache data from.

* Add chflags cache and noscache.  The flags are tracked recursively
  by the namecache and do *NOT* have to be set recursively in the
  directory tree.  Setting a flag in a top-level directory is sufficient
  to cover the entire subtree.

  chflags cache - Any regular file in the subtree will be cached
by swapcache.

  chflags noscache - Disables any swapcacheing of data in the subtree,
overrides any use of chflags cache in the subtree.

  NOTE: Only applies to file data.  The caching of file meta-data by
  swapcache is controlled globally by vm.swapcache.meta_enable and
  ignores chflags flags..

* Adjust the manual pages for swapcache and chflags.

* NOTE! The default has been changed to require the use of chflags, data
  caching will not occur unless you either turn off the
  vm.swapcache.use_chflags sysctl (which enables data caching globally)
  or do something like 'chflags cache /'.  Of course vm.swapcache.read_enable
  must also be turned on for swapcache to cache file data.

* NOTE! World must be rebuilt for libc, chflags, and ls to understand the
  new flags.
lib/libc/gen/strtofflags.c
share/man/man8/swapcache.8
sys/kern/vfs_nlookup.c
sys/kern/vfs_vnops.c
sys/sys/namecache.h
sys/sys/nlookup.h
sys/sys/stat.h
sys/sys/vnode.h
sys/vm/vm_swapcache.c
test/test/baaz
usr.bin/chflags/chflags.1