Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
[pandora-kernel.git] / fs / hfs / dir.c
index e1f24be..e2e0358 100644 (file)
@@ -53,7 +53,7 @@ done:
  */
 static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
 {
-       struct inode *inode = filp->f_dentry->d_inode;
+       struct inode *inode = filp->f_path.dentry->d_inode;
        struct super_block *sb = inode->i_sb;
        int len, err;
        char strbuf[HFS_MAX_NAMELEN];
@@ -81,12 +81,12 @@ static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
        case 1:
                hfs_bnode_read(fd.bnode, &entry, fd.entryoffset, fd.entrylength);
                if (entry.type != HFS_CDR_THD) {
-                       printk("HFS: bad catalog folder thread\n");
+                       printk(KERN_ERR "hfs: bad catalog folder thread\n");
                        err = -EIO;
                        goto out;
                }
                //if (fd.entrylength < HFS_MIN_THREAD_SZ) {
-               //      printk("HFS: truncated catalog thread\n");
+               //      printk(KERN_ERR "hfs: truncated catalog thread\n");
                //      err = -EIO;
                //      goto out;
                //}
@@ -105,7 +105,7 @@ static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
 
        for (;;) {
                if (be32_to_cpu(fd.key->cat.ParID) != inode->i_ino) {
-                       printk("HFS: walked past end of dir\n");
+                       printk(KERN_ERR "hfs: walked past end of dir\n");
                        err = -EIO;
                        goto out;
                }
@@ -114,7 +114,7 @@ static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
                len = hfs_mac2asc(sb, strbuf, &fd.key->cat.CName);
                if (type == HFS_CDR_DIR) {
                        if (fd.entrylength < sizeof(struct hfs_cat_dir)) {
-                               printk("HFS: small dir entry\n");
+                               printk(KERN_ERR "hfs: small dir entry\n");
                                err = -EIO;
                                goto out;
                        }
@@ -123,7 +123,7 @@ static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
                                break;
                } else if (type == HFS_CDR_FIL) {
                        if (fd.entrylength < sizeof(struct hfs_cat_file)) {
-                               printk("HFS: small file entry\n");
+                               printk(KERN_ERR "hfs: small file entry\n");
                                err = -EIO;
                                goto out;
                        }
@@ -131,7 +131,7 @@ static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
                                    be32_to_cpu(entry.file.FlNum), DT_REG))
                                break;
                } else {
-                       printk("HFS: bad catalog entry type %d\n", type);
+                       printk(KERN_ERR "hfs: bad catalog entry type %d\n", type);
                        err = -EIO;
                        goto out;
                }
@@ -246,7 +246,7 @@ static int hfs_unlink(struct inode *dir, struct dentry *dentry)
        if (res)
                return res;
 
-       inode->i_nlink--;
+       drop_nlink(inode);
        hfs_delete_inode(inode);
        inode->i_ctime = CURRENT_TIME_SEC;
        mark_inode_dirty(inode);
@@ -273,7 +273,7 @@ static int hfs_rmdir(struct inode *dir, struct dentry *dentry)
        res = hfs_cat_delete(inode->i_ino, dir, &dentry->d_name);
        if (res)
                return res;
-       inode->i_nlink = 0;
+       clear_nlink(inode);
        inode->i_ctime = CURRENT_TIME_SEC;
        hfs_delete_inode(inode);
        mark_inode_dirty(inode);
@@ -313,7 +313,7 @@ static int hfs_rename(struct inode *old_dir, struct dentry *old_dentry,
        return res;
 }
 
-struct file_operations hfs_dir_operations = {
+const struct file_operations hfs_dir_operations = {
        .read           = generic_read_dir,
        .readdir        = hfs_readdir,
        .llseek         = generic_file_llseek,