diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-07-31 15:42:17 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-07-31 15:42:17 -0400 |
commit | 420b9e5e45d33355471c8d2d593bb0e5d6c77421 (patch) | |
tree | 7e5e76972606c0c597e0609e65b0478b15ae64c4 /fs/gfs2/meta_io.h | |
parent | b1b934d31d8a608fe69fc56d6e539548b55b0601 (diff) |
[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.h | 23 |
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) | |||
17 | 17 | ||
18 | static inline void gfs2_buffer_clear_tail(struct buffer_head *bh, int head) | 18 | static inline void gfs2_buffer_clear_tail(struct buffer_head *bh, int head) |
19 | { | 19 | { |
20 | BUG_ON(head > bh->b_size); | ||
20 | memset(bh->b_data + head, 0, bh->b_size - head); | 21 | memset(bh->b_data + head, 0, bh->b_size - head); |
21 | } | 22 | } |
22 | 23 | ||
23 | static inline void gfs2_buffer_clear_ends(struct buffer_head *bh, int offset, | ||
24 | int amount, int journaled) | ||
25 | { | ||
26 | int z_off1 = (journaled) ? sizeof(struct gfs2_meta_header) : 0; | ||
27 | int z_len1 = offset - z_off1; | ||
28 | int z_off2 = offset + amount; | ||
29 | int z_len2 = (bh)->b_size - z_off2; | ||
30 | |||
31 | if (z_len1) | ||
32 | memset(bh->b_data + z_off1, 0, z_len1); | ||
33 | |||
34 | if (z_len2) | ||
35 | memset(bh->b_data + z_off2, 0, z_len2); | ||
36 | } | ||
37 | |||
38 | static inline void gfs2_buffer_copy_tail(struct buffer_head *to_bh, | 24 | static inline void gfs2_buffer_copy_tail(struct buffer_head *to_bh, |
39 | int to_head, | 25 | int to_head, |
40 | struct buffer_head *from_bh, | 26 | struct buffer_head *from_bh, |
41 | int from_head) | 27 | int from_head) |
42 | { | 28 | { |
43 | memcpy(to_bh->b_data + to_head, | 29 | BUG_ON(from_head < to_head); |
44 | from_bh->b_data + from_head, | 30 | memcpy(to_bh->b_data + to_head, from_bh->b_data + from_head, |
45 | from_bh->b_size - from_head); | 31 | from_bh->b_size - from_head); |
46 | memset(to_bh->b_data + to_bh->b_size + to_head - from_head, | 32 | memset(to_bh->b_data + to_bh->b_size + to_head - from_head, |
47 | 0, | 33 | 0, from_head - to_head); |
48 | from_head - to_head); | ||
49 | } | 34 | } |
50 | 35 | ||
51 | struct inode *gfs2_aspace_get(struct gfs2_sbd *sdp); | 36 | struct inode *gfs2_aspace_get(struct gfs2_sbd *sdp); |