Pull misc into release branch
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / fs / afs / dir.c
index 0c1e902f17a3d80db2e32135c0278a3130495e92..33fe39ad4e0327a91e925c10ad54629c5f7c763a 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/fs.h>
 #include <linux/pagemap.h>
 #include <linux/ctype.h>
+#include <linux/sched.h>
 #include "internal.h"
 
 static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry,
@@ -43,6 +44,7 @@ const struct file_operations afs_dir_file_operations = {
        .open           = afs_dir_open,
        .release        = afs_release,
        .readdir        = afs_readdir,
+       .lock           = afs_lock,
 };
 
 const struct inode_operations afs_dir_inode_operations = {
@@ -55,7 +57,8 @@ const struct inode_operations afs_dir_inode_operations = {
        .rmdir          = afs_rmdir,
        .rename         = afs_rename,
        .permission     = afs_permission,
-       .getattr        = afs_inode_getattr,
+       .getattr        = afs_getattr,
+       .setattr        = afs_setattr,
 };
 
 static struct dentry_operations afs_fs_dentry_operations = {
@@ -491,12 +494,12 @@ static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry,
 
        vnode = AFS_FS_I(dir);
 
-       _enter("{%x:%d},%p{%s},",
+       _enter("{%x:%u},%p{%s},",
               vnode->fid.vid, vnode->fid.vnode, dentry, dentry->d_name.name);
 
        ASSERTCMP(dentry->d_inode, ==, NULL);
 
-       if (dentry->d_name.len > 255) {
+       if (dentry->d_name.len >= AFSNAMEMAX) {
                _leave(" = -ENAMETOOLONG");
                return ERR_PTR(-ENAMETOOLONG);
        }
@@ -731,11 +734,11 @@ static int afs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
 
        dvnode = AFS_FS_I(dir);
 
-       _enter("{%x:%d},{%s},%o",
+       _enter("{%x:%u},{%s},%o",
               dvnode->fid.vid, dvnode->fid.vnode, dentry->d_name.name, mode);
 
        ret = -ENAMETOOLONG;
-       if (dentry->d_name.len > 255)
+       if (dentry->d_name.len >= AFSNAMEMAX)
                goto error;
 
        key = afs_request_key(dvnode->volume->cell);
@@ -796,11 +799,11 @@ static int afs_rmdir(struct inode *dir, struct dentry *dentry)
 
        dvnode = AFS_FS_I(dir);
 
-       _enter("{%x:%d},{%s}",
+       _enter("{%x:%u},{%s}",
               dvnode->fid.vid, dvnode->fid.vnode, dentry->d_name.name);
 
        ret = -ENAMETOOLONG;
-       if (dentry->d_name.len > 255)
+       if (dentry->d_name.len >= AFSNAMEMAX)
                goto error;
 
        key = afs_request_key(dvnode->volume->cell);
@@ -842,11 +845,11 @@ static int afs_unlink(struct inode *dir, struct dentry *dentry)
 
        dvnode = AFS_FS_I(dir);
 
-       _enter("{%x:%d},{%s}",
+       _enter("{%x:%u},{%s}",
               dvnode->fid.vid, dvnode->fid.vnode, dentry->d_name.name);
 
        ret = -ENAMETOOLONG;
-       if (dentry->d_name.len > 255)
+       if (dentry->d_name.len >= AFSNAMEMAX)
                goto error;
 
        key = afs_request_key(dvnode->volume->cell);
@@ -916,11 +919,11 @@ static int afs_create(struct inode *dir, struct dentry *dentry, int mode,
 
        dvnode = AFS_FS_I(dir);
 
-       _enter("{%x:%d},{%s},%o,",
+       _enter("{%x:%u},{%s},%o,",
               dvnode->fid.vid, dvnode->fid.vnode, dentry->d_name.name, mode);
 
        ret = -ENAMETOOLONG;
-       if (dentry->d_name.len > 255)
+       if (dentry->d_name.len >= AFSNAMEMAX)
                goto error;
 
        key = afs_request_key(dvnode->volume->cell);
@@ -983,13 +986,13 @@ static int afs_link(struct dentry *from, struct inode *dir,
        vnode = AFS_FS_I(from->d_inode);
        dvnode = AFS_FS_I(dir);
 
-       _enter("{%x:%d},{%x:%d},{%s}",
+       _enter("{%x:%u},{%x:%u},{%s}",
               vnode->fid.vid, vnode->fid.vnode,
               dvnode->fid.vid, dvnode->fid.vnode,
               dentry->d_name.name);
 
        ret = -ENAMETOOLONG;
-       if (dentry->d_name.len > 255)
+       if (dentry->d_name.len >= AFSNAMEMAX)
                goto error;
 
        key = afs_request_key(dvnode->volume->cell);
@@ -1032,16 +1035,16 @@ static int afs_symlink(struct inode *dir, struct dentry *dentry,
 
        dvnode = AFS_FS_I(dir);
 
-       _enter("{%x:%d},{%s},%s",
+       _enter("{%x:%u},{%s},%s",
               dvnode->fid.vid, dvnode->fid.vnode, dentry->d_name.name,
               content);
 
        ret = -ENAMETOOLONG;
-       if (dentry->d_name.len > 255)
+       if (dentry->d_name.len >= AFSNAMEMAX)
                goto error;
 
        ret = -EINVAL;
-       if (strlen(content) > 1023)
+       if (strlen(content) >= AFSPATHMAX)
                goto error;
 
        key = afs_request_key(dvnode->volume->cell);
@@ -1104,14 +1107,14 @@ static int afs_rename(struct inode *old_dir, struct dentry *old_dentry,
        orig_dvnode = AFS_FS_I(old_dir);
        new_dvnode = AFS_FS_I(new_dir);
 
-       _enter("{%x:%d},{%x:%d},{%x:%d},{%s}",
+       _enter("{%x:%u},{%x:%u},{%x:%u},{%s}",
               orig_dvnode->fid.vid, orig_dvnode->fid.vnode,
               vnode->fid.vid, vnode->fid.vnode,
               new_dvnode->fid.vid, new_dvnode->fid.vnode,
               new_dentry->d_name.name);
 
        ret = -ENAMETOOLONG;
-       if (new_dentry->d_name.len > 255)
+       if (new_dentry->d_name.len >= AFSNAMEMAX)
                goto error;
 
        key = afs_request_key(orig_dvnode->volume->cell);