mmc: msm: fix compile error on MSM7x30
[safe/jmp/linux-2.6] / fs / ufs / namei.c
index e84c0ec..b056f02 100644 (file)
 
 #include <linux/time.h>
 #include <linux/fs.h>
-#include <linux/ufs_fs.h>
 #include <linux/smp_lock.h>
-#include "swab.h"      /* will go away - see comment in mknod() */
+
+#include "ufs_fs.h"
+#include "ufs.h"
 #include "util.h"
 
 static inline int ufs_add_nondir(struct dentry *dentry, struct inode *inode)
@@ -55,12 +56,12 @@ static struct dentry *ufs_lookup(struct inode * dir, struct dentry *dentry, stru
                return ERR_PTR(-ENAMETOOLONG);
 
        lock_kernel();
-       ino = ufs_inode_by_name(dir, dentry);
+       ino = ufs_inode_by_name(dir, &dentry->d_name);
        if (ino) {
-               inode = iget(dir->i_sb, ino);
-               if (!inode) {
+               inode = ufs_iget(dir->i_sb, ino);
+               if (IS_ERR(inode)) {
                        unlock_kernel();
-                       return ERR_PTR(-EACCES);
+                       return ERR_CAST(inode);
                }
        }
        unlock_kernel();
@@ -83,6 +84,7 @@ static int ufs_create (struct inode * dir, struct dentry * dentry, int mode,
        int err;
 
        UFSD("BEGIN\n");
+
        inode = ufs_new_inode(dir, mode);
        err = PTR_ERR(inode);
 
@@ -106,11 +108,11 @@ static int ufs_mknod (struct inode * dir, struct dentry *dentry, int mode, dev_t
 
        if (!old_valid_dev(rdev))
                return -EINVAL;
+
        inode = ufs_new_inode(dir, mode);
        err = PTR_ERR(inode);
        if (!IS_ERR(inode)) {
                init_special_inode(inode, mode, rdev);
-               /* NOTE: that'll go when we get wide dev_t */
                ufs_set_inode_dev(inode->i_sb, UFS_I(inode), rdev);
                mark_inode_dirty(inode);
                lock_kernel();
@@ -139,7 +141,7 @@ static int ufs_symlink (struct inode * dir, struct dentry * dentry,
 
        if (l > UFS_SB(sb)->s_uspi->s_maxsymlinklen) {
                /* slow symlink */
-               inode->i_op = &page_symlink_inode_operations;
+               inode->i_op = &ufs_symlink_inode_operations;
                inode->i_mapping->a_ops = &ufs_aops;
                err = page_symlink(inode, symname, l);
                if (err)
@@ -147,7 +149,7 @@ static int ufs_symlink (struct inode * dir, struct dentry * dentry,
        } else {
                /* fast symlink */
                inode->i_op = &ufs_fast_symlink_inode_operations;
-               memcpy((char*)&UFS_I(inode)->i_u1.i_data,symname,l);
+               memcpy(UFS_I(inode)->i_u1.i_symlink, symname, l);
                inode->i_size = l-1;
        }
        mark_inode_dirty(inode);
@@ -237,7 +239,7 @@ static int ufs_unlink(struct inode *dir, struct dentry *dentry)
        struct page *page;
        int err = -ENOENT;
 
-       de = ufs_find_entry(dir, dentry, &page);
+       de = ufs_find_entry(dir, &dentry->d_name, &page);
        if (!de)
                goto out;
 
@@ -281,7 +283,7 @@ static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry,
        struct ufs_dir_entry *old_de;
        int err = -ENOENT;
 
-       old_de = ufs_find_entry(old_dir, old_dentry, &old_page);
+       old_de = ufs_find_entry(old_dir, &old_dentry->d_name, &old_page);
        if (!old_de)
                goto out;
 
@@ -301,7 +303,7 @@ static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry,
                        goto out_dir;
 
                err = -ENOENT;
-               new_de = ufs_find_entry(new_dir, new_dentry, &new_page);
+               new_de = ufs_find_entry(new_dir, &new_dentry->d_name, &new_page);
                if (!new_de)
                        goto out_dir;
                inode_inc_link_count(old_inode);
@@ -355,7 +357,7 @@ out:
        return err;
 }
 
-struct inode_operations ufs_dir_inode_operations = {
+const struct inode_operations ufs_dir_inode_operations = {
        .create         = ufs_create,
        .lookup         = ufs_lookup,
        .link           = ufs_link,