autofs: remove duplicated AUTOFS_DEV_IOCTL_SIZE definition
[sfrench/cifs-2.6.git] / fs / autofs4 / dev-ioctl.c
1 /*
2  * Copyright 2008 Red Hat, Inc. All rights reserved.
3  * Copyright 2008 Ian Kent <raven@themaw.net>
4  *
5  * This file is part of the Linux kernel and is made available under
6  * the terms of the GNU General Public License, version 2, or at your
7  * option, any later version, incorporated herein by reference.
8  */
9
10 #include <linux/module.h>
11 #include <linux/vmalloc.h>
12 #include <linux/miscdevice.h>
13 #include <linux/init.h>
14 #include <linux/wait.h>
15 #include <linux/namei.h>
16 #include <linux/fcntl.h>
17 #include <linux/file.h>
18 #include <linux/fdtable.h>
19 #include <linux/sched.h>
20 #include <linux/compat.h>
21 #include <linux/syscalls.h>
22 #include <linux/magic.h>
23 #include <linux/dcache.h>
24 #include <linux/uaccess.h>
25 #include <linux/slab.h>
26
27 #include "autofs_i.h"
28
29 /*
30  * This module implements an interface for routing autofs ioctl control
31  * commands via a miscellaneous device file.
32  *
33  * The alternate interface is needed because we need to be able open
34  * an ioctl file descriptor on an autofs mount that may be covered by
35  * another mount. This situation arises when starting automount(8)
36  * or other user space daemon which uses direct mounts or offset
37  * mounts (used for autofs lazy mount/umount of nested mount trees),
38  * which have been left busy at at service shutdown.
39  */
40
41 typedef int (*ioctl_fn)(struct file *, struct autofs_sb_info *,
42                         struct autofs_dev_ioctl *);
43
44 static int check_name(const char *name)
45 {
46         if (!strchr(name, '/'))
47                 return -EINVAL;
48         return 0;
49 }
50
51 /*
52  * Check a string doesn't overrun the chunk of
53  * memory we copied from user land.
54  */
55 static int invalid_str(char *str, size_t size)
56 {
57         if (memchr(str, 0, size))
58                 return 0;
59         return -EINVAL;
60 }
61
62 /*
63  * Check that the user compiled against correct version of autofs
64  * misc device code.
65  *
66  * As well as checking the version compatibility this always copies
67  * the kernel interface version out.
68  */
69 static int check_dev_ioctl_version(int cmd, struct autofs_dev_ioctl *param)
70 {
71         int err = 0;
72
73         if ((param->ver_major != AUTOFS_DEV_IOCTL_VERSION_MAJOR) ||
74             (param->ver_minor > AUTOFS_DEV_IOCTL_VERSION_MINOR)) {
75                 pr_warn("ioctl control interface version mismatch: "
76                         "kernel(%u.%u), user(%u.%u), cmd(0x%08x)\n",
77                         AUTOFS_DEV_IOCTL_VERSION_MAJOR,
78                         AUTOFS_DEV_IOCTL_VERSION_MINOR,
79                         param->ver_major, param->ver_minor, cmd);
80                 err = -EINVAL;
81         }
82
83         /* Fill in the kernel version. */
84         param->ver_major = AUTOFS_DEV_IOCTL_VERSION_MAJOR;
85         param->ver_minor = AUTOFS_DEV_IOCTL_VERSION_MINOR;
86
87         return err;
88 }
89
90 /*
91  * Copy parameter control struct, including a possible path allocated
92  * at the end of the struct.
93  */
94 static struct autofs_dev_ioctl *
95                 copy_dev_ioctl(struct autofs_dev_ioctl __user *in)
96 {
97         struct autofs_dev_ioctl tmp, *res;
98
99         if (copy_from_user(&tmp, in, sizeof(tmp)))
100                 return ERR_PTR(-EFAULT);
101
102         if (tmp.size < sizeof(tmp))
103                 return ERR_PTR(-EINVAL);
104
105         if (tmp.size > (PATH_MAX + sizeof(tmp)))
106                 return ERR_PTR(-ENAMETOOLONG);
107
108         res = memdup_user(in, tmp.size);
109         if (!IS_ERR(res))
110                 res->size = tmp.size;
111
112         return res;
113 }
114
115 static inline void free_dev_ioctl(struct autofs_dev_ioctl *param)
116 {
117         kfree(param);
118 }
119
120 /*
121  * Check sanity of parameter control fields and if a path is present
122  * check that it is terminated and contains at least one "/".
123  */
124 static int validate_dev_ioctl(int cmd, struct autofs_dev_ioctl *param)
125 {
126         int err;
127
128         err = check_dev_ioctl_version(cmd, param);
129         if (err) {
130                 pr_warn("invalid device control module version "
131                         "supplied for cmd(0x%08x)\n", cmd);
132                 goto out;
133         }
134
135         if (param->size > sizeof(*param)) {
136                 err = invalid_str(param->path, param->size - sizeof(*param));
137                 if (err) {
138                         pr_warn(
139                           "path string terminator missing for cmd(0x%08x)\n",
140                           cmd);
141                         goto out;
142                 }
143
144                 err = check_name(param->path);
145                 if (err) {
146                         pr_warn("invalid path supplied for cmd(0x%08x)\n",
147                                 cmd);
148                         goto out;
149                 }
150         }
151
152         err = 0;
153 out:
154         return err;
155 }
156
157 /*
158  * Get the autofs super block info struct from the file opened on
159  * the autofs mount point.
160  */
161 static struct autofs_sb_info *autofs_dev_ioctl_sbi(struct file *f)
162 {
163         struct autofs_sb_info *sbi = NULL;
164         struct inode *inode;
165
166         if (f) {
167                 inode = file_inode(f);
168                 sbi = autofs4_sbi(inode->i_sb);
169         }
170         return sbi;
171 }
172
173 /* Return autofs dev ioctl version */
174 static int autofs_dev_ioctl_version(struct file *fp,
175                                     struct autofs_sb_info *sbi,
176                                     struct autofs_dev_ioctl *param)
177 {
178         /* This should have already been set. */
179         param->ver_major = AUTOFS_DEV_IOCTL_VERSION_MAJOR;
180         param->ver_minor = AUTOFS_DEV_IOCTL_VERSION_MINOR;
181         return 0;
182 }
183
184 /* Return autofs module protocol version */
185 static int autofs_dev_ioctl_protover(struct file *fp,
186                                      struct autofs_sb_info *sbi,
187                                      struct autofs_dev_ioctl *param)
188 {
189         param->protover.version = sbi->version;
190         return 0;
191 }
192
193 /* Return autofs module protocol sub version */
194 static int autofs_dev_ioctl_protosubver(struct file *fp,
195                                         struct autofs_sb_info *sbi,
196                                         struct autofs_dev_ioctl *param)
197 {
198         param->protosubver.sub_version = sbi->sub_version;
199         return 0;
200 }
201
202 /* Find the topmost mount satisfying test() */
203 static int find_autofs_mount(const char *pathname,
204                              struct path *res,
205                              int test(const struct path *path, void *data),
206                              void *data)
207 {
208         struct path path;
209         int err;
210
211         err = kern_path_mountpoint(AT_FDCWD, pathname, &path, 0);
212         if (err)
213                 return err;
214         err = -ENOENT;
215         while (path.dentry == path.mnt->mnt_root) {
216                 if (path.dentry->d_sb->s_magic == AUTOFS_SUPER_MAGIC) {
217                         if (test(&path, data)) {
218                                 path_get(&path);
219                                 *res = path;
220                                 err = 0;
221                                 break;
222                         }
223                 }
224                 if (!follow_up(&path))
225                         break;
226         }
227         path_put(&path);
228         return err;
229 }
230
231 static int test_by_dev(const struct path *path, void *p)
232 {
233         return path->dentry->d_sb->s_dev == *(dev_t *)p;
234 }
235
236 static int test_by_type(const struct path *path, void *p)
237 {
238         struct autofs_info *ino = autofs4_dentry_ino(path->dentry);
239
240         return ino && ino->sbi->type & *(unsigned *)p;
241 }
242
243 /*
244  * Open a file descriptor on the autofs mount point corresponding
245  * to the given path and device number (aka. new_encode_dev(sb->s_dev)).
246  */
247 static int autofs_dev_ioctl_open_mountpoint(const char *name, dev_t devid)
248 {
249         int err, fd;
250
251         fd = get_unused_fd_flags(O_CLOEXEC);
252         if (likely(fd >= 0)) {
253                 struct file *filp;
254                 struct path path;
255
256                 err = find_autofs_mount(name, &path, test_by_dev, &devid);
257                 if (err)
258                         goto out;
259
260                 /*
261                  * Find autofs super block that has the device number
262                  * corresponding to the autofs fs we want to open.
263                  */
264
265                 filp = dentry_open(&path, O_RDONLY, current_cred());
266                 path_put(&path);
267                 if (IS_ERR(filp)) {
268                         err = PTR_ERR(filp);
269                         goto out;
270                 }
271
272                 fd_install(fd, filp);
273         }
274
275         return fd;
276
277 out:
278         put_unused_fd(fd);
279         return err;
280 }
281
282 /* Open a file descriptor on an autofs mount point */
283 static int autofs_dev_ioctl_openmount(struct file *fp,
284                                       struct autofs_sb_info *sbi,
285                                       struct autofs_dev_ioctl *param)
286 {
287         const char *path;
288         dev_t devid;
289         int err, fd;
290
291         /* param->path has already been checked */
292         if (!param->openmount.devid)
293                 return -EINVAL;
294
295         param->ioctlfd = -1;
296
297         path = param->path;
298         devid = new_decode_dev(param->openmount.devid);
299
300         err = 0;
301         fd = autofs_dev_ioctl_open_mountpoint(path, devid);
302         if (unlikely(fd < 0)) {
303                 err = fd;
304                 goto out;
305         }
306
307         param->ioctlfd = fd;
308 out:
309         return err;
310 }
311
312 /* Close file descriptor allocated above (user can also use close(2)). */
313 static int autofs_dev_ioctl_closemount(struct file *fp,
314                                        struct autofs_sb_info *sbi,
315                                        struct autofs_dev_ioctl *param)
316 {
317         return sys_close(param->ioctlfd);
318 }
319
320 /*
321  * Send "ready" status for an existing wait (either a mount or an expire
322  * request).
323  */
324 static int autofs_dev_ioctl_ready(struct file *fp,
325                                   struct autofs_sb_info *sbi,
326                                   struct autofs_dev_ioctl *param)
327 {
328         autofs_wqt_t token;
329
330         token = (autofs_wqt_t) param->ready.token;
331         return autofs4_wait_release(sbi, token, 0);
332 }
333
334 /*
335  * Send "fail" status for an existing wait (either a mount or an expire
336  * request).
337  */
338 static int autofs_dev_ioctl_fail(struct file *fp,
339                                  struct autofs_sb_info *sbi,
340                                  struct autofs_dev_ioctl *param)
341 {
342         autofs_wqt_t token;
343         int status;
344
345         token = (autofs_wqt_t) param->fail.token;
346         status = param->fail.status ? param->fail.status : -ENOENT;
347         return autofs4_wait_release(sbi, token, status);
348 }
349
350 /*
351  * Set the pipe fd for kernel communication to the daemon.
352  *
353  * Normally this is set at mount using an option but if we
354  * are reconnecting to a busy mount then we need to use this
355  * to tell the autofs mount about the new kernel pipe fd. In
356  * order to protect mounts against incorrectly setting the
357  * pipefd we also require that the autofs mount be catatonic.
358  *
359  * This also sets the process group id used to identify the
360  * controlling process (eg. the owning automount(8) daemon).
361  */
362 static int autofs_dev_ioctl_setpipefd(struct file *fp,
363                                       struct autofs_sb_info *sbi,
364                                       struct autofs_dev_ioctl *param)
365 {
366         int pipefd;
367         int err = 0;
368         struct pid *new_pid = NULL;
369
370         if (param->setpipefd.pipefd == -1)
371                 return -EINVAL;
372
373         pipefd = param->setpipefd.pipefd;
374
375         mutex_lock(&sbi->wq_mutex);
376         if (!sbi->catatonic) {
377                 mutex_unlock(&sbi->wq_mutex);
378                 return -EBUSY;
379         } else {
380                 struct file *pipe;
381
382                 new_pid = get_task_pid(current, PIDTYPE_PGID);
383
384                 if (ns_of_pid(new_pid) != ns_of_pid(sbi->oz_pgrp)) {
385                         pr_warn("not allowed to change PID namespace\n");
386                         err = -EINVAL;
387                         goto out;
388                 }
389
390                 pipe = fget(pipefd);
391                 if (!pipe) {
392                         err = -EBADF;
393                         goto out;
394                 }
395                 if (autofs_prepare_pipe(pipe) < 0) {
396                         err = -EPIPE;
397                         fput(pipe);
398                         goto out;
399                 }
400                 swap(sbi->oz_pgrp, new_pid);
401                 sbi->pipefd = pipefd;
402                 sbi->pipe = pipe;
403                 sbi->catatonic = 0;
404         }
405 out:
406         put_pid(new_pid);
407         mutex_unlock(&sbi->wq_mutex);
408         return err;
409 }
410
411 /*
412  * Make the autofs mount point catatonic, no longer responsive to
413  * mount requests. Also closes the kernel pipe file descriptor.
414  */
415 static int autofs_dev_ioctl_catatonic(struct file *fp,
416                                       struct autofs_sb_info *sbi,
417                                       struct autofs_dev_ioctl *param)
418 {
419         autofs4_catatonic_mode(sbi);
420         return 0;
421 }
422
423 /* Set the autofs mount timeout */
424 static int autofs_dev_ioctl_timeout(struct file *fp,
425                                     struct autofs_sb_info *sbi,
426                                     struct autofs_dev_ioctl *param)
427 {
428         unsigned long timeout;
429
430         timeout = param->timeout.timeout;
431         param->timeout.timeout = sbi->exp_timeout / HZ;
432         sbi->exp_timeout = timeout * HZ;
433         return 0;
434 }
435
436 /*
437  * Return the uid and gid of the last request for the mount
438  *
439  * When reconstructing an autofs mount tree with active mounts
440  * we need to re-connect to mounts that may have used the original
441  * process uid and gid (or string variations of them) for mount
442  * lookups within the map entry.
443  */
444 static int autofs_dev_ioctl_requester(struct file *fp,
445                                       struct autofs_sb_info *sbi,
446                                       struct autofs_dev_ioctl *param)
447 {
448         struct autofs_info *ino;
449         struct path path;
450         dev_t devid;
451         int err = -ENOENT;
452
453         if (param->size <= sizeof(*param)) {
454                 err = -EINVAL;
455                 goto out;
456         }
457
458         devid = sbi->sb->s_dev;
459
460         param->requester.uid = param->requester.gid = -1;
461
462         err = find_autofs_mount(param->path, &path, test_by_dev, &devid);
463         if (err)
464                 goto out;
465
466         ino = autofs4_dentry_ino(path.dentry);
467         if (ino) {
468                 err = 0;
469                 autofs4_expire_wait(&path, 0);
470                 spin_lock(&sbi->fs_lock);
471                 param->requester.uid =
472                         from_kuid_munged(current_user_ns(), ino->uid);
473                 param->requester.gid =
474                         from_kgid_munged(current_user_ns(), ino->gid);
475                 spin_unlock(&sbi->fs_lock);
476         }
477         path_put(&path);
478 out:
479         return err;
480 }
481
482 /*
483  * Call repeatedly until it returns -EAGAIN, meaning there's nothing
484  * more that can be done.
485  */
486 static int autofs_dev_ioctl_expire(struct file *fp,
487                                    struct autofs_sb_info *sbi,
488                                    struct autofs_dev_ioctl *param)
489 {
490         struct vfsmount *mnt;
491         int how;
492
493         how = param->expire.how;
494         mnt = fp->f_path.mnt;
495
496         return autofs4_do_expire_multi(sbi->sb, mnt, sbi, how);
497 }
498
499 /* Check if autofs mount point is in use */
500 static int autofs_dev_ioctl_askumount(struct file *fp,
501                                       struct autofs_sb_info *sbi,
502                                       struct autofs_dev_ioctl *param)
503 {
504         param->askumount.may_umount = 0;
505         if (may_umount(fp->f_path.mnt))
506                 param->askumount.may_umount = 1;
507         return 0;
508 }
509
510 /*
511  * Check if the given path is a mountpoint.
512  *
513  * If we are supplied with the file descriptor of an autofs
514  * mount we're looking for a specific mount. In this case
515  * the path is considered a mountpoint if it is itself a
516  * mountpoint or contains a mount, such as a multi-mount
517  * without a root mount. In this case we return 1 if the
518  * path is a mount point and the super magic of the covering
519  * mount if there is one or 0 if it isn't a mountpoint.
520  *
521  * If we aren't supplied with a file descriptor then we
522  * lookup the path and check if it is the root of a mount.
523  * If a type is given we are looking for a particular autofs
524  * mount and if we don't find a match we return fail. If the
525  * located path is the root of a mount we return 1 along with
526  * the super magic of the mount or 0 otherwise.
527  *
528  * In both cases the the device number (as returned by
529  * new_encode_dev()) is also returned.
530  */
531 static int autofs_dev_ioctl_ismountpoint(struct file *fp,
532                                          struct autofs_sb_info *sbi,
533                                          struct autofs_dev_ioctl *param)
534 {
535         struct path path;
536         const char *name;
537         unsigned int type;
538         unsigned int devid, magic;
539         int err = -ENOENT;
540
541         if (param->size <= sizeof(*param)) {
542                 err = -EINVAL;
543                 goto out;
544         }
545
546         name = param->path;
547         type = param->ismountpoint.in.type;
548
549         param->ismountpoint.out.devid = devid = 0;
550         param->ismountpoint.out.magic = magic = 0;
551
552         if (!fp || param->ioctlfd == -1) {
553                 if (autofs_type_any(type))
554                         err = kern_path_mountpoint(AT_FDCWD,
555                                                    name, &path, LOOKUP_FOLLOW);
556                 else
557                         err = find_autofs_mount(name, &path,
558                                                 test_by_type, &type);
559                 if (err)
560                         goto out;
561                 devid = new_encode_dev(path.dentry->d_sb->s_dev);
562                 err = 0;
563                 if (path.mnt->mnt_root == path.dentry) {
564                         err = 1;
565                         magic = path.dentry->d_sb->s_magic;
566                 }
567         } else {
568                 dev_t dev = sbi->sb->s_dev;
569
570                 err = find_autofs_mount(name, &path, test_by_dev, &dev);
571                 if (err)
572                         goto out;
573
574                 devid = new_encode_dev(dev);
575
576                 err = path_has_submounts(&path);
577
578                 if (follow_down_one(&path))
579                         magic = path.dentry->d_sb->s_magic;
580         }
581
582         param->ismountpoint.out.devid = devid;
583         param->ismountpoint.out.magic = magic;
584         path_put(&path);
585 out:
586         return err;
587 }
588
589 /*
590  * Our range of ioctl numbers isn't 0 based so we need to shift
591  * the array index by _IOC_NR(AUTOFS_CTL_IOC_FIRST) for the table
592  * lookup.
593  */
594 #define cmd_idx(cmd)    (cmd - _IOC_NR(AUTOFS_DEV_IOCTL_IOC_FIRST))
595
596 static ioctl_fn lookup_dev_ioctl(unsigned int cmd)
597 {
598         static ioctl_fn _ioctls[] = {
599                 autofs_dev_ioctl_version,
600                 autofs_dev_ioctl_protover,
601                 autofs_dev_ioctl_protosubver,
602                 autofs_dev_ioctl_openmount,
603                 autofs_dev_ioctl_closemount,
604                 autofs_dev_ioctl_ready,
605                 autofs_dev_ioctl_fail,
606                 autofs_dev_ioctl_setpipefd,
607                 autofs_dev_ioctl_catatonic,
608                 autofs_dev_ioctl_timeout,
609                 autofs_dev_ioctl_requester,
610                 autofs_dev_ioctl_expire,
611                 autofs_dev_ioctl_askumount,
612                 autofs_dev_ioctl_ismountpoint,
613         };
614         unsigned int idx = cmd_idx(cmd);
615
616         return (idx >= ARRAY_SIZE(_ioctls)) ? NULL : _ioctls[idx];
617 }
618
619 /* ioctl dispatcher */
620 static int _autofs_dev_ioctl(unsigned int command,
621                              struct autofs_dev_ioctl __user *user)
622 {
623         struct autofs_dev_ioctl *param;
624         struct file *fp;
625         struct autofs_sb_info *sbi;
626         unsigned int cmd_first, cmd;
627         ioctl_fn fn = NULL;
628         int err = 0;
629
630         /* only root can play with this */
631         if (!capable(CAP_SYS_ADMIN))
632                 return -EPERM;
633
634         cmd_first = _IOC_NR(AUTOFS_DEV_IOCTL_IOC_FIRST);
635         cmd = _IOC_NR(command);
636
637         if (_IOC_TYPE(command) != _IOC_TYPE(AUTOFS_DEV_IOCTL_IOC_FIRST) ||
638             cmd - cmd_first > AUTOFS_DEV_IOCTL_IOC_COUNT) {
639                 return -ENOTTY;
640         }
641
642         /* Copy the parameters into kernel space. */
643         param = copy_dev_ioctl(user);
644         if (IS_ERR(param))
645                 return PTR_ERR(param);
646
647         err = validate_dev_ioctl(command, param);
648         if (err)
649                 goto out;
650
651         fn = lookup_dev_ioctl(cmd);
652         if (!fn) {
653                 pr_warn("unknown command 0x%08x\n", command);
654                 err = -ENOTTY;
655                 goto out;
656         }
657
658         fp = NULL;
659         sbi = NULL;
660
661         /*
662          * For obvious reasons the openmount can't have a file
663          * descriptor yet. We don't take a reference to the
664          * file during close to allow for immediate release,
665          * and the same for retrieving ioctl version.
666          */
667         if (cmd != AUTOFS_DEV_IOCTL_VERSION_CMD &&
668             cmd != AUTOFS_DEV_IOCTL_OPENMOUNT_CMD &&
669             cmd != AUTOFS_DEV_IOCTL_CLOSEMOUNT_CMD) {
670                 fp = fget(param->ioctlfd);
671                 if (!fp) {
672                         if (cmd == AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD)
673                                 goto cont;
674                         err = -EBADF;
675                         goto out;
676                 }
677
678                 sbi = autofs_dev_ioctl_sbi(fp);
679                 if (!sbi || sbi->magic != AUTOFS_SBI_MAGIC) {
680                         err = -EINVAL;
681                         fput(fp);
682                         goto out;
683                 }
684
685                 /*
686                  * Admin needs to be able to set the mount catatonic in
687                  * order to be able to perform the re-open.
688                  */
689                 if (!autofs4_oz_mode(sbi) &&
690                     cmd != AUTOFS_DEV_IOCTL_CATATONIC_CMD) {
691                         err = -EACCES;
692                         fput(fp);
693                         goto out;
694                 }
695         }
696 cont:
697         err = fn(fp, sbi, param);
698
699         if (fp)
700                 fput(fp);
701         if (err >= 0 && copy_to_user(user, param, AUTOFS_DEV_IOCTL_SIZE))
702                 err = -EFAULT;
703 out:
704         free_dev_ioctl(param);
705         return err;
706 }
707
708 static long autofs_dev_ioctl(struct file *file, uint command, ulong u)
709 {
710         int err;
711
712         err = _autofs_dev_ioctl(command, (struct autofs_dev_ioctl __user *) u);
713         return (long) err;
714 }
715
716 #ifdef CONFIG_COMPAT
717 static long autofs_dev_ioctl_compat(struct file *file, uint command, ulong u)
718 {
719         return (long) autofs_dev_ioctl(file, command, (ulong) compat_ptr(u));
720 }
721 #else
722 #define autofs_dev_ioctl_compat NULL
723 #endif
724
725 static const struct file_operations _dev_ioctl_fops = {
726         .unlocked_ioctl  = autofs_dev_ioctl,
727         .compat_ioctl = autofs_dev_ioctl_compat,
728         .owner   = THIS_MODULE,
729         .llseek = noop_llseek,
730 };
731
732 static struct miscdevice _autofs_dev_ioctl_misc = {
733         .minor          = AUTOFS_MINOR,
734         .name           = AUTOFS_DEVICE_NAME,
735         .fops           = &_dev_ioctl_fops
736 };
737
738 MODULE_ALIAS_MISCDEV(AUTOFS_MINOR);
739 MODULE_ALIAS("devname:autofs");
740
741 /* Register/deregister misc character device */
742 int __init autofs_dev_ioctl_init(void)
743 {
744         int r;
745
746         r = misc_register(&_autofs_dev_ioctl_misc);
747         if (r) {
748                 pr_err("misc_register failed for control device\n");
749                 return r;
750         }
751
752         return 0;
753 }
754
755 void autofs_dev_ioctl_exit(void)
756 {
757         misc_deregister(&_autofs_dev_ioctl_misc);
758 }