From 6b520e0565422966cdf1c3759bd73df77b0f248c Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 12 Dec 2011 15:51:45 -0500 Subject: vfs: fix the stupidity with i_dentry in inode destructors Seeing that just about every destructor got that INIT_LIST_HEAD() copied into it, there is no point whatsoever keeping this INIT_LIST_HEAD in inode_init_once(); the cost of taking it into inode_init_always() will be negligible for pipes and sockets and negative for everything else. Not to mention the removal of boilerplate code from ->destroy_inode() instances... Signed-off-by: Al Viro --- fs/hpfs/super.c | 1 - 1 file changed, 1 deletion(-) (limited to 'fs/hpfs/super.c') diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c index 98580a3b500..3690467c944 100644 --- a/fs/hpfs/super.c +++ b/fs/hpfs/super.c @@ -181,7 +181,6 @@ static struct inode *hpfs_alloc_inode(struct super_block *sb) static void hpfs_i_callback(struct rcu_head *head) { struct inode *inode = container_of(head, struct inode, i_rcu); - INIT_LIST_HEAD(&inode->i_dentry); kmem_cache_free(hpfs_inode_cachep, hpfs_i(inode)); } -- cgit v1.2.3 From 48fde701aff662559b38d9a609574068f22d00fe Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 8 Jan 2012 22:15:13 -0500 Subject: switch open-coded instances of d_make_root() to new helper Signed-off-by: Al Viro --- fs/hpfs/super.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'fs/hpfs/super.c') diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c index 3690467c944..54f6eccb79d 100644 --- a/fs/hpfs/super.c +++ b/fs/hpfs/super.c @@ -625,11 +625,9 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent) hpfs_init_inode(root); hpfs_read_inode(root); unlock_new_inode(root); - s->s_root = d_alloc_root(root); - if (!s->s_root) { - iput(root); + s->s_root = d_make_root(root); + if (!s->s_root) goto bail0; - } /* * find the root directory's . pointer & finish filling in the inode -- cgit v1.2.3 From de5e2b36289e6c81c3f7dcb9eef38d78de1f8b5c Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 13 Apr 2012 01:24:37 -0400 Subject: hpfs: endianness bugs a couple of le32 and le16 used with wrong le..._to_cpu(), plus idiotic use of le32_to_cpu() on 1-bit bitfield Signed-off-by: Al Viro --- fs/hpfs/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fs/hpfs/super.c') diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c index 54f6eccb79d..08e85b01913 100644 --- a/fs/hpfs/super.c +++ b/fs/hpfs/super.c @@ -572,7 +572,7 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent) mark_buffer_dirty(bh2); } - if (le32_to_cpu(spareblock->hotfixes_used) || le32_to_cpu(spareblock->n_spares_used)) { + if (spareblock->hotfixes_used || le32_to_cpu(spareblock->n_spares_used)) { if (errs >= 2) { printk("HPFS: Hotfixes not supported here, try chkdsk\n"); mark_dirty(s, 0); @@ -645,7 +645,7 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent) root->i_mtime.tv_nsec = 0; root->i_ctime.tv_sec = local_to_gmt(s, le32_to_cpu(de->creation_date)); root->i_ctime.tv_nsec = 0; - hpfs_i(root)->i_ea_size = le16_to_cpu(de->ea_size); + hpfs_i(root)->i_ea_size = le32_to_cpu(de->ea_size); hpfs_i(root)->i_parent_dir = root->i_ino; if (root->i_size == -1) root->i_size = 2048; -- cgit v1.2.3 From 28fe3c1963b0bafa56ec92df1987828090151d87 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 17 Apr 2012 16:41:13 -0400 Subject: hpfs: assorted endianness annotations Signed-off-by: Al Viro --- fs/hpfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/hpfs/super.c') diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c index 08e85b01913..706a12c083e 100644 --- a/fs/hpfs/super.c +++ b/fs/hpfs/super.c @@ -572,7 +572,7 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent) mark_buffer_dirty(bh2); } - if (spareblock->hotfixes_used || le32_to_cpu(spareblock->n_spares_used)) { + if (spareblock->hotfixes_used || spareblock->n_spares_used) { if (errs >= 2) { printk("HPFS: Hotfixes not supported here, try chkdsk\n"); mark_dirty(s, 0); -- cgit v1.2.3