X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=fs%2Fhfs%2Fdir.c;h=7c69b98a2e45b679cc97b87e00247fa40442c2d8;hb=d3f9882cca84a7cb67a19bbc597356b49896b8c2;hp=e1f24befba58b282b9f2aa7af6a5b4628cf6533d;hpb=ddbf9ef385bfbef897210733abfb73cb9b94ecec;p=powerpc.git diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c index e1f24befba..7c69b98a2e 100644 --- a/fs/hfs/dir.c +++ b/fs/hfs/dir.c @@ -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,14 +313,14 @@ 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, .release = hfs_dir_release, }; -struct inode_operations hfs_dir_inode_operations = { +const struct inode_operations hfs_dir_inode_operations = { .create = hfs_create, .lookup = hfs_lookup, .unlink = hfs_unlink,