hc
2024-09-20 a36159eec6ca17402b0e146b86efaf76568dc353
....@@ -11,12 +11,8 @@
1111 #include "xfs_shared.h"
1212 #include "xfs_trans_resv.h"
1313 #include "xfs_mount.h"
14
-#include "xfs_bmap_btree.h"
1514 #include "xfs_inode.h"
1615 #include "xfs_error.h"
17
-#include "xfs_trace.h"
18
-#include "xfs_symlink.h"
19
-#include "xfs_cksum.h"
2016 #include "xfs_trans.h"
2117 #include "xfs_buf_item.h"
2218 #include "xfs_log.h"
....@@ -90,12 +86,12 @@
9086 xfs_symlink_verify(
9187 struct xfs_buf *bp)
9288 {
93
- struct xfs_mount *mp = bp->b_target->bt_mount;
89
+ struct xfs_mount *mp = bp->b_mount;
9490 struct xfs_dsymlink_hdr *dsl = bp->b_addr;
9591
9692 if (!xfs_sb_version_hascrc(&mp->m_sb))
9793 return __this_address;
98
- if (dsl->sl_magic != cpu_to_be32(XFS_SYMLINK_MAGIC))
94
+ if (!xfs_verify_magic(bp, dsl->sl_magic))
9995 return __this_address;
10096 if (!uuid_equal(&dsl->sl_uuid, &mp->m_sb.sb_meta_uuid))
10197 return __this_address;
....@@ -116,7 +112,7 @@
116112 xfs_symlink_read_verify(
117113 struct xfs_buf *bp)
118114 {
119
- struct xfs_mount *mp = bp->b_target->bt_mount;
115
+ struct xfs_mount *mp = bp->b_mount;
120116 xfs_failaddr_t fa;
121117
122118 /* no verification of non-crc buffers */
....@@ -136,7 +132,7 @@
136132 xfs_symlink_write_verify(
137133 struct xfs_buf *bp)
138134 {
139
- struct xfs_mount *mp = bp->b_target->bt_mount;
135
+ struct xfs_mount *mp = bp->b_mount;
140136 struct xfs_buf_log_item *bip = bp->b_log_item;
141137 xfs_failaddr_t fa;
142138
....@@ -159,6 +155,7 @@
159155
160156 const struct xfs_buf_ops xfs_symlink_buf_ops = {
161157 .name = "xfs_symlink",
158
+ .magic = { 0, cpu_to_be32(XFS_SYMLINK_MAGIC) },
162159 .verify_read = xfs_symlink_read_verify,
163160 .verify_write = xfs_symlink_write_verify,
164161 .verify_struct = xfs_symlink_verify,
....@@ -207,16 +204,12 @@
207204 xfs_symlink_shortform_verify(
208205 struct xfs_inode *ip)
209206 {
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;
214211
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);
220213
221214 /*
222215 * Zero length symlinks should never occur in memory as they are