cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: swhiteho@redhat.com <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 07/24] GFS2: Move di_eattr into "proper" inode
Date: Wed, 17 Dec 2008 11:30:06 +0000	[thread overview]
Message-ID: <1229513423-19105-8-git-send-email-swhiteho@redhat.com> (raw)
In-Reply-To: <1229513423-19105-7-git-send-email-swhiteho@redhat.com>

From: Steven Whitehouse <swhiteho@redhat.com>

This moves the di_eattr field out of gfs2_inode_host and
into the inode proper.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

diff --git a/fs/gfs2/acl.c b/fs/gfs2/acl.c
index 3e9bd46..e335dce 100644
--- a/fs/gfs2/acl.c
+++ b/fs/gfs2/acl.c
@@ -91,7 +91,7 @@ static int acl_get(struct gfs2_inode *ip, int access, struct posix_acl **acl,
 	struct gfs2_ea_location el_this;
 	int error;
 
-	if (!ip->i_di.di_eattr)
+	if (!ip->i_eattr)
 		return 0;
 
 	memset(&er, 0, sizeof(struct gfs2_ea_request));
diff --git a/fs/gfs2/eattr.c b/fs/gfs2/eattr.c
index e3f76f4..1c1e061 100644
--- a/fs/gfs2/eattr.c
+++ b/fs/gfs2/eattr.c
@@ -114,7 +114,7 @@ static int ea_foreach(struct gfs2_inode *ip, ea_call_t ea_call, void *data)
 	__be64 *eablk, *end;
 	int error;
 
-	error = gfs2_meta_read(ip->i_gl, ip->i_di.di_eattr, DIO_WAIT, &bh);
+	error = gfs2_meta_read(ip->i_gl, ip->i_eattr, DIO_WAIT, &bh);
 	if (error)
 		return error;
 
@@ -414,7 +414,7 @@ int gfs2_ea_list(struct gfs2_inode *ip, struct gfs2_ea_request *er)
 	if (error)
 		return error;
 
-	if (ip->i_di.di_eattr) {
+	if (ip->i_eattr) {
 		struct ea_list ei = { .ei_er = er, .ei_size = 0 };
 
 		error = ea_foreach(ip, ea_list_i, &ei);
@@ -514,7 +514,7 @@ int gfs2_ea_get_i(struct gfs2_inode *ip, struct gfs2_ea_request *er)
 	struct gfs2_ea_location el;
 	int error;
 
-	if (!ip->i_di.di_eattr)
+	if (!ip->i_eattr)
 		return -ENODATA;
 
 	error = gfs2_ea_find(ip, er, &el);
@@ -741,7 +741,7 @@ static int ea_init_i(struct gfs2_inode *ip, struct gfs2_ea_request *er,
 	if (error)
 		return error;
 
-	ip->i_di.di_eattr = bh->b_blocknr;
+	ip->i_eattr = bh->b_blocknr;
 	error = ea_write(ip, GFS2_EA_BH2FIRST(bh), er);
 
 	brelse(bh);
@@ -938,7 +938,7 @@ static int ea_set_block(struct gfs2_inode *ip, struct gfs2_ea_request *er,
 	if (ip->i_di.di_flags & GFS2_DIF_EA_INDIRECT) {
 		__be64 *end;
 
-		error = gfs2_meta_read(ip->i_gl, ip->i_di.di_eattr, DIO_WAIT,
+		error = gfs2_meta_read(ip->i_gl, ip->i_eattr, DIO_WAIT,
 				       &indbh);
 		if (error)
 			return error;
@@ -972,8 +972,8 @@ static int ea_set_block(struct gfs2_inode *ip, struct gfs2_ea_request *er,
 		gfs2_buffer_clear_tail(indbh, mh_size);
 
 		eablk = (__be64 *)(indbh->b_data + mh_size);
-		*eablk = cpu_to_be64(ip->i_di.di_eattr);
-		ip->i_di.di_eattr = blk;
+		*eablk = cpu_to_be64(ip->i_eattr);
+		ip->i_eattr = blk;
 		ip->i_di.di_flags |= GFS2_DIF_EA_INDIRECT;
 		gfs2_add_inode_blocks(&ip->i_inode, 1);
 
@@ -1040,7 +1040,7 @@ int gfs2_ea_set_i(struct gfs2_inode *ip, struct gfs2_ea_request *er)
 	struct gfs2_ea_location el;
 	int error;
 
-	if (!ip->i_di.di_eattr) {
+	if (!ip->i_eattr) {
 		if (er->er_flags & XATTR_REPLACE)
 			return -ENODATA;
 		return ea_init(ip, er);
@@ -1145,7 +1145,7 @@ int gfs2_ea_remove_i(struct gfs2_inode *ip, struct gfs2_ea_request *er)
 	struct gfs2_ea_location el;
 	int error;
 
-	if (!ip->i_di.di_eattr)
+	if (!ip->i_eattr)
 		return -ENODATA;
 
 	error = gfs2_ea_find(ip, er, &el);
@@ -1309,7 +1309,7 @@ static int ea_dealloc_indirect(struct gfs2_inode *ip)
 
 	memset(&rlist, 0, sizeof(struct gfs2_rgrp_list));
 
-	error = gfs2_meta_read(ip->i_gl, ip->i_di.di_eattr, DIO_WAIT, &indbh);
+	error = gfs2_meta_read(ip->i_gl, ip->i_eattr, DIO_WAIT, &indbh);
 	if (error)
 		return error;
 
@@ -1416,7 +1416,7 @@ static int ea_dealloc_block(struct gfs2_inode *ip)
 	struct buffer_head *dibh;
 	int error;
 
-	rgd = gfs2_blk2rgrpd(sdp, ip->i_di.di_eattr);
+	rgd = gfs2_blk2rgrpd(sdp, ip->i_eattr);
 	if (!rgd) {
 		gfs2_consist_inode(ip);
 		return -EIO;
@@ -1432,9 +1432,9 @@ static int ea_dealloc_block(struct gfs2_inode *ip)
 	if (error)
 		goto out_gunlock;
 
-	gfs2_free_meta(ip, ip->i_di.di_eattr, 1);
+	gfs2_free_meta(ip, ip->i_eattr, 1);
 
-	ip->i_di.di_eattr = 0;
+	ip->i_eattr = 0;
 	gfs2_add_inode_blocks(&ip->i_inode, -1);
 
 	error = gfs2_meta_inode_buffer(ip, &dibh);
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index 15ca3a7..fb2fd4a 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -236,7 +236,6 @@ enum {
 struct gfs2_dinode_host {
 	u64 di_size;		/* number of bytes in file */
 	u32 di_flags;		/* GFS2_DIF_... */
-	u64 di_eattr;		/* extended attribute block number */
 };
 
 struct gfs2_inode {
@@ -244,6 +243,7 @@ struct gfs2_inode {
 	u64 i_no_addr;
 	u64 i_no_formal_ino;
 	u64 i_generation;
+	u64 i_eattr;
 	unsigned long i_flags;		/* GIF_... */
 
 	struct gfs2_dinode_host i_di; /* To be replaced by ref to block */
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 30ffc88..7b1867e 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -301,7 +301,7 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf)
 	ip->i_depth = (u8)depth;
 	ip->i_entries = be32_to_cpu(str->di_entries);
 
-	di->di_eattr = be64_to_cpu(str->di_eattr);
+	ip->i_eattr = be64_to_cpu(str->di_eattr);
 	if (S_ISREG(ip->i_inode.i_mode))
 		gfs2_set_aops(&ip->i_inode);
 
@@ -1273,7 +1273,7 @@ void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf)
 	str->di_depth = cpu_to_be16(ip->i_depth);
 	str->di_entries = cpu_to_be32(ip->i_entries);
 
-	str->di_eattr = cpu_to_be64(di->di_eattr);
+	str->di_eattr = cpu_to_be64(ip->i_eattr);
 	str->di_atime_nsec = cpu_to_be32(ip->i_inode.i_atime.tv_nsec);
 	str->di_mtime_nsec = cpu_to_be32(ip->i_inode.i_mtime.tv_nsec);
 	str->di_ctime_nsec = cpu_to_be32(ip->i_inode.i_ctime.tv_nsec);
@@ -1296,7 +1296,7 @@ void gfs2_dinode_print(const struct gfs2_inode *ip)
 	printk(KERN_INFO "  i_height = %u\n", ip->i_height);
 	printk(KERN_INFO "  i_depth = %u\n", ip->i_depth);
 	printk(KERN_INFO "  i_entries = %u\n", ip->i_entries);
-	printk(KERN_INFO "  di_eattr = %llu\n",
-	       (unsigned long long)di->di_eattr);
+	printk(KERN_INFO "  i_eattr = %llu\n",
+	       (unsigned long long)ip->i_eattr);
 }
 
diff --git a/fs/gfs2/ops_super.c b/fs/gfs2/ops_super.c
index 2cb744b..aee6cba 100644
--- a/fs/gfs2/ops_super.c
+++ b/fs/gfs2/ops_super.c
@@ -502,7 +502,7 @@ static void gfs2_delete_inode(struct inode *inode)
 			goto out_unlock;
 	}
 
-	if (ip->i_di.di_eattr) {
+	if (ip->i_eattr) {
 		error = gfs2_ea_dealloc(ip);
 		if (error)
 			goto out_unlock;
-- 
1.6.0.3



  reply	other threads:[~2008-12-17 11:30 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-17 11:29 [Cluster-devel] GFS2: Pre-pull patch posting swhiteho
2008-12-17 11:30 ` [Cluster-devel] [PATCH 01/24] GFS2: Support for FIEMAP ioctl swhiteho
2008-12-17 11:30   ` [Cluster-devel] [PATCH 02/24] GFS2: Rationalise header files swhiteho
2008-12-17 11:30     ` [Cluster-devel] [PATCH 03/24] GFS2: Fix up jdata writepage/delete_inode swhiteho
2008-12-17 11:30       ` [Cluster-devel] [PATCH 04/24] GFS2: sparse annotation of gl->gl_spin swhiteho
2008-12-17 11:30         ` [Cluster-devel] [PATCH 05/24] GFS2: Move generation number into "proper" part of inode swhiteho
2008-12-17 11:30           ` [Cluster-devel] [PATCH 06/24] GFS2: Move "entries" into "proper" inode swhiteho
2008-12-17 11:30             ` swhiteho [this message]
2008-12-17 11:30               ` [Cluster-devel] [PATCH 08/24] GFS2: Move i_size from gfs2_dinode_host and rename it to i_disksize swhiteho
2008-12-17 11:30                 ` [Cluster-devel] [PATCH 09/24] GFS2: Banish struct gfs2_dinode_host swhiteho
2008-12-17 11:30                   ` [Cluster-devel] [PATCH 10/24] GFS2: Move rg_igeneration into struct gfs2_rgrpd swhiteho
2008-12-17 11:30                     ` [Cluster-devel] [PATCH 11/24] GFS2: Move rg_free from gfs2_rgrpd_host to gfs2_rgrpd swhiteho
2008-12-17 11:30                       ` [Cluster-devel] [PATCH 12/24] GFS2: Banish struct gfs2_rgrpd_host swhiteho
2008-12-17 11:30                         ` [Cluster-devel] [PATCH 13/24] GFS2: Add more detail to debugfs glock dumps swhiteho
2008-12-17 11:30                           ` [Cluster-devel] [PATCH 14/24] GFS2: Clean up & move gfs2_quotad swhiteho
2008-12-17 11:30                             ` [Cluster-devel] [PATCH 15/24] GFS2: Fix "truncate in progress" hang swhiteho
2008-12-17 11:30                               ` [Cluster-devel] [PATCH 16/24] GFS2: Move gfs2_recoverd into recovery.c swhiteho
2008-12-17 11:30                                 ` [Cluster-devel] [PATCH 17/24] GFS2: Kill two daemons with one patch swhiteho
2008-12-17 11:30                                   ` [Cluster-devel] [PATCH 18/24] GFS2: Send some sensible sysfs stuff swhiteho
2008-12-17 11:30                                     ` [Cluster-devel] [PATCH 19/24] GFS2: Fix bug in gfs2_lock_fs_check_clean() swhiteho
2008-12-17 11:30                                       ` [Cluster-devel] [PATCH 20/24] GFS2: Move four functions from super.c swhiteho
2008-12-17 11:30                                         ` [Cluster-devel] [PATCH 21/24] GFS2: Remove ancient, unused code swhiteho
2008-12-17 11:30                                           ` [Cluster-devel] [PATCH 22/24] GFS2: Fix use-after-free bug on umount swhiteho
2008-12-17 11:30                                             ` [Cluster-devel] [PATCH 23/24] GFS2: Send useful information with uevent messages swhiteho
2008-12-17 11:30                                               ` [Cluster-devel] [PATCH 24/24] GFS2: Streamline alloc calculations for writes swhiteho
2008-12-18  1:22   ` [Cluster-devel] Re: [PATCH 01/24] GFS2: Support for FIEMAP ioctl Andrew Morton
2008-12-18 10:29     ` Steven Whitehouse
2008-12-18 19:04       ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1229513423-19105-8-git-send-email-swhiteho@redhat.com \
    --to=swhiteho@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).