aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/filesystems/vfs.txt
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2011-07-08 00:14:44 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-07-20 20:47:41 -0400
commit0e1fdafd93980eac62e778798549ce0f6073905c (patch)
treea8b21525d195d436fa738e9a470e64eaa21e6736 /Documentation/filesystems/vfs.txt
parent4f8c19fdf3f97402b68f058b1c72a6c7166c9e59 (diff)
superblock: add filesystem shrinker operations
Now we have a per-superblock shrinker implementation, we can add a filesystem specific callout to it to allow filesystem internal caches to be shrunk by the superblock shrinker. Rather than perpetuate the multipurpose shrinker callback API (i.e. nr_to_scan == 0 meaning "tell me how many objects freeable in the cache), two operations will be added. The first will return the number of objects that are freeable, the second is the actual shrinker call. Signed-off-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'Documentation/filesystems/vfs.txt')
-rw-r--r--Documentation/filesystems/vfs.txt16
1 files changed, 16 insertions, 0 deletions
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt
index d56151fe77dc..fd24f34f120f 100644
--- a/Documentation/filesystems/vfs.txt
+++ b/Documentation/filesystems/vfs.txt
@@ -229,6 +229,8 @@ struct super_operations {
229 229
230 ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); 230 ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t);
231 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); 231 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t);
232 int (*nr_cached_objects)(struct super_block *);
233 void (*free_cached_objects)(struct super_block *, int);
232}; 234};
233 235
234All methods are called without any locks being held, unless otherwise 236All methods are called without any locks being held, unless otherwise
@@ -301,6 +303,20 @@ or bottom half).
301 303
302 quota_write: called by the VFS to write to filesystem quota file. 304 quota_write: called by the VFS to write to filesystem quota file.
303 305
306 nr_cached_objects: called by the sb cache shrinking function for the
307 filesystem to return the number of freeable cached objects it contains.
308 Optional.
309
310 free_cache_objects: called by the sb cache shrinking function for the
311 filesystem to scan the number of objects indicated to try to free them.
312 Optional, but any filesystem implementing this method needs to also
313 implement ->nr_cached_objects for it to be called correctly.
314
315 We can't do anything with any errors that the filesystem might
316 encountered, hence the void return type. This will never be called if
317 the VM is trying to reclaim under GFP_NOFS conditions, hence this
318 method does not need to handle that situation itself.
319
304Whoever sets up the inode is responsible for filling in the "i_op" field. This 320Whoever sets up the inode is responsible for filling in the "i_op" field. This
305is a pointer to a "struct inode_operations" which describes the methods that 321is a pointer to a "struct inode_operations" which describes the methods that
306can be performed on individual inodes. 322can be performed on individual inodes.