diff options
Diffstat (limited to 'Documentation/filesystems/vfs.txt')
-rw-r--r-- | Documentation/filesystems/vfs.txt | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index efd23f481704..aa754e01464e 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt | |||
@@ -341,8 +341,8 @@ This describes how the VFS can manipulate an inode in your | |||
341 | filesystem. As of kernel 2.6.22, the following members are defined: | 341 | filesystem. As of kernel 2.6.22, the following members are defined: |
342 | 342 | ||
343 | struct inode_operations { | 343 | struct inode_operations { |
344 | int (*create) (struct inode *,struct dentry *, umode_t, struct nameidata *); | 344 | int (*create) (struct inode *,struct dentry *, umode_t, bool); |
345 | struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); | 345 | struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int); |
346 | int (*link) (struct dentry *,struct inode *,struct dentry *); | 346 | int (*link) (struct dentry *,struct inode *,struct dentry *); |
347 | int (*unlink) (struct inode *,struct dentry *); | 347 | int (*unlink) (struct inode *,struct dentry *); |
348 | int (*symlink) (struct inode *,struct dentry *,const char *); | 348 | int (*symlink) (struct inode *,struct dentry *,const char *); |
@@ -364,6 +364,9 @@ struct inode_operations { | |||
364 | ssize_t (*listxattr) (struct dentry *, char *, size_t); | 364 | ssize_t (*listxattr) (struct dentry *, char *, size_t); |
365 | int (*removexattr) (struct dentry *, const char *); | 365 | int (*removexattr) (struct dentry *, const char *); |
366 | void (*update_time)(struct inode *, struct timespec *, int); | 366 | void (*update_time)(struct inode *, struct timespec *, int); |
367 | int (*atomic_open)(struct inode *, struct dentry *, | ||
368 | struct file *, unsigned open_flag, | ||
369 | umode_t create_mode, int *opened); | ||
367 | }; | 370 | }; |
368 | 371 | ||
369 | Again, all methods are called without any locks being held, unless | 372 | Again, all methods are called without any locks being held, unless |
@@ -476,6 +479,14 @@ otherwise noted. | |||
476 | an inode. If this is not defined the VFS will update the inode itself | 479 | an inode. If this is not defined the VFS will update the inode itself |
477 | and call mark_inode_dirty_sync. | 480 | and call mark_inode_dirty_sync. |
478 | 481 | ||
482 | atomic_open: called on the last component of an open. Using this optional | ||
483 | method the filesystem can look up, possibly create and open the file in | ||
484 | one atomic operation. If it cannot perform this (e.g. the file type | ||
485 | turned out to be wrong) it may signal this by returning 1 instead of | ||
486 | usual 0 or -ve . This method is only called if the last | ||
487 | component is negative or needs lookup. Cached positive dentries are | ||
488 | still handled by f_op->open(). | ||
489 | |||
479 | The Address Space Object | 490 | The Address Space Object |
480 | ======================== | 491 | ======================== |
481 | 492 | ||
@@ -891,7 +902,7 @@ the VFS uses a default. As of kernel 2.6.22, the following members are | |||
891 | defined: | 902 | defined: |
892 | 903 | ||
893 | struct dentry_operations { | 904 | struct dentry_operations { |
894 | int (*d_revalidate)(struct dentry *, struct nameidata *); | 905 | int (*d_revalidate)(struct dentry *, unsigned int); |
895 | int (*d_hash)(const struct dentry *, const struct inode *, | 906 | int (*d_hash)(const struct dentry *, const struct inode *, |
896 | struct qstr *); | 907 | struct qstr *); |
897 | int (*d_compare)(const struct dentry *, const struct inode *, | 908 | int (*d_compare)(const struct dentry *, const struct inode *, |
@@ -910,11 +921,11 @@ struct dentry_operations { | |||
910 | dcache. Most filesystems leave this as NULL, because all their | 921 | dcache. Most filesystems leave this as NULL, because all their |
911 | dentries in the dcache are valid | 922 | dentries in the dcache are valid |
912 | 923 | ||
913 | d_revalidate may be called in rcu-walk mode (nd->flags & LOOKUP_RCU). | 924 | d_revalidate may be called in rcu-walk mode (flags & LOOKUP_RCU). |
914 | If in rcu-walk mode, the filesystem must revalidate the dentry without | 925 | If in rcu-walk mode, the filesystem must revalidate the dentry without |
915 | blocking or storing to the dentry, d_parent and d_inode should not be | 926 | blocking or storing to the dentry, d_parent and d_inode should not be |
916 | used without care (because they can go NULL), instead nd->inode should | 927 | used without care (because they can change and, in d_inode case, even |
917 | be used. | 928 | become NULL under us). |
918 | 929 | ||
919 | If a situation is encountered that rcu-walk cannot handle, return | 930 | If a situation is encountered that rcu-walk cannot handle, return |
920 | -ECHILD and it will be called again in ref-walk mode. | 931 | -ECHILD and it will be called again in ref-walk mode. |