Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[safe/jmp/linux-2.6] / fs / coda / dir.c
index f89ff08..4bb9d0a 100644 (file)
@@ -59,7 +59,7 @@ static int coda_return_EIO(void)
 }
 #define CODA_EIO_ERROR ((void *) (coda_return_EIO))
 
-static struct dentry_operations coda_dentry_operations =
+static const struct dentry_operations coda_dentry_operations =
 {
        .d_revalidate   = coda_dentry_revalidate,
        .d_delete       = coda_dentry_delete,
@@ -137,13 +137,18 @@ exit:
 }
 
 
-int coda_permission(struct inode *inode, int mask, struct nameidata *nd)
+int coda_permission(struct inode *inode, int mask)
 {
         int error = 0;
+
+       mask &= MAY_READ | MAY_WRITE | MAY_EXEC;
  
        if (!mask)
                return 0; 
 
+       if ((mask & MAY_EXEC) && !execute_ok(inode))
+               return -EACCES;
+
        lock_kernel();
 
        if (coda_cache_check(inode, mask))
@@ -345,7 +350,7 @@ static int coda_symlink(struct inode *dir_inode, struct dentry *de,
 }
 
 /* destruction routines: unlink, rmdir */
-int coda_unlink(struct inode *dir, struct dentry *de)
+static int coda_unlink(struct inode *dir, struct dentry *de)
 {
         int error;
        const char *name = de->d_name.name;
@@ -365,7 +370,7 @@ int coda_unlink(struct inode *dir, struct dentry *de)
        return 0;
 }
 
-int coda_rmdir(struct inode *dir, struct dentry *de)
+static int coda_rmdir(struct inode *dir, struct dentry *de)
 {
        const char *name = de->d_name.name;
        int len = de->d_name.len;
@@ -424,7 +429,7 @@ static int coda_rename(struct inode *old_dir, struct dentry *old_dentry,
 
 
 /* file operations for directories */
-int coda_readdir(struct file *coda_file, void *buf, filldir_t filldir)
+static int coda_readdir(struct file *coda_file, void *buf, filldir_t filldir)
 {
        struct coda_file_info *cfi;
        struct file *host_file;