diff options
Diffstat (limited to 'fs/xfs/libxfs/xfs_ialloc.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_ialloc.c | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c index 1e5ed940b84d..c514fe98bbab 100644 --- a/fs/xfs/libxfs/xfs_ialloc.c +++ b/fs/xfs/libxfs/xfs_ialloc.c | |||
@@ -46,7 +46,7 @@ | |||
46 | /* | 46 | /* |
47 | * Allocation group level functions. | 47 | * Allocation group level functions. |
48 | */ | 48 | */ |
49 | static inline int | 49 | int |
50 | xfs_ialloc_cluster_alignment( | 50 | xfs_ialloc_cluster_alignment( |
51 | struct xfs_mount *mp) | 51 | struct xfs_mount *mp) |
52 | { | 52 | { |
@@ -98,24 +98,15 @@ xfs_inobt_update( | |||
98 | return xfs_btree_update(cur, &rec); | 98 | return xfs_btree_update(cur, &rec); |
99 | } | 99 | } |
100 | 100 | ||
101 | /* | 101 | /* Convert on-disk btree record to incore inobt record. */ |
102 | * Get the data from the pointed-to record. | 102 | void |
103 | */ | 103 | xfs_inobt_btrec_to_irec( |
104 | int /* error */ | 104 | struct xfs_mount *mp, |
105 | xfs_inobt_get_rec( | 105 | union xfs_btree_rec *rec, |
106 | struct xfs_btree_cur *cur, /* btree cursor */ | 106 | struct xfs_inobt_rec_incore *irec) |
107 | xfs_inobt_rec_incore_t *irec, /* btree record */ | ||
108 | int *stat) /* output: success/failure */ | ||
109 | { | 107 | { |
110 | union xfs_btree_rec *rec; | ||
111 | int error; | ||
112 | |||
113 | error = xfs_btree_get_rec(cur, &rec, stat); | ||
114 | if (error || *stat == 0) | ||
115 | return error; | ||
116 | |||
117 | irec->ir_startino = be32_to_cpu(rec->inobt.ir_startino); | 108 | irec->ir_startino = be32_to_cpu(rec->inobt.ir_startino); |
118 | if (xfs_sb_version_hassparseinodes(&cur->bc_mp->m_sb)) { | 109 | if (xfs_sb_version_hassparseinodes(&mp->m_sb)) { |
119 | irec->ir_holemask = be16_to_cpu(rec->inobt.ir_u.sp.ir_holemask); | 110 | irec->ir_holemask = be16_to_cpu(rec->inobt.ir_u.sp.ir_holemask); |
120 | irec->ir_count = rec->inobt.ir_u.sp.ir_count; | 111 | irec->ir_count = rec->inobt.ir_u.sp.ir_count; |
121 | irec->ir_freecount = rec->inobt.ir_u.sp.ir_freecount; | 112 | irec->ir_freecount = rec->inobt.ir_u.sp.ir_freecount; |
@@ -130,6 +121,25 @@ xfs_inobt_get_rec( | |||
130 | be32_to_cpu(rec->inobt.ir_u.f.ir_freecount); | 121 | be32_to_cpu(rec->inobt.ir_u.f.ir_freecount); |
131 | } | 122 | } |
132 | irec->ir_free = be64_to_cpu(rec->inobt.ir_free); | 123 | irec->ir_free = be64_to_cpu(rec->inobt.ir_free); |
124 | } | ||
125 | |||
126 | /* | ||
127 | * Get the data from the pointed-to record. | ||
128 | */ | ||
129 | int | ||
130 | xfs_inobt_get_rec( | ||
131 | struct xfs_btree_cur *cur, | ||
132 | struct xfs_inobt_rec_incore *irec, | ||
133 | int *stat) | ||
134 | { | ||
135 | union xfs_btree_rec *rec; | ||
136 | int error; | ||
137 | |||
138 | error = xfs_btree_get_rec(cur, &rec, stat); | ||
139 | if (error || *stat == 0) | ||
140 | return error; | ||
141 | |||
142 | xfs_inobt_btrec_to_irec(cur->bc_mp, rec, irec); | ||
133 | 143 | ||
134 | return 0; | 144 | return 0; |
135 | } | 145 | } |