Commit aa55ddf340c9fa3f303ee16bbf35887e42c50304

Authored by Ian Kent
Committed by Linus Torvalds
1 parent 06a3598552

autofs4: remove unused ioctls

The ioctls AUTOFS_IOC_TOGGLEREGHOST and AUTOFS_IOC_ASKREGHOST were added
several years ago but what they were intended for has never been
implemented (as far as I'm aware noone uses them) so remove them.

Signed-off-by: Ian Kent <raven@themaw.net>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 3 changed files with 1 additions and 71 deletions Side-by-side Diff

... ... @@ -25,7 +25,6 @@
25 25 static int autofs4_dir_mkdir(struct inode *,struct dentry *,int);
26 26 static int autofs4_root_ioctl(struct inode *, struct file *,unsigned int,unsigned long);
27 27 static int autofs4_dir_open(struct inode *inode, struct file *file);
28   -static int autofs4_root_readdir(struct file * filp, void * dirent, filldir_t filldir);
29 28 static struct dentry *autofs4_lookup(struct inode *,struct dentry *, struct nameidata *);
30 29 static void *autofs4_follow_link(struct dentry *, struct nameidata *);
31 30  
... ... @@ -36,7 +35,7 @@
36 35 .open = dcache_dir_open,
37 36 .release = dcache_dir_close,
38 37 .read = generic_read_dir,
39   - .readdir = autofs4_root_readdir,
  38 + .readdir = dcache_readdir,
40 39 .ioctl = autofs4_root_ioctl,
41 40 };
42 41  
... ... @@ -71,28 +70,6 @@
71 70 .rmdir = autofs4_dir_rmdir,
72 71 };
73 72  
74   -static int autofs4_root_readdir(struct file *file, void *dirent,
75   - filldir_t filldir)
76   -{
77   - struct autofs_sb_info *sbi = autofs4_sbi(file->f_path.dentry->d_sb);
78   - int oz_mode = autofs4_oz_mode(sbi);
79   -
80   - DPRINTK("called, filp->f_pos = %lld", file->f_pos);
81   -
82   - /*
83   - * Don't set reghost flag if:
84   - * 1) f_pos is larger than zero -- we've already been here.
85   - * 2) we haven't even enabled reghosting in the 1st place.
86   - * 3) this is the daemon doing a readdir
87   - */
88   - if (oz_mode && file->f_pos == 0 && sbi->reghost_enabled)
89   - sbi->needs_reghost = 1;
90   -
91   - DPRINTK("needs_reghost = %d", sbi->needs_reghost);
92   -
93   - return dcache_readdir(file, dirent, filldir);
94   -}
95   -
96 73 static int autofs4_dir_open(struct inode *inode, struct file *file)
97 74 {
98 75 struct dentry *dentry = file->f_path.dentry;
... ... @@ -859,44 +836,6 @@
859 836 }
860 837  
861 838 /*
862   - * Tells the daemon whether we need to reghost or not. Also, clears
863   - * the reghost_needed flag.
864   - */
865   -static inline int autofs4_ask_reghost(struct autofs_sb_info *sbi, int __user *p)
866   -{
867   - int status;
868   -
869   - DPRINTK("returning %d", sbi->needs_reghost);
870   -
871   - status = put_user(sbi->needs_reghost, p);
872   - if (status)
873   - return status;
874   -
875   - sbi->needs_reghost = 0;
876   - return 0;
877   -}
878   -
879   -/*
880   - * Enable / Disable reghosting ioctl() operation
881   - */
882   -static inline int autofs4_toggle_reghost(struct autofs_sb_info *sbi, int __user *p)
883   -{
884   - int status;
885   - int val;
886   -
887   - status = get_user(val, p);
888   -
889   - DPRINTK("reghost = %d", val);
890   -
891   - if (status)
892   - return status;
893   -
894   - /* turn on/off reghosting, with the val */
895   - sbi->reghost_enabled = val;
896   - return 0;
897   -}
898   -
899   -/*
900 839 * Tells the daemon whether it can umount the autofs mount.
901 840 */
902 841 static inline int autofs4_ask_umount(struct vfsmount *mnt, int __user *p)
... ... @@ -959,11 +898,6 @@
959 898 return autofs4_get_protosubver(sbi, p);
960 899 case AUTOFS_IOC_SETTIMEOUT:
961 900 return autofs4_get_set_timeout(sbi, p);
962   -
963   - case AUTOFS_IOC_TOGGLEREGHOST:
964   - return autofs4_toggle_reghost(sbi, p);
965   - case AUTOFS_IOC_ASKREGHOST:
966   - return autofs4_ask_reghost(sbi, p);
967 901  
968 902 case AUTOFS_IOC_ASKUMOUNT:
969 903 return autofs4_ask_umount(filp->f_path.mnt, p);
... ... @@ -2297,8 +2297,6 @@
2297 2297 COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE)
2298 2298 COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE_MULTI)
2299 2299 COMPATIBLE_IOCTL(AUTOFS_IOC_PROTOSUBVER)
2300   -COMPATIBLE_IOCTL(AUTOFS_IOC_ASKREGHOST)
2301   -COMPATIBLE_IOCTL(AUTOFS_IOC_TOGGLEREGHOST)
2302 2300 COMPATIBLE_IOCTL(AUTOFS_IOC_ASKUMOUNT)
2303 2301 /* Raw devices */
2304 2302 COMPATIBLE_IOCTL(RAW_SETBIND)
include/linux/auto_fs4.h
... ... @@ -98,8 +98,6 @@
98 98 #define AUTOFS_IOC_EXPIRE_INDIRECT AUTOFS_IOC_EXPIRE_MULTI
99 99 #define AUTOFS_IOC_EXPIRE_DIRECT AUTOFS_IOC_EXPIRE_MULTI
100 100 #define AUTOFS_IOC_PROTOSUBVER _IOR(0x93,0x67,int)
101   -#define AUTOFS_IOC_ASKREGHOST _IOR(0x93,0x68,int)
102   -#define AUTOFS_IOC_TOGGLEREGHOST _IOR(0x93,0x69,int)
103 101 #define AUTOFS_IOC_ASKUMOUNT _IOR(0x93,0x70,int)
104 102  
105 103