.. | .. |
---|
11 | 11 | #include "xfs_shared.h" |
---|
12 | 12 | #include "xfs_trans_resv.h" |
---|
13 | 13 | #include "xfs_mount.h" |
---|
14 | | -#include "xfs_bmap_btree.h" |
---|
15 | 14 | #include "xfs_inode.h" |
---|
16 | 15 | #include "xfs_error.h" |
---|
17 | | -#include "xfs_trace.h" |
---|
18 | | -#include "xfs_symlink.h" |
---|
19 | | -#include "xfs_cksum.h" |
---|
20 | 16 | #include "xfs_trans.h" |
---|
21 | 17 | #include "xfs_buf_item.h" |
---|
22 | 18 | #include "xfs_log.h" |
---|
.. | .. |
---|
90 | 86 | xfs_symlink_verify( |
---|
91 | 87 | struct xfs_buf *bp) |
---|
92 | 88 | { |
---|
93 | | - struct xfs_mount *mp = bp->b_target->bt_mount; |
---|
| 89 | + struct xfs_mount *mp = bp->b_mount; |
---|
94 | 90 | struct xfs_dsymlink_hdr *dsl = bp->b_addr; |
---|
95 | 91 | |
---|
96 | 92 | if (!xfs_sb_version_hascrc(&mp->m_sb)) |
---|
97 | 93 | return __this_address; |
---|
98 | | - if (dsl->sl_magic != cpu_to_be32(XFS_SYMLINK_MAGIC)) |
---|
| 94 | + if (!xfs_verify_magic(bp, dsl->sl_magic)) |
---|
99 | 95 | return __this_address; |
---|
100 | 96 | if (!uuid_equal(&dsl->sl_uuid, &mp->m_sb.sb_meta_uuid)) |
---|
101 | 97 | return __this_address; |
---|
.. | .. |
---|
116 | 112 | xfs_symlink_read_verify( |
---|
117 | 113 | struct xfs_buf *bp) |
---|
118 | 114 | { |
---|
119 | | - struct xfs_mount *mp = bp->b_target->bt_mount; |
---|
| 115 | + struct xfs_mount *mp = bp->b_mount; |
---|
120 | 116 | xfs_failaddr_t fa; |
---|
121 | 117 | |
---|
122 | 118 | /* no verification of non-crc buffers */ |
---|
.. | .. |
---|
136 | 132 | xfs_symlink_write_verify( |
---|
137 | 133 | struct xfs_buf *bp) |
---|
138 | 134 | { |
---|
139 | | - struct xfs_mount *mp = bp->b_target->bt_mount; |
---|
| 135 | + struct xfs_mount *mp = bp->b_mount; |
---|
140 | 136 | struct xfs_buf_log_item *bip = bp->b_log_item; |
---|
141 | 137 | xfs_failaddr_t fa; |
---|
142 | 138 | |
---|
.. | .. |
---|
159 | 155 | |
---|
160 | 156 | const struct xfs_buf_ops xfs_symlink_buf_ops = { |
---|
161 | 157 | .name = "xfs_symlink", |
---|
| 158 | + .magic = { 0, cpu_to_be32(XFS_SYMLINK_MAGIC) }, |
---|
162 | 159 | .verify_read = xfs_symlink_read_verify, |
---|
163 | 160 | .verify_write = xfs_symlink_write_verify, |
---|
164 | 161 | .verify_struct = xfs_symlink_verify, |
---|
.. | .. |
---|
207 | 204 | xfs_symlink_shortform_verify( |
---|
208 | 205 | struct xfs_inode *ip) |
---|
209 | 206 | { |
---|
210 | | - char *sfp; |
---|
211 | | - char *endp; |
---|
212 | | - struct xfs_ifork *ifp; |
---|
213 | | - int size; |
---|
| 207 | + struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK); |
---|
| 208 | + char *sfp = (char *)ifp->if_u1.if_data; |
---|
| 209 | + int size = ifp->if_bytes; |
---|
| 210 | + char *endp = sfp + size; |
---|
214 | 211 | |
---|
215 | | - ASSERT(ip->i_d.di_format == XFS_DINODE_FMT_LOCAL); |
---|
216 | | - ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK); |
---|
217 | | - sfp = (char *)ifp->if_u1.if_data; |
---|
218 | | - size = ifp->if_bytes; |
---|
219 | | - endp = sfp + size; |
---|
| 212 | + ASSERT(ifp->if_format == XFS_DINODE_FMT_LOCAL); |
---|
220 | 213 | |
---|
221 | 214 | /* |
---|
222 | 215 | * Zero length symlinks should never occur in memory as they are |
---|