diff options
Diffstat (limited to 'Documentation/filesystems/vfs.txt')
-rw-r--r-- | Documentation/filesystems/vfs.txt | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index 88b9f5519af..52d8fb81cff 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 | ||
234 | All methods are called without any locks being held, unless otherwise | 236 | All methods are called without any locks being held, unless otherwise |
@@ -301,6 +303,26 @@ 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 | |||
320 | Implementations must include conditional reschedule calls inside any | ||
321 | scanning loop that is done. This allows the VFS to determine | ||
322 | appropriate scan batch sizes without having to worry about whether | ||
323 | implementations will cause holdoff problems due to large scan batch | ||
324 | sizes. | ||
325 | |||
304 | Whoever sets up the inode is responsible for filling in the "i_op" field. This | 326 | Whoever sets up the inode is responsible for filling in the "i_op" field. This |
305 | is a pointer to a "struct inode_operations" which describes the methods that | 327 | is a pointer to a "struct inode_operations" which describes the methods that |
306 | can be performed on individual inodes. | 328 | can be performed on individual inodes. |
@@ -333,8 +355,8 @@ struct inode_operations { | |||
333 | void * (*follow_link) (struct dentry *, struct nameidata *); | 355 | void * (*follow_link) (struct dentry *, struct nameidata *); |
334 | void (*put_link) (struct dentry *, struct nameidata *, void *); | 356 | void (*put_link) (struct dentry *, struct nameidata *, void *); |
335 | void (*truncate) (struct inode *); | 357 | void (*truncate) (struct inode *); |
336 | int (*permission) (struct inode *, int, unsigned int); | 358 | int (*permission) (struct inode *, int); |
337 | int (*check_acl)(struct inode *, int, unsigned int); | 359 | int (*get_acl)(struct inode *, int); |
338 | int (*setattr) (struct dentry *, struct iattr *); | 360 | int (*setattr) (struct dentry *, struct iattr *); |
339 | int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *); | 361 | int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *); |
340 | int (*setxattr) (struct dentry *, const char *,const void *,size_t,int); | 362 | int (*setxattr) (struct dentry *, const char *,const void *,size_t,int); |
@@ -423,7 +445,7 @@ otherwise noted. | |||
423 | permission: called by the VFS to check for access rights on a POSIX-like | 445 | permission: called by the VFS to check for access rights on a POSIX-like |
424 | filesystem. | 446 | filesystem. |
425 | 447 | ||
426 | May be called in rcu-walk mode (flags & IPERM_FLAG_RCU). If in rcu-walk | 448 | May be called in rcu-walk mode (mask & MAY_NOT_BLOCK). If in rcu-walk |
427 | mode, the filesystem must check the permission without blocking or | 449 | mode, the filesystem must check the permission without blocking or |
428 | storing to the inode. | 450 | storing to the inode. |
429 | 451 | ||
@@ -755,7 +777,7 @@ struct file_operations { | |||
755 | int (*open) (struct inode *, struct file *); | 777 | int (*open) (struct inode *, struct file *); |
756 | int (*flush) (struct file *); | 778 | int (*flush) (struct file *); |
757 | int (*release) (struct inode *, struct file *); | 779 | int (*release) (struct inode *, struct file *); |
758 | int (*fsync) (struct file *, int datasync); | 780 | int (*fsync) (struct file *, loff_t, loff_t, int datasync); |
759 | int (*aio_fsync) (struct kiocb *, int datasync); | 781 | int (*aio_fsync) (struct kiocb *, int datasync); |
760 | int (*fasync) (int, struct file *, int); | 782 | int (*fasync) (int, struct file *, int); |
761 | int (*lock) (struct file *, int, struct file_lock *); | 783 | int (*lock) (struct file *, int, struct file_lock *); |