fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / fs / autofs / root.c
index a1ab1c0..e698c51 100644 (file)
@@ -10,6 +10,7 @@
  *
  * ------------------------------------------------------------------------- */
 
+#include <linux/capability.h>
 #include <linux/errno.h>
 #include <linux/stat.h>
 #include <linux/param.h>
@@ -25,7 +26,7 @@ static int autofs_root_rmdir(struct inode *,struct dentry *);
 static int autofs_root_mkdir(struct inode *,struct dentry *,int);
 static int autofs_root_ioctl(struct inode *, struct file *,unsigned int,unsigned long);
 
-struct file_operations autofs_root_operations = {
+const struct file_operations autofs_root_operations = {
        .read           = generic_read_dir,
        .readdir        = autofs_root_readdir,
        .ioctl          = autofs_root_ioctl,
@@ -44,7 +45,7 @@ static int autofs_root_readdir(struct file *filp, void *dirent, filldir_t filldi
        struct autofs_dir_ent *ent = NULL;
        struct autofs_dirhash *dirhash;
        struct autofs_sb_info *sbi;
-       struct inode * inode = filp->f_dentry->d_inode;
+       struct inode * inode = filp->f_path.dentry->d_inode;
        off_t onr, nr;
 
        lock_kernel();
@@ -229,9 +230,9 @@ static struct dentry *autofs_root_lookup(struct inode *dir, struct dentry *dentr
        dentry->d_flags |= DCACHE_AUTOFS_PENDING;
        d_add(dentry, NULL);
 
-       up(&dir->i_sem);
+       mutex_unlock(&dir->i_mutex);
        autofs_revalidate(dentry, nd);
-       down(&dir->i_sem);
+       mutex_lock(&dir->i_mutex);
 
        /*
         * If we are still pending, check if we had to handle
@@ -413,7 +414,7 @@ static int autofs_root_rmdir(struct inode *dir, struct dentry *dentry)
 
        dentry->d_time = (unsigned long)(struct autofs_dir_ent *)NULL;
        autofs_hash_delete(ent);
-       dir->i_nlink--;
+       drop_nlink(dir);
        d_drop(dentry);
        unlock_kernel();
 
@@ -465,7 +466,7 @@ static int autofs_root_mkdir(struct inode *dir, struct dentry *dentry, int mode)
        ent->dentry = dentry;
        autofs_hash_insert(dh,ent);
 
-       dir->i_nlink++;
+       inc_nlink(dir);
        d_instantiate(dentry, iget(dir->i_sb,ino));
        unlock_kernel();
 
@@ -556,7 +557,7 @@ static int autofs_root_ioctl(struct inode *inode, struct file *filp,
        case AUTOFS_IOC_SETTIMEOUT:
                return autofs_get_set_timeout(sbi, argp);
        case AUTOFS_IOC_EXPIRE:
-               return autofs_expire_run(inode->i_sb, sbi, filp->f_vfsmnt,
+               return autofs_expire_run(inode->i_sb, sbi, filp->f_path.mnt,
                                         argp);
        default:
                return -ENOSYS;