Lines Matching +full:full +full:- +full:size
1 // SPDX-License-Identifier: GPL-2.0
19 int hfsplus_block_allocate(struct super_block *sb, u32 size,
32 return size;
34 hfs_dbg(BITMAP, "block_allocate: %u,%u,%u\n", size, offset, len);
35 mutex_lock(&sbi->alloc_mutex);
36 mapping = sbi->alloc_file->i_mapping;
39 start = size;
43 curr = pptr + (offset & (PAGE_CACHE_BITS - 1)) / 32;
45 offset &= ~(PAGE_CACHE_BITS - 1);
46 if ((size ^ offset) / PAGE_CACHE_BITS)
49 end = pptr + ((size + 31) & (PAGE_CACHE_BITS - 1)) / 32;
79 if (offset >= size)
84 start = size;
88 if ((size ^ offset) / PAGE_CACHE_BITS)
91 end = pptr + ((size + 31) & (PAGE_CACHE_BITS - 1)) / 32;
93 hfs_dbg(BITMAP, "bitmap full\n");
94 start = size;
98 start = offset + (curr - pptr) * 32 + i;
99 if (start >= size) {
100 hfs_dbg(BITMAP, "bitmap full\n");
104 len = min(size - start, len);
110 if (!--len || n & mask)
113 if (!--len)
116 /* do full u32s */
127 len -= 32;
135 start = size;
155 *max = offset + (curr - pptr) * 32 + i - start;
156 sbi->free_blocks -= *max;
158 hfs_dbg(BITMAP, "-> %u,%u\n", start, *max);
160 mutex_unlock(&sbi->alloc_mutex);
179 if ((offset + count) > sbi->total_blocks)
180 return -ENOENT;
182 mutex_lock(&sbi->alloc_mutex);
183 mapping = sbi->alloc_file->i_mapping;
189 curr = pptr + (offset & (PAGE_CACHE_BITS - 1)) / 32;
196 int j = 32 - i;
204 count -= j;
207 /* do full u32s */
213 count -= 32;
235 sbi->free_blocks += len;
237 mutex_unlock(&sbi->alloc_mutex);
243 mutex_unlock(&sbi->alloc_mutex);
245 return -EIO;