summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/meta_io.h
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-07-31 15:42:17 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-07-31 15:42:17 -0400
commit420b9e5e45d33355471c8d2d593bb0e5d6c77421 (patch)
tree7e5e76972606c0c597e0609e65b0478b15ae64c4 /fs/gfs2/meta_io.h
parentb1b934d31d8a608fe69fc56d6e539548b55b0601 (diff)
downloadlinux-420b9e5e45d33355471c8d2d593bb0e5d6c77421.tar.gz
linux-420b9e5e45d33355471c8d2d593bb0e5d6c77421.tar.bz2
linux-420b9e5e45d33355471c8d2d593bb0e5d6c77421.zip
[GFS2] Tidy up in various files
Tidy up some files and remove an unused routine in meta_io.h. Also added a bit of extra debugging in meta_io.h. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/meta_io.h')
-rw-r--r--fs/gfs2/meta_io.h23
1 files changed, 4 insertions, 19 deletions
diff --git a/fs/gfs2/meta_io.h b/fs/gfs2/meta_io.h
index 23c6a596fd9e..951814e86272 100644
--- a/fs/gfs2/meta_io.h
+++ b/fs/gfs2/meta_io.h
@@ -17,35 +17,20 @@ static inline void gfs2_buffer_clear(struct buffer_head *bh)
static inline void gfs2_buffer_clear_tail(struct buffer_head *bh, int head)
{
+ BUG_ON(head > bh->b_size);
memset(bh->b_data + head, 0, bh->b_size - head);
}
-static inline void gfs2_buffer_clear_ends(struct buffer_head *bh, int offset,
- int amount, int journaled)
-{
- int z_off1 = (journaled) ? sizeof(struct gfs2_meta_header) : 0;
- int z_len1 = offset - z_off1;
- int z_off2 = offset + amount;
- int z_len2 = (bh)->b_size - z_off2;
-
- if (z_len1)
- memset(bh->b_data + z_off1, 0, z_len1);
-
- if (z_len2)
- memset(bh->b_data + z_off2, 0, z_len2);
-}
-
static inline void gfs2_buffer_copy_tail(struct buffer_head *to_bh,
int to_head,
struct buffer_head *from_bh,
int from_head)
{
- memcpy(to_bh->b_data + to_head,
- from_bh->b_data + from_head,
+ BUG_ON(from_head < to_head);
+ memcpy(to_bh->b_data + to_head, from_bh->b_data + from_head,
from_bh->b_size - from_head);
memset(to_bh->b_data + to_bh->b_size + to_head - from_head,
- 0,
- from_head - to_head);
+ 0, from_head - to_head);
}
struct inode *gfs2_aspace_get(struct gfs2_sbd *sdp);