Skip to content

Commit

Permalink
GFS2: Move di_eattr into "proper" inode
Browse files Browse the repository at this point in the history
This moves the di_eattr field out of gfs2_inode_host and
into the inode proper.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
  • Loading branch information
Steven Whitehouse committed Jan 5, 2009
1 parent ad6203f commit 3767ac2
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion fs/gfs2/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
26 changes: 13 additions & 13 deletions fs/gfs2/eattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion fs/gfs2/incore.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,14 @@ 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 {
struct inode i_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 */
Expand Down
8 changes: 4 additions & 4 deletions fs/gfs2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand All @@ -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);
}

2 changes: 1 addition & 1 deletion fs/gfs2/ops_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3767ac2

Please sign in to comment.