diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-11-01 14:04:17 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-11-30 10:34:20 -0500 |
commit | 4f56110a00af5fb2e22fbccfcaf944d62cae8fcf (patch) | |
tree | 764e9b9e6b48637f6b3339496fa11e7047c37899 /fs/gfs2/ops_inode.c | |
parent | 2933f9254a6af33db25270778c998a42029da668 (diff) |
[GFS2] Shrink gfs2_inode (5) - di_nlink
Remove the di_nlink field in favour of inode->i_nlink and
update the nlink handling to use the proper macros. This
saves 4 bytes.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/ops_inode.c')
-rw-r--r-- | fs/gfs2/ops_inode.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c index efbcec3311bb..06176dee1550 100644 --- a/fs/gfs2/ops_inode.c +++ b/fs/gfs2/ops_inode.c | |||
@@ -169,7 +169,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir, | |||
169 | } | 169 | } |
170 | 170 | ||
171 | error = -EINVAL; | 171 | error = -EINVAL; |
172 | if (!dip->i_di.di_nlink) | 172 | if (!dip->i_inode.i_nlink) |
173 | goto out_gunlock; | 173 | goto out_gunlock; |
174 | error = -EFBIG; | 174 | error = -EFBIG; |
175 | if (dip->i_di.di_entries == (u32)-1) | 175 | if (dip->i_di.di_entries == (u32)-1) |
@@ -178,10 +178,10 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir, | |||
178 | if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) | 178 | if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) |
179 | goto out_gunlock; | 179 | goto out_gunlock; |
180 | error = -EINVAL; | 180 | error = -EINVAL; |
181 | if (!ip->i_di.di_nlink) | 181 | if (!ip->i_inode.i_nlink) |
182 | goto out_gunlock; | 182 | goto out_gunlock; |
183 | error = -EMLINK; | 183 | error = -EMLINK; |
184 | if (ip->i_di.di_nlink == (u32)-1) | 184 | if (ip->i_inode.i_nlink == (u32)-1) |
185 | goto out_gunlock; | 185 | goto out_gunlock; |
186 | 186 | ||
187 | alloc_required = error = gfs2_diradd_alloc_required(dir, &dentry->d_name); | 187 | alloc_required = error = gfs2_diradd_alloc_required(dir, &dentry->d_name); |
@@ -386,7 +386,7 @@ static int gfs2_mkdir(struct inode *dir, struct dentry *dentry, int mode) | |||
386 | 386 | ||
387 | ip = ghs[1].gh_gl->gl_object; | 387 | ip = ghs[1].gh_gl->gl_object; |
388 | 388 | ||
389 | ip->i_di.di_nlink = 2; | 389 | ip->i_inode.i_nlink = 2; |
390 | ip->i_di.di_size = sdp->sd_sb.sb_bsize - sizeof(struct gfs2_dinode); | 390 | ip->i_di.di_size = sdp->sd_sb.sb_bsize - sizeof(struct gfs2_dinode); |
391 | ip->i_di.di_flags |= GFS2_DIF_JDATA; | 391 | ip->i_di.di_flags |= GFS2_DIF_JDATA; |
392 | ip->i_di.di_payload_format = GFS2_FORMAT_DE; | 392 | ip->i_di.di_payload_format = GFS2_FORMAT_DE; |
@@ -636,7 +636,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry, | |||
636 | }; | 636 | }; |
637 | 637 | ||
638 | if (odip != ndip) { | 638 | if (odip != ndip) { |
639 | if (!ndip->i_di.di_nlink) { | 639 | if (!ndip->i_inode.i_nlink) { |
640 | error = -EINVAL; | 640 | error = -EINVAL; |
641 | goto out_gunlock; | 641 | goto out_gunlock; |
642 | } | 642 | } |
@@ -645,7 +645,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry, | |||
645 | goto out_gunlock; | 645 | goto out_gunlock; |
646 | } | 646 | } |
647 | if (S_ISDIR(ip->i_inode.i_mode) && | 647 | if (S_ISDIR(ip->i_inode.i_mode) && |
648 | ndip->i_di.di_nlink == (u32)-1) { | 648 | ndip->i_inode.i_nlink == (u32)-1) { |
649 | error = -EMLINK; | 649 | error = -EMLINK; |
650 | goto out_gunlock; | 650 | goto out_gunlock; |
651 | } | 651 | } |