diff options
| author | NeilBrown <neilb@suse.de> | 2015-03-22 22:37:38 -0400 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-05-15 01:10:38 -0400 |
| commit | 99ff6cf0e67ada025ba8054a055862383355ec0e (patch) | |
| tree | 1f1fced7004b2b697edd2f2454b5feb0e096309d /Documentation/filesystems | |
| parent | 89076bc31950eee576ecc06460c23466e2d50939 (diff) | |
Documentation: remove outdated information from automount-support.txt
The guidelines for adding automount support to a filesystem
in filesystems/automount-support.txt is out or date.
filesystems/autofs4.txt contains more current text, so replace
the out-of-date content with a reference to that.
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'Documentation/filesystems')
| -rw-r--r-- | Documentation/filesystems/automount-support.txt | 51 |
1 files changed, 13 insertions, 38 deletions
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 | ||
