diff options
Diffstat (limited to 'Documentation/filesystems')
-rw-r--r-- | Documentation/filesystems/Locking | 4 | ||||
-rw-r--r-- | Documentation/filesystems/automount-support.txt | 51 | ||||
-rw-r--r-- | Documentation/filesystems/porting | 17 | ||||
-rw-r--r-- | Documentation/filesystems/vfs.txt | 22 |
4 files changed, 44 insertions, 50 deletions
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index 0a926e2ba3ab..6a34a0f4d37c 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking | |||
@@ -50,8 +50,8 @@ prototypes: | |||
50 | int (*rename2) (struct inode *, struct dentry *, | 50 | int (*rename2) (struct inode *, struct dentry *, |
51 | struct inode *, struct dentry *, unsigned int); | 51 | struct inode *, struct dentry *, unsigned int); |
52 | int (*readlink) (struct dentry *, char __user *,int); | 52 | int (*readlink) (struct dentry *, char __user *,int); |
53 | void * (*follow_link) (struct dentry *, struct nameidata *); | 53 | const char *(*follow_link) (struct dentry *, void **); |
54 | void (*put_link) (struct dentry *, struct nameidata *, void *); | 54 | void (*put_link) (struct inode *, void *); |
55 | void (*truncate) (struct inode *); | 55 | void (*truncate) (struct inode *); |
56 | int (*permission) (struct inode *, int, unsigned int); | 56 | int (*permission) (struct inode *, int, unsigned int); |
57 | int (*get_acl)(struct inode *, int); | 57 | int (*get_acl)(struct inode *, int); |
diff --git a/Documentation/filesystems/automount-support.txt b/Documentation/filesystems/automount-support.txt index 7cac200e2a85..7eb762eb3136 100644 --- a/Documentation/filesystems/automount-support.txt +++ b/Documentation/filesystems/automount-support.txt | |||
@@ -1,41 +1,15 @@ | |||
1 | Support is available for filesystems that wish to do automounting support (such | 1 | Support is available for filesystems that wish to do automounting |
2 | as kAFS which can be found in fs/afs/). This facility includes allowing | 2 | support (such as kAFS which can be found in fs/afs/ and NFS in |
3 | in-kernel mounts to be performed and mountpoint degradation to be | 3 | fs/nfs/). This facility includes allowing in-kernel mounts to be |
4 | requested. The latter can also be requested by userspace. | 4 | performed and mountpoint degradation to be requested. The latter can |
5 | also be requested by userspace. | ||
5 | 6 | ||
6 | 7 | ||
7 | ====================== | 8 | ====================== |
8 | IN-KERNEL AUTOMOUNTING | 9 | IN-KERNEL AUTOMOUNTING |
9 | ====================== | 10 | ====================== |
10 | 11 | ||
11 | A filesystem can now mount another filesystem on one of its directories by the | 12 | See section "Mount Traps" of Documentation/filesystems/autofs4.txt |
12 | following procedure: | ||
13 | |||
14 | (1) Give the directory a follow_link() operation. | ||
15 | |||
16 | When the directory is accessed, the follow_link op will be called, and | ||
17 | it will be provided with the location of the mountpoint in the nameidata | ||
18 | structure (vfsmount and dentry). | ||
19 | |||
20 | (2) Have the follow_link() op do the following steps: | ||
21 | |||
22 | (a) Call vfs_kern_mount() to call the appropriate filesystem to set up a | ||
23 | superblock and gain a vfsmount structure representing it. | ||
24 | |||
25 | (b) Copy the nameidata provided as an argument and substitute the dentry | ||
26 | argument into it the copy. | ||
27 | |||
28 | (c) Call do_add_mount() to install the new vfsmount into the namespace's | ||
29 | mountpoint tree, thus making it accessible to userspace. Use the | ||
30 | nameidata set up in (b) as the destination. | ||
31 | |||
32 | If the mountpoint will be automatically expired, then do_add_mount() | ||
33 | should also be given the location of an expiration list (see further | ||
34 | down). | ||
35 | |||
36 | (d) Release the path in the nameidata argument and substitute in the new | ||
37 | vfsmount and its root dentry. The ref counts on these will need | ||
38 | incrementing. | ||
39 | 13 | ||
40 | Then from userspace, you can just do something like: | 14 | Then from userspace, you can just do something like: |
41 | 15 | ||
@@ -61,17 +35,18 @@ AUTOMATIC MOUNTPOINT EXPIRY | |||
61 | =========================== | 35 | =========================== |
62 | 36 | ||
63 | Automatic expiration of mountpoints is easy, provided you've mounted the | 37 | Automatic expiration of mountpoints is easy, provided you've mounted the |
64 | mountpoint to be expired in the automounting procedure outlined above. | 38 | mountpoint to be expired in the automounting procedure outlined separately. |
65 | 39 | ||
66 | To do expiration, you need to follow these steps: | 40 | To do expiration, you need to follow these steps: |
67 | 41 | ||
68 | (3) Create at least one list off which the vfsmounts to be expired can be | 42 | (1) Create at least one list off which the vfsmounts to be expired can be |
69 | hung. Access to this list will be governed by the vfsmount_lock. | 43 | hung. |
70 | 44 | ||
71 | (4) In step (2c) above, the call to do_add_mount() should be provided with a | 45 | (2) When a new mountpoint is created in the ->d_automount method, add |
72 | pointer to this list. It will hang the vfsmount off of it if it succeeds. | 46 | the mnt to the list using mnt_set_expiry() |
47 | mnt_set_expiry(newmnt, &afs_vfsmounts); | ||
73 | 48 | ||
74 | (5) When you want mountpoints to be expired, call mark_mounts_for_expiry() | 49 | (3) When you want mountpoints to be expired, call mark_mounts_for_expiry() |
75 | with a pointer to this list. This will process the list, marking every | 50 | with a pointer to this list. This will process the list, marking every |
76 | vfsmount thereon for potential expiry on the next call. | 51 | vfsmount thereon for potential expiry on the next call. |
77 | 52 | ||
diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting index e69274de8d0c..3eae250254d5 100644 --- a/Documentation/filesystems/porting +++ b/Documentation/filesystems/porting | |||
@@ -483,3 +483,20 @@ in your dentry operations instead. | |||
483 | -- | 483 | -- |
484 | [mandatory] | 484 | [mandatory] |
485 | ->aio_read/->aio_write are gone. Use ->read_iter/->write_iter. | 485 | ->aio_read/->aio_write are gone. Use ->read_iter/->write_iter. |
486 | --- | ||
487 | [recommended] | ||
488 | for embedded ("fast") symlinks just set inode->i_link to wherever the | ||
489 | symlink body is and use simple_follow_link() as ->follow_link(). | ||
490 | -- | ||
491 | [mandatory] | ||
492 | calling conventions for ->follow_link() have changed. Instead of returning | ||
493 | cookie and using nd_set_link() to store the body to traverse, we return | ||
494 | the body to traverse and store the cookie using explicit void ** argument. | ||
495 | nameidata isn't passed at all - nd_jump_link() doesn't need it and | ||
496 | nd_[gs]et_link() is gone. | ||
497 | -- | ||
498 | [mandatory] | ||
499 | calling conventions for ->put_link() have changed. It gets inode instead of | ||
500 | dentry, it does not get nameidata at all and it gets called only when cookie | ||
501 | is non-NULL. Note that link body isn't available anymore, so if you need it, | ||
502 | store it as cookie. | ||
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index 5d833b32bbcd..b403b29ef710 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt | |||
@@ -350,8 +350,8 @@ struct inode_operations { | |||
350 | int (*rename2) (struct inode *, struct dentry *, | 350 | int (*rename2) (struct inode *, struct dentry *, |
351 | struct inode *, struct dentry *, unsigned int); | 351 | struct inode *, struct dentry *, unsigned int); |
352 | int (*readlink) (struct dentry *, char __user *,int); | 352 | int (*readlink) (struct dentry *, char __user *,int); |
353 | void * (*follow_link) (struct dentry *, struct nameidata *); | 353 | const char *(*follow_link) (struct dentry *, void **); |
354 | void (*put_link) (struct dentry *, struct nameidata *, void *); | 354 | void (*put_link) (struct inode *, void *); |
355 | int (*permission) (struct inode *, int); | 355 | int (*permission) (struct inode *, int); |
356 | int (*get_acl)(struct inode *, int); | 356 | int (*get_acl)(struct inode *, int); |
357 | int (*setattr) (struct dentry *, struct iattr *); | 357 | int (*setattr) (struct dentry *, struct iattr *); |
@@ -436,16 +436,18 @@ otherwise noted. | |||
436 | 436 | ||
437 | follow_link: called by the VFS to follow a symbolic link to the | 437 | follow_link: called by the VFS to follow a symbolic link to the |
438 | inode it points to. Only required if you want to support | 438 | inode it points to. Only required if you want to support |
439 | symbolic links. This method returns a void pointer cookie | 439 | symbolic links. This method returns the symlink body |
440 | that is passed to put_link(). | 440 | to traverse (and possibly resets the current position with |
441 | nd_jump_link()). If the body won't go away until the inode | ||
442 | is gone, nothing else is needed; if it needs to be otherwise | ||
443 | pinned, the data needed to release whatever we'd grabbed | ||
444 | is to be stored in void * variable passed by address to | ||
445 | follow_link() instance. | ||
441 | 446 | ||
442 | put_link: called by the VFS to release resources allocated by | 447 | put_link: called by the VFS to release resources allocated by |
443 | follow_link(). The cookie returned by follow_link() is passed | 448 | follow_link(). The cookie stored by follow_link() is passed |
444 | to this method as the last parameter. It is used by | 449 | to this method as the last parameter; only called when |
445 | filesystems such as NFS where page cache is not stable | 450 | cookie isn't NULL. |
446 | (i.e. page that was installed when the symbolic link walk | ||
447 | started might not be in the page cache at the end of the | ||
448 | walk). | ||
449 | 451 | ||
450 | permission: called by the VFS to check for access rights on a POSIX-like | 452 | permission: called by the VFS to check for access rights on a POSIX-like |
451 | filesystem. | 453 | filesystem. |