Lines Matching refs:the

2 Miscellaneous Device control operations for the autofs4 kernel module
11 During normal operation autofs uses a file descriptor opened on the
14 autofs specific information stored in the super block. The operations
15 are things such as setting an autofs mount catatonic, setting the
23 needs to walk back up the mount tree to construct a path, such as
24 getcwd(2) and the proc file system /proc/<pid>/cwd, no longer works
25 because the point from which the path is constructed has been detached
26 from the mount tree.
29 mounts. Immediately one thinks of just adding the ability to remount
31 because autofs direct mounts and the implementation of "on demand mount
32 and expire" of nested mount trees have the file system mounted directly
33 on top of the mount trigger directory dentry.
35 For example, there are two types of automount maps, direct (in the kernel
44 and the corresponding map files:
58 For the above indirect map an autofs file system is mounted on /test and
59 mounts are triggered for each sub-directory key by the inode lookup
65 trigger. So when we walk on the path we mount shark:/autofs/export1 "on
67 use the follow_link inode operation to trigger the mount.
90 One of the issues with version 4 of autofs was that, when mounting an
92 to mount and umount all of the offsets as a single unit. Not really a
94 This mechanism is used for the well known "hosts" map and we have seen
95 cases (in 2.4) where the available number of mounts are exhausted or
96 where the number of privileged ports available is exhausted.
98 In version 5 we mount only as we go down the tree of offsets and
99 similarly for expiring them which resolves the above problem. There is
100 somewhat more detail to the implementation but it isn't needed for the
101 sake of the problem explanation. The one important detail is that these
102 offsets are implemented using the same mechanism as the direct mounts
103 above and so the mount points can be covered by a mount.
106 on the mount point for control operations. The references held by the
109 in the mount super block. So the use of a file handle needs to be
119 implement an isolated operation it was decided to re-implement the
124 the uid and gid of the last user that triggered the mount needs to be
129 Since we're re-implementing the control interface, a couple of other
130 problems with the existing interface have been addressed. First, when
131 a mount or expire operation completes a status is returned to the
133 "send fail" operation of the ioctl interface could only ever send
134 ENOENT so the re-implementation allows user space to send an actual
139 in the mount table. An operation to lookup the mount status of a mount
142 Current kernel development policy recommends avoiding the use of the
147 complexity. There's no question that the Generic Netlink system is an
152 that lead to the decision to not use it. This is that the autofs
153 expire in the daemon has become far to complex because umount
155 the number of times to call the expire ioctl. This involves scanning
156 the mount table which has proved to be a big overhead for users with
157 large maps. The best way to improve this is try and get back to the
158 way the expire was done long ago. That is, when an expire request is
160 the daemon until we can't umount any more mounts, then return the
161 appropriate status to the daemon. At the moment we just expire one
163 possibility for future development due to the requirements of the
172 All the ioctls use a common structure to pass the needed parameter
189 point. It is returned by the open call and is used by all calls except
190 the check for whether a given path is a mount point, where it may
192 mount point file descriptor, and when requesting the uid and gid of the
193 last successful mount on a directory within the autofs file system.
198 The path field is used to pass a path where it is needed and the size field
199 is used account for the increased structure length when translating the
203 the void function call init_autofs_dev_ioctl(struct autofs_dev_ioctl *).
205 All of the ioctls perform a copy of this structure from user space to
206 kernel space and return -EINVAL if the size parameter is smaller than
207 the structure size itself, -ENOMEM if the kernel memory allocation fails
208 or -EFAULT if the copy itself fails. Other checks include a version check
209 of the compiled in user space version against the module version and a
210 mismatch results in a -EINVAL return. If the size field is greater than
211 the structure size then a path is assumed to be present and is checked to
215 AUTOFS_DEV_IOCTL_CLOSEMOUNT_CMD the ioctlfd is validated and if it is
225 in autofs version 5.0.4 and later in file lib/dev-ioctl-lib.c of the
235 Get the major and minor version of the autofs4 device ioctl kernel module
237 input parameter and sets the version information in the passed in structure.
238 It returns 0 on success or the error -EINVAL if a version mismatch is
245 Get the major and minor version of the autofs4 protocol version understood
247 with the ioctlfd field set to a valid autofs mount point descriptor
248 and sets the requested version number in structure field arg1. These
249 commands return 0 on success or one of the negative error codes if
258 the path field set and the size field adjusted appropriately as well
259 as the arg1 field set to the device number of the autofs mount. The
260 device number can be obtained from the mount options shown in
262 autofs_dev_ioct with the ioctlfd field set to the descriptor obtained
263 from the open call. The release of the file descriptor can also be done
265 The close call is included in the implemented operations largely for
272 Return mount and expire result status from user space to the kernel.
274 with the ioctlfd field set to the descriptor obtained from the open
275 call and the arg1 field set to the wait queue token number, received
276 by user space in the foregoing mount or expire request. The arg2 field
277 is set to the status to be returned. For the ready call this is always
278 0 and for the fail call it is set to the errno of the operation.
284 Set the pipe file descriptor used for kernel communication to the daemon.
286 to a existing mount we need to use this to tell the autofs mount about
287 the new kernel pipe descriptor. In order to protect mounts against
288 incorrectly setting the pipe descriptor we also require that the autofs
291 The call requires an initialized struct autofs_dev_ioctl with the
292 ioctlfd field set to the descriptor obtained from the open call and
293 the arg1 field set to descriptor of the pipe. On success the call
294 also sets the process group id used to identify the controlling process
295 (eg. the owning automount(8) daemon) to the process group of the caller.
301 Make the autofs mount point catatonic. The autofs mount will no longer
302 issue mount requests, the kernel communication pipe descriptor is released
303 and any remaining waits in the queue released.
305 The call requires an initialized struct autofs_dev_ioctl with the
306 ioctlfd field set to the descriptor obtained from the open call.
312 Set the expire timeout for mounts within an autofs mount point.
314 The call requires an initialized struct autofs_dev_ioctl with the
315 ioctlfd field set to the descriptor obtained from the open call.
321 Return the uid and gid of the last process to successfully trigger a the
322 mount on the given path dentry.
324 The call requires an initialized struct autofs_dev_ioctl with the path
325 field set to the mount point in question and the size field adjusted
326 appropriately as well as the arg1 field set to the device number of the
327 containing autofs mount. Upon return the struct field arg1 contains the
328 uid and arg2 the gid.
331 re-connect to mounts that may have used the original process uid and
332 gid (or string variations of them) for mount lookups within the map entry.
333 This call provides the ability to obtain this uid and gid so they may be
334 used by user space for the mount map lookups.
340 Issue an expire request to the kernel for an autofs mount. Typically
343 The call requires an initialized struct autofs_dev_ioctl with the
344 ioctlfd field set to the descriptor obtained from the open call. In
345 addition an immediate expire, independent of the mount timeout, can be
346 requested by setting the arg1 field to 1. If no expire candidates can
347 be found the ioctl returns -1 with errno set to EAGAIN.
349 This call causes the kernel module to check the mount corresponding
350 to the given ioctlfd for mounts that can be expired, issues an expire
351 request back to the daemon and waits for completion.
358 The call requires an initialized struct autofs_dev_ioctl with the
359 ioctlfd field set to the descriptor obtained from the open call and
360 it returns the result in the arg1 field, 1 for busy and 0 otherwise.
366 Check if the given path is a mountpoint.
369 possible variations. Both use the path field set to the path of the mount
370 point to check and the size field adjusted appropriately. One uses the
371 ioctlfd field to identify a specific mount point to check while the other
372 variation uses the path and optionally arg1 set to an autofs mount type.
373 The call returns 1 if this is a mount point and sets arg1 to the device
374 number of the mount and field arg2 to the relevant super block magic
376 the the device number (as returned by new_encode_dev()) is returned
380 not necessarily at the top of the mounted stack. In this case the path
381 the descriptor corresponds to is considered a mountpoint if it is itself
383 mount. In this case we return 1 if the descriptor corresponds to a mount
384 point and and also returns the super magic of the covering mount if there
387 If a path is supplied (and the ioctlfd field is set to -1) then the path
388 is looked up and is checked to see if it is the root of a mount. If a
390 a match isn't found a fail is returned. If the the located path is the
391 root of a mount 1 is returned along with the super magic of the mount