diff options
Diffstat (limited to 'fs/hpfs')
-rw-r--r-- | fs/hpfs/alloc.c | 66 | ||||
-rw-r--r-- | fs/hpfs/buffer.c | 96 | ||||
-rw-r--r-- | fs/hpfs/hpfs_fn.h | 2 | ||||
-rw-r--r-- | fs/hpfs/super.c | 29 |
4 files changed, 137 insertions, 56 deletions
diff --git a/fs/hpfs/alloc.c b/fs/hpfs/alloc.c index cdb84a838068..58b5106186d0 100644 --- a/fs/hpfs/alloc.c +++ b/fs/hpfs/alloc.c | |||
@@ -8,6 +8,58 @@ | |||
8 | 8 | ||
9 | #include "hpfs_fn.h" | 9 | #include "hpfs_fn.h" |
10 | 10 | ||
11 | static void hpfs_claim_alloc(struct super_block *s, secno sec) | ||
12 | { | ||
13 | struct hpfs_sb_info *sbi = hpfs_sb(s); | ||
14 | if (sbi->sb_n_free != (unsigned)-1) { | ||
15 | if (unlikely(!sbi->sb_n_free)) { | ||
16 | hpfs_error(s, "free count underflow, allocating sector %08x", sec); | ||
17 | sbi->sb_n_free = -1; | ||
18 | return; | ||
19 | } | ||
20 | sbi->sb_n_free--; | ||
21 | } | ||
22 | } | ||
23 | |||
24 | static void hpfs_claim_free(struct super_block *s, secno sec) | ||
25 | { | ||
26 | struct hpfs_sb_info *sbi = hpfs_sb(s); | ||
27 | if (sbi->sb_n_free != (unsigned)-1) { | ||
28 | if (unlikely(sbi->sb_n_free >= sbi->sb_fs_size)) { | ||
29 | hpfs_error(s, "free count overflow, freeing sector %08x", sec); | ||
30 | sbi->sb_n_free = -1; | ||
31 | return; | ||
32 | } | ||
33 | sbi->sb_n_free++; | ||
34 | } | ||
35 | } | ||
36 | |||
37 | static void hpfs_claim_dirband_alloc(struct super_block *s, secno sec) | ||
38 | { | ||
39 | struct hpfs_sb_info *sbi = hpfs_sb(s); | ||
40 | if (sbi->sb_n_free_dnodes != (unsigned)-1) { | ||
41 | if (unlikely(!sbi->sb_n_free_dnodes)) { | ||
42 | hpfs_error(s, "dirband free count underflow, allocating sector %08x", sec); | ||
43 | sbi->sb_n_free_dnodes = -1; | ||
44 | return; | ||
45 | } | ||
46 | sbi->sb_n_free_dnodes--; | ||
47 | } | ||
48 | } | ||
49 | |||
50 | static void hpfs_claim_dirband_free(struct super_block *s, secno sec) | ||
51 | { | ||
52 | struct hpfs_sb_info *sbi = hpfs_sb(s); | ||
53 | if (sbi->sb_n_free_dnodes != (unsigned)-1) { | ||
54 | if (unlikely(sbi->sb_n_free_dnodes >= sbi->sb_dirband_size / 4)) { | ||
55 | hpfs_error(s, "dirband free count overflow, freeing sector %08x", sec); | ||
56 | sbi->sb_n_free_dnodes = -1; | ||
57 | return; | ||
58 | } | ||
59 | sbi->sb_n_free_dnodes++; | ||
60 | } | ||
61 | } | ||
62 | |||
11 | /* | 63 | /* |
12 | * Check if a sector is allocated in bitmap | 64 | * Check if a sector is allocated in bitmap |
13 | * This is really slow. Turned on only if chk==2 | 65 | * This is really slow. Turned on only if chk==2 |
@@ -203,9 +255,15 @@ secno hpfs_alloc_sector(struct super_block *s, secno near, unsigned n, int forwa | |||
203 | } | 255 | } |
204 | sec = 0; | 256 | sec = 0; |
205 | ret: | 257 | ret: |
258 | if (sec) { | ||
259 | i = 0; | ||
260 | do | ||
261 | hpfs_claim_alloc(s, sec + i); | ||
262 | while (unlikely(++i < n)); | ||
263 | } | ||
206 | if (sec && f_p) { | 264 | if (sec && f_p) { |
207 | for (i = 0; i < forward; i++) { | 265 | for (i = 0; i < forward; i++) { |
208 | if (!hpfs_alloc_if_possible(s, sec + i + 1)) { | 266 | if (!hpfs_alloc_if_possible(s, sec + n + i)) { |
209 | hpfs_error(s, "Prealloc doesn't work! Wanted %d, allocated at %08x, can't allocate %d", forward, sec, i); | 267 | hpfs_error(s, "Prealloc doesn't work! Wanted %d, allocated at %08x, can't allocate %d", forward, sec, i); |
210 | sec = 0; | 268 | sec = 0; |
211 | break; | 269 | break; |
@@ -228,6 +286,7 @@ static secno alloc_in_dirband(struct super_block *s, secno near) | |||
228 | nr >>= 2; | 286 | nr >>= 2; |
229 | sec = alloc_in_bmp(s, (~0x3fff) | nr, 1, 0); | 287 | sec = alloc_in_bmp(s, (~0x3fff) | nr, 1, 0); |
230 | if (!sec) return 0; | 288 | if (!sec) return 0; |
289 | hpfs_claim_dirband_alloc(s, sec); | ||
231 | return ((sec & 0x3fff) << 2) + sbi->sb_dirband_start; | 290 | return ((sec & 0x3fff) << 2) + sbi->sb_dirband_start; |
232 | } | 291 | } |
233 | 292 | ||
@@ -242,6 +301,7 @@ int hpfs_alloc_if_possible(struct super_block *s, secno sec) | |||
242 | bmp[(sec & 0x3fff) >> 5] &= cpu_to_le32(~(1 << (sec & 0x1f))); | 301 | bmp[(sec & 0x3fff) >> 5] &= cpu_to_le32(~(1 << (sec & 0x1f))); |
243 | hpfs_mark_4buffers_dirty(&qbh); | 302 | hpfs_mark_4buffers_dirty(&qbh); |
244 | hpfs_brelse4(&qbh); | 303 | hpfs_brelse4(&qbh); |
304 | hpfs_claim_alloc(s, sec); | ||
245 | return 1; | 305 | return 1; |
246 | } | 306 | } |
247 | hpfs_brelse4(&qbh); | 307 | hpfs_brelse4(&qbh); |
@@ -275,6 +335,7 @@ void hpfs_free_sectors(struct super_block *s, secno sec, unsigned n) | |||
275 | return; | 335 | return; |
276 | } | 336 | } |
277 | bmp[(sec & 0x3fff) >> 5] |= cpu_to_le32(1 << (sec & 0x1f)); | 337 | bmp[(sec & 0x3fff) >> 5] |= cpu_to_le32(1 << (sec & 0x1f)); |
338 | hpfs_claim_free(s, sec); | ||
278 | if (!--n) { | 339 | if (!--n) { |
279 | hpfs_mark_4buffers_dirty(&qbh); | 340 | hpfs_mark_4buffers_dirty(&qbh); |
280 | hpfs_brelse4(&qbh); | 341 | hpfs_brelse4(&qbh); |
@@ -359,6 +420,7 @@ void hpfs_free_dnode(struct super_block *s, dnode_secno dno) | |||
359 | bmp[ssec >> 5] |= cpu_to_le32(1 << (ssec & 0x1f)); | 420 | bmp[ssec >> 5] |= cpu_to_le32(1 << (ssec & 0x1f)); |
360 | hpfs_mark_4buffers_dirty(&qbh); | 421 | hpfs_mark_4buffers_dirty(&qbh); |
361 | hpfs_brelse4(&qbh); | 422 | hpfs_brelse4(&qbh); |
423 | hpfs_claim_dirband_free(s, dno); | ||
362 | } | 424 | } |
363 | } | 425 | } |
364 | 426 | ||
@@ -366,7 +428,7 @@ struct dnode *hpfs_alloc_dnode(struct super_block *s, secno near, | |||
366 | dnode_secno *dno, struct quad_buffer_head *qbh) | 428 | dnode_secno *dno, struct quad_buffer_head *qbh) |
367 | { | 429 | { |
368 | struct dnode *d; | 430 | struct dnode *d; |
369 | if (hpfs_count_one_bitmap(s, hpfs_sb(s)->sb_dmap) > FREE_DNODES_ADD) { | 431 | if (hpfs_get_free_dnodes(s) > FREE_DNODES_ADD) { |
370 | if (!(*dno = alloc_in_dirband(s, near))) | 432 | if (!(*dno = alloc_in_dirband(s, near))) |
371 | if (!(*dno = hpfs_alloc_sector(s, near, 4, 0))) return NULL; | 433 | if (!(*dno = hpfs_alloc_sector(s, near, 4, 0))) return NULL; |
372 | } else { | 434 | } else { |
diff --git a/fs/hpfs/buffer.c b/fs/hpfs/buffer.c index 4d0a1afa058c..139ef1684d07 100644 --- a/fs/hpfs/buffer.c +++ b/fs/hpfs/buffer.c | |||
@@ -86,7 +86,6 @@ void *hpfs_get_sector(struct super_block *s, unsigned secno, struct buffer_head | |||
86 | void *hpfs_map_4sectors(struct super_block *s, unsigned secno, struct quad_buffer_head *qbh, | 86 | void *hpfs_map_4sectors(struct super_block *s, unsigned secno, struct quad_buffer_head *qbh, |
87 | int ahead) | 87 | int ahead) |
88 | { | 88 | { |
89 | struct buffer_head *bh; | ||
90 | char *data; | 89 | char *data; |
91 | 90 | ||
92 | hpfs_lock_assert(s); | 91 | hpfs_lock_assert(s); |
@@ -100,34 +99,32 @@ void *hpfs_map_4sectors(struct super_block *s, unsigned secno, struct quad_buffe | |||
100 | 99 | ||
101 | hpfs_prefetch_sectors(s, secno, 4 + ahead); | 100 | hpfs_prefetch_sectors(s, secno, 4 + ahead); |
102 | 101 | ||
102 | if (!(qbh->bh[0] = sb_bread(s, secno + 0))) goto bail0; | ||
103 | if (!(qbh->bh[1] = sb_bread(s, secno + 1))) goto bail1; | ||
104 | if (!(qbh->bh[2] = sb_bread(s, secno + 2))) goto bail2; | ||
105 | if (!(qbh->bh[3] = sb_bread(s, secno + 3))) goto bail3; | ||
106 | |||
107 | if (likely(qbh->bh[1]->b_data == qbh->bh[0]->b_data + 1 * 512) && | ||
108 | likely(qbh->bh[2]->b_data == qbh->bh[0]->b_data + 2 * 512) && | ||
109 | likely(qbh->bh[3]->b_data == qbh->bh[0]->b_data + 3 * 512)) { | ||
110 | return qbh->data = qbh->bh[0]->b_data; | ||
111 | } | ||
112 | |||
103 | qbh->data = data = kmalloc(2048, GFP_NOFS); | 113 | qbh->data = data = kmalloc(2048, GFP_NOFS); |
104 | if (!data) { | 114 | if (!data) { |
105 | printk("HPFS: hpfs_map_4sectors: out of memory\n"); | 115 | printk("HPFS: hpfs_map_4sectors: out of memory\n"); |
106 | goto bail; | 116 | goto bail4; |
107 | } | 117 | } |
108 | 118 | ||
109 | qbh->bh[0] = bh = sb_bread(s, secno); | 119 | memcpy(data + 0 * 512, qbh->bh[0]->b_data, 512); |
110 | if (!bh) | 120 | memcpy(data + 1 * 512, qbh->bh[1]->b_data, 512); |
111 | goto bail0; | 121 | memcpy(data + 2 * 512, qbh->bh[2]->b_data, 512); |
112 | memcpy(data, bh->b_data, 512); | 122 | memcpy(data + 3 * 512, qbh->bh[3]->b_data, 512); |
113 | |||
114 | qbh->bh[1] = bh = sb_bread(s, secno + 1); | ||
115 | if (!bh) | ||
116 | goto bail1; | ||
117 | memcpy(data + 512, bh->b_data, 512); | ||
118 | |||
119 | qbh->bh[2] = bh = sb_bread(s, secno + 2); | ||
120 | if (!bh) | ||
121 | goto bail2; | ||
122 | memcpy(data + 2 * 512, bh->b_data, 512); | ||
123 | |||
124 | qbh->bh[3] = bh = sb_bread(s, secno + 3); | ||
125 | if (!bh) | ||
126 | goto bail3; | ||
127 | memcpy(data + 3 * 512, bh->b_data, 512); | ||
128 | 123 | ||
129 | return data; | 124 | return data; |
130 | 125 | ||
126 | bail4: | ||
127 | brelse(qbh->bh[3]); | ||
131 | bail3: | 128 | bail3: |
132 | brelse(qbh->bh[2]); | 129 | brelse(qbh->bh[2]); |
133 | bail2: | 130 | bail2: |
@@ -135,9 +132,6 @@ void *hpfs_map_4sectors(struct super_block *s, unsigned secno, struct quad_buffe | |||
135 | bail1: | 132 | bail1: |
136 | brelse(qbh->bh[0]); | 133 | brelse(qbh->bh[0]); |
137 | bail0: | 134 | bail0: |
138 | kfree(data); | ||
139 | printk("HPFS: hpfs_map_4sectors: read error\n"); | ||
140 | bail: | ||
141 | return NULL; | 135 | return NULL; |
142 | } | 136 | } |
143 | 137 | ||
@@ -155,44 +149,54 @@ void *hpfs_get_4sectors(struct super_block *s, unsigned secno, | |||
155 | return NULL; | 149 | return NULL; |
156 | } | 150 | } |
157 | 151 | ||
158 | /*return hpfs_map_4sectors(s, secno, qbh, 0);*/ | 152 | if (!hpfs_get_sector(s, secno + 0, &qbh->bh[0])) goto bail0; |
153 | if (!hpfs_get_sector(s, secno + 1, &qbh->bh[1])) goto bail1; | ||
154 | if (!hpfs_get_sector(s, secno + 2, &qbh->bh[2])) goto bail2; | ||
155 | if (!hpfs_get_sector(s, secno + 3, &qbh->bh[3])) goto bail3; | ||
156 | |||
157 | if (likely(qbh->bh[1]->b_data == qbh->bh[0]->b_data + 1 * 512) && | ||
158 | likely(qbh->bh[2]->b_data == qbh->bh[0]->b_data + 2 * 512) && | ||
159 | likely(qbh->bh[3]->b_data == qbh->bh[0]->b_data + 3 * 512)) { | ||
160 | return qbh->data = qbh->bh[0]->b_data; | ||
161 | } | ||
162 | |||
159 | if (!(qbh->data = kmalloc(2048, GFP_NOFS))) { | 163 | if (!(qbh->data = kmalloc(2048, GFP_NOFS))) { |
160 | printk("HPFS: hpfs_get_4sectors: out of memory\n"); | 164 | printk("HPFS: hpfs_get_4sectors: out of memory\n"); |
161 | return NULL; | 165 | goto bail4; |
162 | } | 166 | } |
163 | if (!(hpfs_get_sector(s, secno, &qbh->bh[0]))) goto bail0; | ||
164 | if (!(hpfs_get_sector(s, secno + 1, &qbh->bh[1]))) goto bail1; | ||
165 | if (!(hpfs_get_sector(s, secno + 2, &qbh->bh[2]))) goto bail2; | ||
166 | if (!(hpfs_get_sector(s, secno + 3, &qbh->bh[3]))) goto bail3; | ||
167 | memcpy(qbh->data, qbh->bh[0]->b_data, 512); | ||
168 | memcpy(qbh->data + 512, qbh->bh[1]->b_data, 512); | ||
169 | memcpy(qbh->data + 2*512, qbh->bh[2]->b_data, 512); | ||
170 | memcpy(qbh->data + 3*512, qbh->bh[3]->b_data, 512); | ||
171 | return qbh->data; | 167 | return qbh->data; |
172 | 168 | ||
173 | bail3: brelse(qbh->bh[2]); | 169 | bail4: |
174 | bail2: brelse(qbh->bh[1]); | 170 | brelse(qbh->bh[3]); |
175 | bail1: brelse(qbh->bh[0]); | 171 | bail3: |
176 | bail0: | 172 | brelse(qbh->bh[2]); |
173 | bail2: | ||
174 | brelse(qbh->bh[1]); | ||
175 | bail1: | ||
176 | brelse(qbh->bh[0]); | ||
177 | bail0: | ||
177 | return NULL; | 178 | return NULL; |
178 | } | 179 | } |
179 | 180 | ||
180 | 181 | ||
181 | void hpfs_brelse4(struct quad_buffer_head *qbh) | 182 | void hpfs_brelse4(struct quad_buffer_head *qbh) |
182 | { | 183 | { |
183 | brelse(qbh->bh[3]); | 184 | if (unlikely(qbh->data != qbh->bh[0]->b_data)) |
184 | brelse(qbh->bh[2]); | 185 | kfree(qbh->data); |
185 | brelse(qbh->bh[1]); | ||
186 | brelse(qbh->bh[0]); | 186 | brelse(qbh->bh[0]); |
187 | kfree(qbh->data); | 187 | brelse(qbh->bh[1]); |
188 | brelse(qbh->bh[2]); | ||
189 | brelse(qbh->bh[3]); | ||
188 | } | 190 | } |
189 | 191 | ||
190 | void hpfs_mark_4buffers_dirty(struct quad_buffer_head *qbh) | 192 | void hpfs_mark_4buffers_dirty(struct quad_buffer_head *qbh) |
191 | { | 193 | { |
192 | memcpy(qbh->bh[0]->b_data, qbh->data, 512); | 194 | if (unlikely(qbh->data != qbh->bh[0]->b_data)) { |
193 | memcpy(qbh->bh[1]->b_data, qbh->data + 512, 512); | 195 | memcpy(qbh->bh[0]->b_data, qbh->data + 0 * 512, 512); |
194 | memcpy(qbh->bh[2]->b_data, qbh->data + 2 * 512, 512); | 196 | memcpy(qbh->bh[1]->b_data, qbh->data + 1 * 512, 512); |
195 | memcpy(qbh->bh[3]->b_data, qbh->data + 3 * 512, 512); | 197 | memcpy(qbh->bh[2]->b_data, qbh->data + 2 * 512, 512); |
198 | memcpy(qbh->bh[3]->b_data, qbh->data + 3 * 512, 512); | ||
199 | } | ||
196 | mark_buffer_dirty(qbh->bh[0]); | 200 | mark_buffer_dirty(qbh->bh[0]); |
197 | mark_buffer_dirty(qbh->bh[1]); | 201 | mark_buffer_dirty(qbh->bh[1]); |
198 | mark_buffer_dirty(qbh->bh[2]); | 202 | mark_buffer_dirty(qbh->bh[2]); |
diff --git a/fs/hpfs/hpfs_fn.h b/fs/hpfs/hpfs_fn.h index 6797bf80f6e2..3ba49c080e42 100644 --- a/fs/hpfs/hpfs_fn.h +++ b/fs/hpfs/hpfs_fn.h | |||
@@ -312,7 +312,7 @@ static inline struct hpfs_sb_info *hpfs_sb(struct super_block *sb) | |||
312 | __printf(2, 3) | 312 | __printf(2, 3) |
313 | void hpfs_error(struct super_block *, const char *, ...); | 313 | void hpfs_error(struct super_block *, const char *, ...); |
314 | int hpfs_stop_cycles(struct super_block *, int, int *, int *, char *); | 314 | int hpfs_stop_cycles(struct super_block *, int, int *, int *, char *); |
315 | unsigned hpfs_count_one_bitmap(struct super_block *, secno); | 315 | unsigned hpfs_get_free_dnodes(struct super_block *); |
316 | 316 | ||
317 | /* | 317 | /* |
318 | * local time (HPFS) to GMT (Unix) | 318 | * local time (HPFS) to GMT (Unix) |
diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c index b8d01ef6f531..4534ff688b76 100644 --- a/fs/hpfs/super.c +++ b/fs/hpfs/super.c | |||
@@ -121,7 +121,7 @@ static void hpfs_put_super(struct super_block *s) | |||
121 | call_rcu(&hpfs_sb(s)->rcu, lazy_free_sbi); | 121 | call_rcu(&hpfs_sb(s)->rcu, lazy_free_sbi); |
122 | } | 122 | } |
123 | 123 | ||
124 | unsigned hpfs_count_one_bitmap(struct super_block *s, secno secno) | 124 | static unsigned hpfs_count_one_bitmap(struct super_block *s, secno secno) |
125 | { | 125 | { |
126 | struct quad_buffer_head qbh; | 126 | struct quad_buffer_head qbh; |
127 | unsigned long *bits; | 127 | unsigned long *bits; |
@@ -129,7 +129,7 @@ unsigned hpfs_count_one_bitmap(struct super_block *s, secno secno) | |||
129 | 129 | ||
130 | bits = hpfs_map_4sectors(s, secno, &qbh, 0); | 130 | bits = hpfs_map_4sectors(s, secno, &qbh, 0); |
131 | if (!bits) | 131 | if (!bits) |
132 | return 0; | 132 | return (unsigned)-1; |
133 | count = bitmap_weight(bits, 2048 * BITS_PER_BYTE); | 133 | count = bitmap_weight(bits, 2048 * BITS_PER_BYTE); |
134 | hpfs_brelse4(&qbh); | 134 | hpfs_brelse4(&qbh); |
135 | return count; | 135 | return count; |
@@ -144,30 +144,45 @@ static unsigned count_bitmaps(struct super_block *s) | |||
144 | hpfs_prefetch_bitmap(s, n); | 144 | hpfs_prefetch_bitmap(s, n); |
145 | } | 145 | } |
146 | for (n = 0; n < n_bands; n++) { | 146 | for (n = 0; n < n_bands; n++) { |
147 | unsigned c; | ||
147 | hpfs_prefetch_bitmap(s, n + COUNT_RD_AHEAD); | 148 | hpfs_prefetch_bitmap(s, n + COUNT_RD_AHEAD); |
148 | count += hpfs_count_one_bitmap(s, le32_to_cpu(hpfs_sb(s)->sb_bmp_dir[n])); | 149 | c = hpfs_count_one_bitmap(s, le32_to_cpu(hpfs_sb(s)->sb_bmp_dir[n])); |
150 | if (c != (unsigned)-1) | ||
151 | count += c; | ||
149 | } | 152 | } |
150 | return count; | 153 | return count; |
151 | } | 154 | } |
152 | 155 | ||
156 | unsigned hpfs_get_free_dnodes(struct super_block *s) | ||
157 | { | ||
158 | struct hpfs_sb_info *sbi = hpfs_sb(s); | ||
159 | if (sbi->sb_n_free_dnodes == (unsigned)-1) { | ||
160 | unsigned c = hpfs_count_one_bitmap(s, sbi->sb_dmap); | ||
161 | if (c == (unsigned)-1) | ||
162 | return 0; | ||
163 | sbi->sb_n_free_dnodes = c; | ||
164 | } | ||
165 | return sbi->sb_n_free_dnodes; | ||
166 | } | ||
167 | |||
153 | static int hpfs_statfs(struct dentry *dentry, struct kstatfs *buf) | 168 | static int hpfs_statfs(struct dentry *dentry, struct kstatfs *buf) |
154 | { | 169 | { |
155 | struct super_block *s = dentry->d_sb; | 170 | struct super_block *s = dentry->d_sb; |
156 | struct hpfs_sb_info *sbi = hpfs_sb(s); | 171 | struct hpfs_sb_info *sbi = hpfs_sb(s); |
157 | u64 id = huge_encode_dev(s->s_bdev->bd_dev); | 172 | u64 id = huge_encode_dev(s->s_bdev->bd_dev); |
173 | |||
158 | hpfs_lock(s); | 174 | hpfs_lock(s); |
159 | 175 | ||
160 | /*if (sbi->sb_n_free == -1) {*/ | 176 | if (sbi->sb_n_free == (unsigned)-1) |
161 | sbi->sb_n_free = count_bitmaps(s); | 177 | sbi->sb_n_free = count_bitmaps(s); |
162 | sbi->sb_n_free_dnodes = hpfs_count_one_bitmap(s, sbi->sb_dmap); | 178 | |
163 | /*}*/ | ||
164 | buf->f_type = s->s_magic; | 179 | buf->f_type = s->s_magic; |
165 | buf->f_bsize = 512; | 180 | buf->f_bsize = 512; |
166 | buf->f_blocks = sbi->sb_fs_size; | 181 | buf->f_blocks = sbi->sb_fs_size; |
167 | buf->f_bfree = sbi->sb_n_free; | 182 | buf->f_bfree = sbi->sb_n_free; |
168 | buf->f_bavail = sbi->sb_n_free; | 183 | buf->f_bavail = sbi->sb_n_free; |
169 | buf->f_files = sbi->sb_dirband_size / 4; | 184 | buf->f_files = sbi->sb_dirband_size / 4; |
170 | buf->f_ffree = sbi->sb_n_free_dnodes; | 185 | buf->f_ffree = hpfs_get_free_dnodes(s); |
171 | buf->f_fsid.val[0] = (u32)id; | 186 | buf->f_fsid.val[0] = (u32)id; |
172 | buf->f_fsid.val[1] = (u32)(id >> 32); | 187 | buf->f_fsid.val[1] = (u32)(id >> 32); |
173 | buf->f_namelen = 254; | 188 | buf->f_namelen = 254; |