Searched refs:block (Results 1 - 200 of 3815) sorted by relevance

1234567891011>>

/linux-4.1.27/fs/minix/
H A Ditree_v1.c24 static int block_to_path(struct inode * inode, long block, int offsets[DEPTH]) block_to_path() argument
29 if (block < 0) { block_to_path()
30 printk("MINIX-fs: block_to_path: block %ld < 0 on dev %s\n", block_to_path()
31 block, bdevname(inode->i_sb->s_bdev, b)); block_to_path()
32 } else if (block >= (minix_sb(inode->i_sb)->s_max_size/BLOCK_SIZE)) { block_to_path()
35 "block %ld too big on dev %s\n", block_to_path()
36 block, bdevname(inode->i_sb->s_bdev, b)); block_to_path()
37 } else if (block < 7) { block_to_path()
38 offsets[n++] = block; block_to_path()
39 } else if ((block -= 7) < 512) { block_to_path()
41 offsets[n++] = block; block_to_path()
43 block -= 512; block_to_path()
45 offsets[n++] = block>>9; block_to_path()
46 offsets[n++] = block & 511; block_to_path()
53 int V1_minix_get_block(struct inode * inode, long block, V1_minix_get_block() argument
56 return get_block(inode, block, bh_result, create); V1_minix_get_block()
H A Ditree_v2.c26 static int block_to_path(struct inode * inode, long block, int offsets[DEPTH]) block_to_path() argument
32 if (block < 0) { block_to_path()
33 printk("MINIX-fs: block_to_path: block %ld < 0 on dev %s\n", block_to_path()
34 block, bdevname(sb->s_bdev, b)); block_to_path()
35 } else if ((u64)block * (u64)sb->s_blocksize >= block_to_path()
39 "block %ld too big on dev %s\n", block_to_path()
40 block, bdevname(sb->s_bdev, b)); block_to_path()
41 } else if (block < DIRCOUNT) { block_to_path()
42 offsets[n++] = block; block_to_path()
43 } else if ((block -= DIRCOUNT) < INDIRCOUNT(sb)) { block_to_path()
45 offsets[n++] = block; block_to_path()
46 } else if ((block -= INDIRCOUNT(sb)) < INDIRCOUNT(sb) * INDIRCOUNT(sb)) { block_to_path()
48 offsets[n++] = block / INDIRCOUNT(sb); block_to_path()
49 offsets[n++] = block % INDIRCOUNT(sb); block_to_path()
51 block -= INDIRCOUNT(sb) * INDIRCOUNT(sb); block_to_path()
53 offsets[n++] = (block / INDIRCOUNT(sb)) / INDIRCOUNT(sb); block_to_path()
54 offsets[n++] = (block / INDIRCOUNT(sb)) % INDIRCOUNT(sb); block_to_path()
55 offsets[n++] = block % INDIRCOUNT(sb); block_to_path()
62 int V2_minix_get_block(struct inode * inode, long block, V2_minix_get_block() argument
65 return get_block(inode, block, bh_result, create); V2_minix_get_block()
H A Dbitmap.c12 /* bitmap.c contains the code that handles the inode and block bitmaps */
41 void minix_free_block(struct inode *inode, unsigned long block) minix_free_block() argument
49 if (block < sbi->s_firstdatazone || block >= sbi->s_nzones) { minix_free_block()
50 printk("Trying to free block not in datazone\n"); minix_free_block()
53 zone = block - sbi->s_firstdatazone + 1; minix_free_block()
64 sb->s_id, block); minix_free_block()
108 int block; minix_V1_raw_inode() local
118 block = 2 + sbi->s_imap_blocks + sbi->s_zmap_blocks + minix_V1_raw_inode()
120 *bh = sb_bread(sb, block); minix_V1_raw_inode()
122 printk("Unable to read inode block\n"); minix_V1_raw_inode()
132 int block; minix_V2_raw_inode() local
144 block = 2 + sbi->s_imap_blocks + sbi->s_zmap_blocks + minix_V2_raw_inode()
146 *bh = sb_bread(sb, block); minix_V2_raw_inode()
148 printk("Unable to read inode block\n"); minix_V2_raw_inode()
/linux-4.1.27/sound/isa/gus/
H A Dgus_mem.c43 struct snd_gf1_mem_block * block) snd_gf1_mem_xalloc()
50 *nblock = *block; snd_gf1_mem_xalloc()
78 int snd_gf1_mem_xfree(struct snd_gf1_mem * alloc, struct snd_gf1_mem_block * block) snd_gf1_mem_xfree() argument
80 if (block->share) { /* ok.. shared block */ snd_gf1_mem_xfree()
81 block->share--; snd_gf1_mem_xfree()
85 if (alloc->first == block) { snd_gf1_mem_xfree()
86 alloc->first = block->next; snd_gf1_mem_xfree()
87 if (block->next) snd_gf1_mem_xfree()
88 block->next->prev = NULL; snd_gf1_mem_xfree()
90 block->prev->next = block->next; snd_gf1_mem_xfree()
91 if (block->next) snd_gf1_mem_xfree()
92 block->next->prev = block->prev; snd_gf1_mem_xfree()
94 if (alloc->last == block) { snd_gf1_mem_xfree()
95 alloc->last = block->prev; snd_gf1_mem_xfree()
96 if (block->prev) snd_gf1_mem_xfree()
97 block->prev->next = NULL; snd_gf1_mem_xfree()
99 block->next->prev = block->prev; snd_gf1_mem_xfree()
100 if (block->prev) snd_gf1_mem_xfree()
101 block->prev->next = block->next; snd_gf1_mem_xfree()
103 kfree(block->name); snd_gf1_mem_xfree()
104 kfree(block); snd_gf1_mem_xfree()
111 struct snd_gf1_mem_block *block; snd_gf1_mem_look() local
113 for (block = alloc->first; block; block = block->next) { snd_gf1_mem_look()
114 if (block->ptr == address) { snd_gf1_mem_look()
115 return block; snd_gf1_mem_look()
124 struct snd_gf1_mem_block *block; snd_gf1_mem_share() local
129 for (block = alloc->first; block; block = block->next) snd_gf1_mem_share()
130 if (!memcmp(share_id, block->share_id, snd_gf1_mem_share()
131 sizeof(block->share_id))) snd_gf1_mem_share()
132 return block; snd_gf1_mem_share()
137 struct snd_gf1_mem_block * block, snd_gf1_mem_find()
148 block->flags = w_16 ? SNDRV_GF1_MEM_BLOCK_16BIT : 0; snd_gf1_mem_find()
149 block->owner = SNDRV_GF1_MEM_OWNER_DRIVER; snd_gf1_mem_find()
150 block->share = 0; snd_gf1_mem_find()
151 block->share_id[0] = block->share_id[1] = snd_gf1_mem_find()
152 block->share_id[2] = block->share_id[3] = 0; snd_gf1_mem_find()
153 block->name = NULL; snd_gf1_mem_find()
154 block->prev = block->next = NULL; snd_gf1_mem_find()
172 block->ptr = ptr1; snd_gf1_mem_find()
173 block->size = size; snd_gf1_mem_find()
180 block->ptr = info[idx].address; snd_gf1_mem_find()
181 block->size = size; snd_gf1_mem_find()
192 struct snd_gf1_mem_block block, *nblock; snd_gf1_mem_alloc() local
209 if (snd_gf1_mem_find(alloc, &block, size, w_16, align) < 0) { snd_gf1_mem_alloc()
214 memcpy(&block.share_id, share_id, sizeof(block.share_id)); snd_gf1_mem_alloc()
215 block.owner = owner; snd_gf1_mem_alloc()
216 block.name = kstrdup(name, GFP_KERNEL); snd_gf1_mem_alloc()
217 nblock = snd_gf1_mem_xalloc(alloc, &block); snd_gf1_mem_alloc()
225 struct snd_gf1_mem_block *block; snd_gf1_mem_free() local
228 if ((block = snd_gf1_mem_look(alloc, address)) != NULL) { snd_gf1_mem_free()
229 result = snd_gf1_mem_xfree(alloc, block); snd_gf1_mem_free()
240 struct snd_gf1_mem_block block; snd_gf1_mem_init() local
251 memset(&block, 0, sizeof(block)); snd_gf1_mem_init()
252 block.owner = SNDRV_GF1_MEM_OWNER_DRIVER; snd_gf1_mem_init()
254 block.ptr = 0; snd_gf1_mem_init()
255 block.size = 1024; snd_gf1_mem_init()
256 block.name = kstrdup("InterWave LFOs", GFP_KERNEL); snd_gf1_mem_init()
257 if (snd_gf1_mem_xalloc(alloc, &block) == NULL) snd_gf1_mem_init()
260 block.ptr = gus->gf1.default_voice_address; snd_gf1_mem_init()
261 block.size = 4; snd_gf1_mem_init()
262 block.name = kstrdup("Voice default (NULL's)", GFP_KERNEL); snd_gf1_mem_init()
263 if (snd_gf1_mem_xalloc(alloc, &block) == NULL) snd_gf1_mem_init()
275 struct snd_gf1_mem_block *block, *nblock; snd_gf1_mem_done() local
278 block = alloc->first; snd_gf1_mem_done()
279 while (block) { snd_gf1_mem_done()
280 nblock = block->next; snd_gf1_mem_done()
281 snd_gf1_mem_xfree(alloc, block); snd_gf1_mem_done()
282 block = nblock; snd_gf1_mem_done()
293 struct snd_gf1_mem_block *block; snd_gf1_mem_info_read() local
311 for (block = alloc->first, i = 0; block; block = block->next, i++) { snd_gf1_mem_info_read()
312 used += block->size; snd_gf1_mem_info_read()
313 snd_iprintf(buffer, "Block %i at 0x%lx onboard 0x%x size %i (0x%x):\n", i, (long) block, block->ptr, block->size, block->size); snd_gf1_mem_info_read()
314 if (block->share || snd_gf1_mem_info_read()
315 block->share_id[0] || block->share_id[1] || snd_gf1_mem_info_read()
316 block->share_id[2] || block->share_id[3]) snd_gf1_mem_info_read()
318 block->share, snd_gf1_mem_info_read()
319 block->share_id[0], block->share_id[1], snd_gf1_mem_info_read()
320 block->share_id[2], block->share_id[3]); snd_gf1_mem_info_read()
322 block->flags & SNDRV_GF1_MEM_BLOCK_16BIT ? " 16-bit" : ""); snd_gf1_mem_info_read()
324 switch (block->owner) { snd_gf1_mem_info_read()
326 snd_iprintf(buffer, "driver - %s\n", block->name); snd_gf1_mem_info_read()
345 ultra_iprintf(buffer, " Verify: free = %i, max 8-bit block = %i, max 16-bit block = %i\n", snd_gf1_mem_info_read()
42 snd_gf1_mem_xalloc(struct snd_gf1_mem * alloc, struct snd_gf1_mem_block * block) snd_gf1_mem_xalloc() argument
136 snd_gf1_mem_find(struct snd_gf1_mem * alloc, struct snd_gf1_mem_block * block, unsigned int size, int w_16, int align) snd_gf1_mem_find() argument
H A Dgus_dma.c97 struct snd_gf1_dma_block *block; snd_gf1_dma_next_block() local
99 /* PCM block have bigger priority than synthesizer one */ snd_gf1_dma_next_block()
101 block = gus->gf1.dma_data_pcm; snd_gf1_dma_next_block()
102 if (gus->gf1.dma_data_pcm_last == block) { snd_gf1_dma_next_block()
106 gus->gf1.dma_data_pcm = block->next; snd_gf1_dma_next_block()
109 block = gus->gf1.dma_data_synth; snd_gf1_dma_next_block()
110 if (gus->gf1.dma_data_synth_last == block) { snd_gf1_dma_next_block()
114 gus->gf1.dma_data_synth = block->next; snd_gf1_dma_next_block()
117 block = NULL; snd_gf1_dma_next_block()
119 if (block) { snd_gf1_dma_next_block()
120 gus->gf1.dma_ack = block->ack; snd_gf1_dma_next_block()
121 gus->gf1.dma_private_data = block->private_data; snd_gf1_dma_next_block()
123 return block; snd_gf1_dma_next_block()
129 struct snd_gf1_dma_block *block; snd_gf1_dma_interrupt() local
142 block = snd_gf1_dma_next_block(gus); snd_gf1_dma_interrupt()
144 snd_gf1_dma_program(gus, block->addr, block->buf_addr, block->count, (unsigned short) block->cmd); snd_gf1_dma_interrupt()
145 kfree(block); snd_gf1_dma_interrupt()
149 block->addr, block->buf_addr, block->count, block->cmd); snd_gf1_dma_interrupt()
172 struct snd_gf1_dma_block *block; snd_gf1_dma_done() local
180 while ((block = gus->gf1.dma_data_pcm)) { snd_gf1_dma_done()
181 gus->gf1.dma_data_pcm = block->next; snd_gf1_dma_done()
182 kfree(block); snd_gf1_dma_done()
184 while ((block = gus->gf1.dma_data_synth)) { snd_gf1_dma_done()
185 gus->gf1.dma_data_synth = block->next; snd_gf1_dma_done()
186 kfree(block); snd_gf1_dma_done()
201 struct snd_gf1_dma_block *block; snd_gf1_dma_transfer_block() local
203 block = kmalloc(sizeof(*block), atomic ? GFP_ATOMIC : GFP_KERNEL); snd_gf1_dma_transfer_block()
204 if (block == NULL) { snd_gf1_dma_transfer_block()
208 *block = *__block; snd_gf1_dma_transfer_block()
209 block->next = NULL; snd_gf1_dma_transfer_block()
212 block->addr, (long) block->buffer, block->count, snd_gf1_dma_transfer_block()
213 block->cmd); snd_gf1_dma_transfer_block()
223 gus->gf1.dma_data_synth_last->next = block; snd_gf1_dma_transfer_block()
224 gus->gf1.dma_data_synth_last = block; snd_gf1_dma_transfer_block()
227 gus->gf1.dma_data_synth_last = block; snd_gf1_dma_transfer_block()
231 gus->gf1.dma_data_pcm_last->next = block; snd_gf1_dma_transfer_block()
232 gus->gf1.dma_data_pcm_last = block; snd_gf1_dma_transfer_block()
235 gus->gf1.dma_data_pcm_last = block; snd_gf1_dma_transfer_block()
240 block = snd_gf1_dma_next_block(gus); snd_gf1_dma_transfer_block()
242 if (block == NULL) snd_gf1_dma_transfer_block()
244 snd_gf1_dma_program(gus, block->addr, block->buf_addr, block->count, (unsigned short) block->cmd); snd_gf1_dma_transfer_block()
245 kfree(block); snd_gf1_dma_transfer_block()
/linux-4.1.27/drivers/video/fbdev/
H A Dedid.h72 #define PIXEL_CLOCK_LO (unsigned)block[ 0 ]
73 #define PIXEL_CLOCK_HI (unsigned)block[ 1 ]
75 #define H_ACTIVE_LO (unsigned)block[ 2 ]
76 #define H_BLANKING_LO (unsigned)block[ 3 ]
77 #define H_ACTIVE_HI UPPER_NIBBLE( (unsigned)block[ 4 ] )
79 #define H_BLANKING_HI LOWER_NIBBLE( (unsigned)block[ 4 ] )
82 #define V_ACTIVE_LO (unsigned)block[ 5 ]
83 #define V_BLANKING_LO (unsigned)block[ 6 ]
84 #define V_ACTIVE_HI UPPER_NIBBLE( (unsigned)block[ 7 ] )
86 #define V_BLANKING_HI LOWER_NIBBLE( (unsigned)block[ 7 ] )
89 #define H_SYNC_OFFSET_LO (unsigned)block[ 8 ]
90 #define H_SYNC_WIDTH_LO (unsigned)block[ 9 ]
92 #define V_SYNC_OFFSET_LO UPPER_NIBBLE( (unsigned)block[ 10 ] )
93 #define V_SYNC_WIDTH_LO LOWER_NIBBLE( (unsigned)block[ 10 ] )
95 #define V_SYNC_WIDTH_HI ((unsigned)block[ 11 ] & (1|2))
96 #define V_SYNC_OFFSET_HI (((unsigned)block[ 11 ] & (4|8)) >> 2)
98 #define H_SYNC_WIDTH_HI (((unsigned)block[ 11 ] & (16|32)) >> 4)
99 #define H_SYNC_OFFSET_HI (((unsigned)block[ 11 ] & (64|128)) >> 6)
107 #define H_SIZE_LO (unsigned)block[ 12 ]
108 #define V_SIZE_LO (unsigned)block[ 13 ]
110 #define H_SIZE_HI UPPER_NIBBLE( (unsigned)block[ 14 ] )
111 #define V_SIZE_HI LOWER_NIBBLE( (unsigned)block[ 14 ] )
116 #define H_BORDER (unsigned)block[ 15 ]
117 #define V_BORDER (unsigned)block[ 16 ]
119 #define FLAGS (unsigned)block[ 17 ]
127 #define V_MIN_RATE block[ 5 ]
128 #define V_MAX_RATE block[ 6 ]
129 #define H_MIN_RATE block[ 7 ]
130 #define H_MAX_RATE block[ 8 ]
131 #define MAX_PIXEL_CLOCK (((int)block[ 9 ]) * 10)
132 #define GTF_SUPPORT block[10]
H A Dc2p_core.h66 /* First n x 1 block */ transp8()
68 /* Second n x 1 block */ transp8()
70 /* Third n x 1 block */ transp8()
72 /* Fourth n x 1 block */ transp8()
77 /* First n x 2 block */ transp8()
80 /* Second n x 2 block */ transp8()
86 /* Single n x 4 block */ transp8()
108 /* First n x 1 block */ transp4()
110 /* Second n x 1 block */ transp4()
115 /* Single n x 2 block */ transp4()
135 /* Single n x 2 block */ transp4x()
/linux-4.1.27/crypto/
H A Dcast6_generic.c165 static inline void Q(u32 *block, u8 *Kr, u32 *Km) Q() argument
168 block[2] ^= F1(block[3], Kr[0], Km[0]); Q()
169 block[1] ^= F2(block[2], Kr[1], Km[1]); Q()
170 block[0] ^= F3(block[1], Kr[2], Km[2]); Q()
171 block[3] ^= F1(block[0], Kr[3], Km[3]); Q()
175 static inline void QBAR(u32 *block, u8 *Kr, u32 *Km) QBAR() argument
178 block[3] ^= F1(block[0], Kr[3], Km[3]); QBAR()
179 block[0] ^= F3(block[1], Kr[2], Km[2]); QBAR()
180 block[1] ^= F2(block[2], Kr[1], Km[1]); QBAR()
181 block[2] ^= F1(block[3], Kr[0], Km[0]); QBAR()
188 u32 block[4]; __cast6_encrypt() local
192 block[0] = be32_to_cpu(src[0]); __cast6_encrypt()
193 block[1] = be32_to_cpu(src[1]); __cast6_encrypt()
194 block[2] = be32_to_cpu(src[2]); __cast6_encrypt()
195 block[3] = be32_to_cpu(src[3]); __cast6_encrypt()
197 Km = c->Km[0]; Kr = c->Kr[0]; Q(block, Kr, Km); __cast6_encrypt()
198 Km = c->Km[1]; Kr = c->Kr[1]; Q(block, Kr, Km); __cast6_encrypt()
199 Km = c->Km[2]; Kr = c->Kr[2]; Q(block, Kr, Km); __cast6_encrypt()
200 Km = c->Km[3]; Kr = c->Kr[3]; Q(block, Kr, Km); __cast6_encrypt()
201 Km = c->Km[4]; Kr = c->Kr[4]; Q(block, Kr, Km); __cast6_encrypt()
202 Km = c->Km[5]; Kr = c->Kr[5]; Q(block, Kr, Km); __cast6_encrypt()
203 Km = c->Km[6]; Kr = c->Kr[6]; QBAR(block, Kr, Km); __cast6_encrypt()
204 Km = c->Km[7]; Kr = c->Kr[7]; QBAR(block, Kr, Km); __cast6_encrypt()
205 Km = c->Km[8]; Kr = c->Kr[8]; QBAR(block, Kr, Km); __cast6_encrypt()
206 Km = c->Km[9]; Kr = c->Kr[9]; QBAR(block, Kr, Km); __cast6_encrypt()
207 Km = c->Km[10]; Kr = c->Kr[10]; QBAR(block, Kr, Km); __cast6_encrypt()
208 Km = c->Km[11]; Kr = c->Kr[11]; QBAR(block, Kr, Km); __cast6_encrypt()
210 dst[0] = cpu_to_be32(block[0]); __cast6_encrypt()
211 dst[1] = cpu_to_be32(block[1]); __cast6_encrypt()
212 dst[2] = cpu_to_be32(block[2]); __cast6_encrypt()
213 dst[3] = cpu_to_be32(block[3]); __cast6_encrypt()
226 u32 block[4]; __cast6_decrypt() local
230 block[0] = be32_to_cpu(src[0]); __cast6_decrypt()
231 block[1] = be32_to_cpu(src[1]); __cast6_decrypt()
232 block[2] = be32_to_cpu(src[2]); __cast6_decrypt()
233 block[3] = be32_to_cpu(src[3]); __cast6_decrypt()
235 Km = c->Km[11]; Kr = c->Kr[11]; Q(block, Kr, Km); __cast6_decrypt()
236 Km = c->Km[10]; Kr = c->Kr[10]; Q(block, Kr, Km); __cast6_decrypt()
237 Km = c->Km[9]; Kr = c->Kr[9]; Q(block, Kr, Km); __cast6_decrypt()
238 Km = c->Km[8]; Kr = c->Kr[8]; Q(block, Kr, Km); __cast6_decrypt()
239 Km = c->Km[7]; Kr = c->Kr[7]; Q(block, Kr, Km); __cast6_decrypt()
240 Km = c->Km[6]; Kr = c->Kr[6]; Q(block, Kr, Km); __cast6_decrypt()
241 Km = c->Km[5]; Kr = c->Kr[5]; QBAR(block, Kr, Km); __cast6_decrypt()
242 Km = c->Km[4]; Kr = c->Kr[4]; QBAR(block, Kr, Km); __cast6_decrypt()
243 Km = c->Km[3]; Kr = c->Kr[3]; QBAR(block, Kr, Km); __cast6_decrypt()
244 Km = c->Km[2]; Kr = c->Kr[2]; QBAR(block, Kr, Km); __cast6_decrypt()
245 Km = c->Km[1]; Kr = c->Kr[1]; QBAR(block, Kr, Km); __cast6_decrypt()
246 Km = c->Km[0]; Kr = c->Kr[0]; QBAR(block, Kr, Km); __cast6_decrypt()
248 dst[0] = cpu_to_be32(block[0]); __cast6_decrypt()
249 dst[1] = cpu_to_be32(block[1]); __cast6_decrypt()
250 dst[2] = cpu_to_be32(block[2]); __cast6_decrypt()
251 dst[3] = cpu_to_be32(block[3]); __cast6_decrypt()
H A Dmd5.c46 le32_to_cpu_array(ctx->block, sizeof(ctx->block) / sizeof(u32)); md5_transform_helper()
47 md5_transform(ctx->hash, ctx->block); md5_transform_helper()
66 const u32 avail = sizeof(mctx->block) - (mctx->byte_count & 0x3f); md5_update()
71 memcpy((char *)mctx->block + (sizeof(mctx->block) - avail), md5_update()
76 memcpy((char *)mctx->block + (sizeof(mctx->block) - avail), md5_update()
83 while (len >= sizeof(mctx->block)) { md5_update()
84 memcpy(mctx->block, data, sizeof(mctx->block)); md5_update()
86 data += sizeof(mctx->block); md5_update()
87 len -= sizeof(mctx->block); md5_update()
90 memcpy(mctx->block, data, len); md5_update()
99 char *p = (char *)mctx->block + offset; md5_final()
106 p = (char *)mctx->block; md5_final()
111 mctx->block[14] = mctx->byte_count << 3; md5_final()
112 mctx->block[15] = mctx->byte_count >> 29; md5_final()
113 le32_to_cpu_array(mctx->block, (sizeof(mctx->block) - md5_final()
115 md5_transform(mctx->hash, mctx->block); md5_final()
H A Dmd4.c38 u32 block[MD4_BLOCK_WORDS]; member in struct:md4_ctx
152 le32_to_cpu_array(ctx->block, ARRAY_SIZE(ctx->block)); md4_transform_helper()
153 md4_transform(ctx->hash, ctx->block); md4_transform_helper()
172 const u32 avail = sizeof(mctx->block) - (mctx->byte_count & 0x3f); md4_update()
177 memcpy((char *)mctx->block + (sizeof(mctx->block) - avail), md4_update()
182 memcpy((char *)mctx->block + (sizeof(mctx->block) - avail), md4_update()
189 while (len >= sizeof(mctx->block)) { md4_update()
190 memcpy(mctx->block, data, sizeof(mctx->block)); md4_update()
192 data += sizeof(mctx->block); md4_update()
193 len -= sizeof(mctx->block); md4_update()
196 memcpy(mctx->block, data, len); md4_update()
205 char *p = (char *)mctx->block + offset; md4_final()
212 p = (char *)mctx->block; md4_final()
217 mctx->block[14] = mctx->byte_count << 3; md4_final()
218 mctx->block[15] = mctx->byte_count >> 29; md4_final()
219 le32_to_cpu_array(mctx->block, (sizeof(mctx->block) - md4_final()
221 md4_transform(mctx->hash, mctx->block); md4_final()
/linux-4.1.27/fs/efs/
H A Ddir.c25 efs_block_t block; efs_readdir() local
33 block = ctx->pos >> EFS_DIRBSIZE_BITS; efs_readdir()
35 /* each block contains at most 256 slots */ efs_readdir()
39 while (block < inode->i_blocks) { efs_readdir()
43 /* read the dir block */ efs_readdir()
44 bh = sb_bread(inode->i_sb, efs_bmap(inode, block)); efs_readdir()
47 pr_err("%s(): failed to read dir block %d\n", efs_readdir()
48 __func__, block); efs_readdir()
55 pr_err("%s(): invalid directory block\n", __func__); efs_readdir()
74 pr_debug("%s(): block %d slot %d/%d: inode %u, name \"%s\", namelen %u\n", efs_readdir()
75 __func__, block, slot, dirblock->slots-1, efs_readdir()
80 ctx->pos = (block << EFS_DIRBSIZE_BITS) | slot; efs_readdir()
84 pr_warn("directory entry %d exceeds directory block\n", efs_readdir()
98 block++; efs_readdir()
100 ctx->pos = (block << EFS_DIRBSIZE_BITS) | slot; efs_readdir()
H A Dfile.c25 pr_warn("%s(): block %d >= %ld (filesize %ld)\n", efs_get_block()
26 __func__, block, inode->i_blocks, inode->i_size); efs_get_block()
36 int efs_bmap(struct inode *inode, efs_block_t block) { efs_bmap() argument
38 if (block < 0) { efs_bmap()
39 pr_warn("%s(): block < 0\n", __func__); efs_bmap()
44 if (!(block < inode->i_blocks)) { efs_bmap()
49 pr_warn("%s(): block %d >= %ld (filesize %ld)\n", efs_bmap()
50 __func__, block, inode->i_blocks, inode->i_size); efs_bmap()
55 return efs_map_block(inode, block); efs_bmap()
H A Dinode.c20 static sector_t _efs_bmap(struct address_space *mapping, sector_t block) _efs_bmap() argument
22 return generic_block_bmap(mapping,block,efs_get_block); _efs_bmap()
55 efs_block_t block, offset; efs_iget() local
73 ** work out the inode block index, (considering initially that the efs_iget()
74 ** inodes are stored as consecutive blocks). then work out the block efs_iget()
76 ** offset of the inode within that block. efs_iget()
82 block = sb->fs_start + sb->first_block + efs_iget()
90 bh = sb_bread(inode->i_sb, block); efs_iget()
92 pr_warn("%s() failed at block %d\n", __func__, block); efs_iget()
177 efs_extent_check(efs_extent *ptr, efs_block_t block, struct efs_sb_info *sb) { efs_extent_check() argument
183 * given an extent and a logical block within a file, efs_extent_check()
184 * can this block be found within this extent ? efs_extent_check()
190 if ((block >= offset) && (block < offset+length)) { efs_extent_check()
191 return(sb->fs_start + start + block - offset); efs_extent_check()
197 efs_block_t efs_map_block(struct inode *inode, efs_block_t block) { efs_map_block() argument
211 if ((result = efs_extent_check(&in->extents[last], block, sb))) efs_map_block()
228 if ((result = efs_extent_check(&in->extents[cur], block, sb))) { efs_map_block()
234 pr_err("%s() failed to map block %u (dir)\n", __func__, block); efs_map_block()
238 pr_debug("%s(): indirect search for logical block %u\n", efs_map_block()
239 __func__, block); efs_map_block()
261 pr_err("couldn't find direct extent for indirect extent %d (block %u)\n", efs_map_block()
262 cur, block); efs_map_block()
267 /* work out block number and offset of this indirect extent */ efs_map_block()
279 pr_err("%s() failed at block %d\n", efs_map_block()
283 pr_debug("%s(): read indirect extent block %d\n", efs_map_block()
294 pr_err("extent %d has bad magic number in block %d\n", efs_map_block()
300 if ((result = efs_extent_check(&ext, block, sb))) { efs_map_block()
307 pr_err("%s() failed to map block %u (indir)\n", __func__, block); efs_map_block()
H A Dnamei.c24 efs_block_t block; efs_find_entry() local
30 for(block = 0; block < inode->i_blocks; block++) { efs_find_entry()
32 bh = sb_bread(inode->i_sb, efs_bmap(inode, block)); efs_find_entry()
34 pr_err("%s(): failed to read dir block %d\n", efs_find_entry()
35 __func__, block); efs_find_entry()
42 pr_err("%s(): invalid directory block\n", __func__); efs_find_entry()
/linux-4.1.27/arch/arm/mach-cns3xxx/
H A Dpm.c18 void cns3xxx_pwr_clk_en(unsigned int block) cns3xxx_pwr_clk_en() argument
22 reg |= (block & PM_CLK_GATE_REG_MASK); cns3xxx_pwr_clk_en()
27 void cns3xxx_pwr_clk_dis(unsigned int block) cns3xxx_pwr_clk_dis() argument
31 reg &= ~(block & PM_CLK_GATE_REG_MASK); cns3xxx_pwr_clk_dis()
36 void cns3xxx_pwr_power_up(unsigned int block) cns3xxx_pwr_power_up() argument
40 reg &= ~(block & CNS3XXX_PWR_PLL_ALL); cns3xxx_pwr_power_up()
48 void cns3xxx_pwr_power_down(unsigned int block) cns3xxx_pwr_power_down() argument
53 reg |= (block & CNS3XXX_PWR_PLL_ALL); cns3xxx_pwr_power_down()
58 static void cns3xxx_pwr_soft_rst_force(unsigned int block) cns3xxx_pwr_soft_rst_force() argument
66 if (block & 0x30000001) { cns3xxx_pwr_soft_rst_force()
67 reg &= ~(block & PM_SOFT_RST_REG_MASK); cns3xxx_pwr_soft_rst_force()
69 reg &= ~(block & PM_SOFT_RST_REG_MASK); cns3xxx_pwr_soft_rst_force()
71 reg |= (block & PM_SOFT_RST_REG_MASK); cns3xxx_pwr_soft_rst_force()
77 void cns3xxx_pwr_soft_rst(unsigned int block) cns3xxx_pwr_soft_rst() argument
81 if (soft_reset & block) { cns3xxx_pwr_soft_rst()
82 /* SPI/I2C/GPIO use the same block, reset once. */ cns3xxx_pwr_soft_rst()
85 soft_reset |= block; cns3xxx_pwr_soft_rst()
87 cns3xxx_pwr_soft_rst_force(block); cns3xxx_pwr_soft_rst()
H A Dpm.h16 void cns3xxx_pwr_clk_en(unsigned int block);
17 void cns3xxx_pwr_clk_dis(unsigned int block);
18 void cns3xxx_pwr_power_up(unsigned int block);
19 void cns3xxx_pwr_power_down(unsigned int block);
/linux-4.1.27/fs/lockd/
H A Dsvclock.c42 static void nlmsvc_release_block(struct nlm_block *block);
43 static void nlmsvc_insert_block(struct nlm_block *block, unsigned long);
44 static void nlmsvc_remove_block(struct nlm_block *block);
89 nlmsvc_insert_block_locked(struct nlm_block *block, unsigned long when) nlmsvc_insert_block_locked() argument
94 dprintk("lockd: nlmsvc_insert_block(%p, %ld)\n", block, when); nlmsvc_insert_block_locked()
95 if (list_empty(&block->b_list)) { nlmsvc_insert_block_locked()
96 kref_get(&block->b_count); nlmsvc_insert_block_locked()
98 list_del_init(&block->b_list); nlmsvc_insert_block_locked()
115 list_add_tail(&block->b_list, pos); nlmsvc_insert_block_locked()
116 block->b_when = when; nlmsvc_insert_block_locked()
119 static void nlmsvc_insert_block(struct nlm_block *block, unsigned long when) nlmsvc_insert_block() argument
122 nlmsvc_insert_block_locked(block, when); nlmsvc_insert_block()
127 * Remove a block from the global list
130 nlmsvc_remove_block(struct nlm_block *block) nlmsvc_remove_block() argument
132 if (!list_empty(&block->b_list)) { nlmsvc_remove_block()
134 list_del_init(&block->b_list); nlmsvc_remove_block()
136 nlmsvc_release_block(block); nlmsvc_remove_block()
141 * Find a block for a given lock
146 struct nlm_block *block; nlmsvc_lookup_block() local
153 list_for_each_entry(block, &nlm_blocked, b_list) { nlmsvc_lookup_block()
154 fl = &block->b_call->a_args.lock.fl; nlmsvc_lookup_block()
156 block->b_file, fl->fl_pid, nlmsvc_lookup_block()
159 nlmdbg_cookie2a(&block->b_call->a_args.cookie)); nlmsvc_lookup_block()
160 if (block->b_file == file && nlm_compare_locks(fl, &lock->fl)) { nlmsvc_lookup_block()
161 kref_get(&block->b_count); nlmsvc_lookup_block()
162 return block; nlmsvc_lookup_block()
179 * Find a block with a given NLM cookie.
184 struct nlm_block *block; nlmsvc_find_block() local
186 list_for_each_entry(block, &nlm_blocked, b_list) { nlmsvc_find_block()
187 if (nlm_cookie_match(&block->b_call->a_args.cookie,cookie)) nlmsvc_find_block()
194 dprintk("nlmsvc_find_block(%s): block=%p\n", nlmdbg_cookie2a(cookie), block); nlmsvc_find_block()
195 kref_get(&block->b_count); nlmsvc_find_block()
196 return block; nlmsvc_find_block()
200 * Create a block and initialize it.
219 struct nlm_block *block; nlmsvc_create_block() local
226 /* Allocate memory for block, and initialize arguments */ nlmsvc_create_block()
227 block = kzalloc(sizeof(*block), GFP_KERNEL); nlmsvc_create_block()
228 if (block == NULL) nlmsvc_create_block()
230 kref_init(&block->b_count); nlmsvc_create_block()
231 INIT_LIST_HEAD(&block->b_list); nlmsvc_create_block()
232 INIT_LIST_HEAD(&block->b_flist); nlmsvc_create_block()
242 dprintk("lockd: created block %p...\n", block); nlmsvc_create_block()
244 /* Create and initialize the block */ nlmsvc_create_block()
245 block->b_daemon = rqstp->rq_server; nlmsvc_create_block()
246 block->b_host = host; nlmsvc_create_block()
247 block->b_file = file; nlmsvc_create_block()
251 list_add(&block->b_flist, &file->f_blocks); nlmsvc_create_block()
254 block->b_call = call; nlmsvc_create_block()
256 call->a_block = block; nlmsvc_create_block()
258 return block; nlmsvc_create_block()
261 kfree(block); nlmsvc_create_block()
268 * Delete a block.
272 static int nlmsvc_unlink_block(struct nlm_block *block) nlmsvc_unlink_block() argument
275 dprintk("lockd: unlinking block %p...\n", block); nlmsvc_unlink_block()
277 /* Remove block from list */ nlmsvc_unlink_block()
278 status = posix_unblock_lock(&block->b_call->a_args.lock.fl); nlmsvc_unlink_block()
279 nlmsvc_remove_block(block); nlmsvc_unlink_block()
285 struct nlm_block *block = container_of(kref, struct nlm_block, b_count); nlmsvc_free_block() local
286 struct nlm_file *file = block->b_file; nlmsvc_free_block()
288 dprintk("lockd: freeing block %p...\n", block); nlmsvc_free_block()
290 /* Remove block from file's list of blocks */ nlmsvc_free_block()
291 list_del_init(&block->b_flist); nlmsvc_free_block()
294 nlmsvc_freegrantargs(block->b_call); nlmsvc_free_block()
295 nlmsvc_release_call(block->b_call); nlmsvc_free_block()
296 nlm_release_file(block->b_file); nlmsvc_free_block()
297 kfree(block); nlmsvc_free_block()
300 static void nlmsvc_release_block(struct nlm_block *block) nlmsvc_release_block() argument
302 if (block != NULL) nlmsvc_release_block()
303 kref_put_mutex(&block->b_count, nlmsvc_free_block, &block->b_file->f_mutex); nlmsvc_release_block()
314 struct nlm_block *block, *next; nlmsvc_traverse_blocks() local
318 list_for_each_entry_safe(block, next, &file->f_blocks, b_flist) { nlmsvc_traverse_blocks()
319 if (!match(block->b_host, host)) nlmsvc_traverse_blocks()
323 if (list_empty(&block->b_list)) nlmsvc_traverse_blocks()
325 kref_get(&block->b_count); nlmsvc_traverse_blocks()
327 nlmsvc_unlink_block(block); nlmsvc_traverse_blocks()
328 nlmsvc_release_block(block); nlmsvc_traverse_blocks()
372 nlmsvc_defer_lock_rqst(struct svc_rqst *rqstp, struct nlm_block *block) nlmsvc_defer_lock_rqst() argument
376 block->b_flags |= B_QUEUED; nlmsvc_defer_lock_rqst()
378 nlmsvc_insert_block(block, NLM_TIMEOUT); nlmsvc_defer_lock_rqst()
380 block->b_cache_req = &rqstp->rq_chandle; nlmsvc_defer_lock_rqst()
382 block->b_deferred_req = nlmsvc_defer_lock_rqst()
383 rqstp->rq_chandle.defer(block->b_cache_req); nlmsvc_defer_lock_rqst()
384 if (block->b_deferred_req != NULL) nlmsvc_defer_lock_rqst()
387 dprintk("lockd: nlmsvc_defer_lock_rqst block %p flags %d status %d\n", nlmsvc_defer_lock_rqst()
388 block, block->b_flags, ntohl(status)); nlmsvc_defer_lock_rqst()
394 * Attempt to establish a lock, and if it can't be granted, block it
402 struct nlm_block *block = NULL; nlmsvc_lock() local
416 /* Get existing block (in case client is busy-waiting) nlmsvc_lock()
417 * or create new block nlmsvc_lock()
419 block = nlmsvc_lookup_block(file, lock); nlmsvc_lock()
420 if (block == NULL) { nlmsvc_lock()
421 block = nlmsvc_create_block(rqstp, host, file, lock, cookie); nlmsvc_lock()
423 if (block == NULL) nlmsvc_lock()
425 lock = &block->b_call->a_args.lock; nlmsvc_lock()
429 if (block->b_flags & B_QUEUED) { nlmsvc_lock()
430 dprintk("lockd: nlmsvc_lock deferred block %p flags %d\n", nlmsvc_lock()
431 block, block->b_flags); nlmsvc_lock()
432 if (block->b_granted) { nlmsvc_lock()
433 nlmsvc_unlink_block(block); nlmsvc_lock()
437 if (block->b_flags & B_TIMED_OUT) { nlmsvc_lock()
438 nlmsvc_unlink_block(block); nlmsvc_lock()
469 * to put it back on lockd's block list nlmsvc_lock()
480 ret = nlmsvc_defer_lock_rqst(rqstp, block); nlmsvc_lock()
493 nlmsvc_insert_block(block, NLM_NEVER); nlmsvc_lock()
496 nlmsvc_release_block(block); nlmsvc_lock()
559 * afterwards. In this case the block will still be there, and hence
593 struct nlm_block *block; nlmsvc_cancel_blocked() local
607 block = nlmsvc_lookup_block(file, lock); nlmsvc_cancel_blocked()
609 if (block != NULL) { nlmsvc_cancel_blocked()
610 vfs_cancel_lock(block->b_file->f_file, nlmsvc_cancel_blocked()
611 &block->b_call->a_args.lock.fl); nlmsvc_cancel_blocked()
612 status = nlmsvc_unlink_block(block); nlmsvc_cancel_blocked()
613 nlmsvc_release_block(block); nlmsvc_cancel_blocked()
623 * In all cases it will move the block to the head of nlm_blocked q where
628 nlmsvc_update_deferred_block(struct nlm_block *block, int result) nlmsvc_update_deferred_block() argument
630 block->b_flags |= B_GOT_CALLBACK; nlmsvc_update_deferred_block()
632 block->b_granted = 1; nlmsvc_update_deferred_block()
634 block->b_flags |= B_TIMED_OUT; nlmsvc_update_deferred_block()
639 struct nlm_block *block; nlmsvc_grant_deferred() local
643 list_for_each_entry(block, &nlm_blocked, b_list) { nlmsvc_grant_deferred()
644 if (nlm_compare_locks(&block->b_call->a_args.lock.fl, fl)) { nlmsvc_grant_deferred()
645 dprintk("lockd: nlmsvc_notify_blocked block %p flags %d\n", nlmsvc_grant_deferred()
646 block, block->b_flags); nlmsvc_grant_deferred()
647 if (block->b_flags & B_QUEUED) { nlmsvc_grant_deferred()
648 if (block->b_flags & B_TIMED_OUT) { nlmsvc_grant_deferred()
652 nlmsvc_update_deferred_block(block, result); nlmsvc_grant_deferred()
654 block->b_granted = 1; nlmsvc_grant_deferred()
656 nlmsvc_insert_block_locked(block, 0); nlmsvc_grant_deferred()
657 svc_wake_up(block->b_daemon); nlmsvc_grant_deferred()
664 printk(KERN_WARNING "lockd: grant for unknown block\n"); nlmsvc_grant_deferred()
673 * the block to the head of nlm_blocked where it can be picked up by lockd.
678 struct nlm_block *block; nlmsvc_notify_blocked() local
680 dprintk("lockd: VFS unblock notification for block %p\n", fl); nlmsvc_notify_blocked()
682 list_for_each_entry(block, &nlm_blocked, b_list) { nlmsvc_notify_blocked()
683 if (nlm_compare_locks(&block->b_call->a_args.lock.fl, fl)) { nlmsvc_notify_blocked()
684 nlmsvc_insert_block_locked(block, 0); nlmsvc_notify_blocked()
686 svc_wake_up(block->b_daemon); nlmsvc_notify_blocked()
691 printk(KERN_WARNING "lockd: notification for unknown block!\n"); nlmsvc_notify_blocked()
729 nlmsvc_grant_blocked(struct nlm_block *block) nlmsvc_grant_blocked() argument
731 struct nlm_file *file = block->b_file; nlmsvc_grant_blocked()
732 struct nlm_lock *lock = &block->b_call->a_args.lock; nlmsvc_grant_blocked()
736 dprintk("lockd: grant blocked lock %p\n", block); nlmsvc_grant_blocked()
738 kref_get(&block->b_count); nlmsvc_grant_blocked()
740 /* Unlink block request from list */ nlmsvc_grant_blocked()
741 nlmsvc_unlink_block(block); nlmsvc_grant_blocked()
746 if (block->b_granted) { nlmsvc_grant_blocked()
747 nlm_rebind_host(block->b_host); nlmsvc_grant_blocked()
768 nlmsvc_insert_block(block, NLM_NEVER); nlmsvc_grant_blocked()
769 nlmsvc_release_block(block); nlmsvc_grant_blocked()
774 nlmsvc_insert_block(block, 10 * HZ); nlmsvc_grant_blocked()
775 nlmsvc_release_block(block); nlmsvc_grant_blocked()
782 block->b_granted = 1; nlmsvc_grant_blocked()
784 /* keep block on the list, but don't reattempt until the RPC nlmsvc_grant_blocked()
787 nlmsvc_insert_block(block, NLM_NEVER); nlmsvc_grant_blocked()
792 error = nlm_async_call(block->b_call, NLMPROC_GRANTED_MSG, nlmsvc_grant_blocked()
797 nlmsvc_insert_block(block, 10 * HZ); nlmsvc_grant_blocked()
811 struct nlm_block *block = call->a_block; nlmsvc_grant_callback() local
817 /* if the block is not on a list at this point then it has nlmsvc_grant_callback()
820 * FIXME: it's possible that the block is removed from the list nlmsvc_grant_callback()
825 if (list_empty(&block->b_list)) nlmsvc_grant_callback()
829 * move the block towards the head of the queue only, no harm nlmsvc_grant_callback()
838 nlmsvc_insert_block_locked(block, timeout); nlmsvc_grant_callback()
839 svc_wake_up(block->b_daemon); nlmsvc_grant_callback()
861 * block.
866 struct nlm_block *block; nlmsvc_grant_reply() local
870 if (!(block = nlmsvc_find_block(cookie))) nlmsvc_grant_reply()
873 if (block) { nlmsvc_grant_reply()
876 nlmsvc_insert_block(block, 10 * HZ); nlmsvc_grant_reply()
879 * In both cases, the block should be removed. */ nlmsvc_grant_reply()
880 nlmsvc_unlink_block(block); nlmsvc_grant_reply()
883 nlmsvc_release_block(block); nlmsvc_grant_reply()
886 /* Helper function to handle retry of a deferred block.
891 retry_deferred_block(struct nlm_block *block) retry_deferred_block() argument
893 if (!(block->b_flags & B_GOT_CALLBACK)) retry_deferred_block()
894 block->b_flags |= B_TIMED_OUT; retry_deferred_block()
895 nlmsvc_insert_block(block, NLM_TIMEOUT); retry_deferred_block()
896 dprintk("revisit block %p flags %d\n", block, block->b_flags); retry_deferred_block()
897 if (block->b_deferred_req) { retry_deferred_block()
898 block->b_deferred_req->revisit(block->b_deferred_req, 0); retry_deferred_block()
899 block->b_deferred_req = NULL; retry_deferred_block()
912 struct nlm_block *block; nlmsvc_retry_blocked() local
916 block = list_entry(nlm_blocked.next, struct nlm_block, b_list); nlmsvc_retry_blocked()
918 if (block->b_when == NLM_NEVER) nlmsvc_retry_blocked()
920 if (time_after(block->b_when, jiffies)) { nlmsvc_retry_blocked()
921 timeout = block->b_when - jiffies; nlmsvc_retry_blocked()
927 block, block->b_when); nlmsvc_retry_blocked()
928 if (block->b_flags & B_QUEUED) { nlmsvc_retry_blocked()
929 dprintk("nlmsvc_retry_blocked delete block (%p, granted=%d, flags=%d)\n", nlmsvc_retry_blocked()
930 block, block->b_granted, block->b_flags); nlmsvc_retry_blocked()
931 retry_deferred_block(block); nlmsvc_retry_blocked()
933 nlmsvc_grant_blocked(block); nlmsvc_retry_blocked()
H A Dclntlock.c100 struct nlm_wait *block; nlmclnt_prepare_block() local
102 block = kmalloc(sizeof(*block), GFP_KERNEL); nlmclnt_prepare_block()
103 if (block != NULL) { nlmclnt_prepare_block()
104 block->b_host = host; nlmclnt_prepare_block()
105 block->b_lock = fl; nlmclnt_prepare_block()
106 init_waitqueue_head(&block->b_wait); nlmclnt_prepare_block()
107 block->b_status = nlm_lck_blocked; nlmclnt_prepare_block()
110 list_add(&block->b_list, &nlm_blocked); nlmclnt_prepare_block()
113 return block; nlmclnt_prepare_block()
116 void nlmclnt_finish_block(struct nlm_wait *block) nlmclnt_finish_block() argument
118 if (block == NULL) nlmclnt_finish_block()
121 list_del(&block->b_list); nlmclnt_finish_block()
123 kfree(block); nlmclnt_finish_block()
129 int nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout) nlmclnt_block() argument
133 /* A borken server might ask us to block even if we didn't nlmclnt_block()
136 if (block == NULL) nlmclnt_block()
147 ret = wait_event_interruptible_timeout(block->b_wait, nlmclnt_block()
148 block->b_status != nlm_lck_blocked, nlmclnt_block()
153 if (block->b_status == nlm_lck_denied_grace_period) nlmclnt_block()
154 block->b_status = nlm_lck_blocked; nlmclnt_block()
155 req->a_res.status = block->b_status; nlmclnt_block()
166 struct nlm_wait *block; nlmclnt_grant() local
174 list_for_each_entry(block, &nlm_blocked, b_list) { nlmclnt_grant()
175 struct file_lock *fl_blocked = block->b_lock; nlmclnt_grant()
187 if (!rpc_cmp_addr(nlm_addr(block->b_host), addr)) nlmclnt_grant()
194 block->b_status = nlm_granted; nlmclnt_grant()
195 wake_up(&block->b_wait); nlmclnt_grant()
230 struct nlm_wait *block; reclaimer() local
288 list_for_each_entry(block, &nlm_blocked, b_list) { reclaimer()
289 if (block->b_host == host) { reclaimer()
290 block->b_status = nlm_lck_denied_grace_period; reclaimer()
291 wake_up(&block->b_wait); reclaimer()
/linux-4.1.27/drivers/mmc/card/
H A DMakefile6 mmc_block-objs := block.o queue.o
/linux-4.1.27/drivers/w1/
H A Dw1_netlink.c60 struct w1_cb_block *block; member in struct:w1_cb_node
68 * @block: block to calculate
74 static u16 w1_reply_len(struct w1_cb_block *block) w1_reply_len() argument
76 if (!block->cn) w1_reply_len()
78 return (u8 *)block->cn - (u8 *)block->first_cn + block->cn->len; w1_reply_len()
81 static void w1_unref_block(struct w1_cb_block *block) w1_unref_block() argument
83 if (atomic_sub_return(1, &block->refcnt) == 0) { w1_unref_block()
84 u16 len = w1_reply_len(block); w1_unref_block()
86 cn_netlink_send_mult(block->first_cn, len, w1_unref_block()
87 block->portid, 0, GFP_KERNEL); w1_unref_block()
89 kfree(block); w1_unref_block()
95 * @block: block to make space on
101 static void w1_reply_make_space(struct w1_cb_block *block, u16 space) w1_reply_make_space() argument
103 u16 len = w1_reply_len(block); w1_reply_make_space()
104 if (len + space >= block->maxlen) { w1_reply_make_space()
105 cn_netlink_send_mult(block->first_cn, len, block->portid, 0, GFP_KERNEL); w1_reply_make_space()
106 block->first_cn->len = 0; w1_reply_make_space()
107 block->cn = NULL; w1_reply_make_space()
108 block->msg = NULL; w1_reply_make_space()
109 block->cmd = NULL; w1_reply_make_space()
114 static void w1_netlink_check_send(struct w1_cb_block *block) w1_netlink_check_send() argument
116 if (!(block->request_cn.flags & W1_CN_BUNDLE) && block->cn) w1_netlink_check_send()
117 w1_reply_make_space(block, block->maxlen); w1_netlink_check_send()
121 * w1_netlink_setup_msg() - prepare to write block->msg
122 * @block: block to operate on
125 * block->cn will be setup with the correct ack, advancing if needed
126 * block->cn->len does not include space for block->msg
127 * block->msg advances but remains uninitialized
129 static void w1_netlink_setup_msg(struct w1_cb_block *block, u32 ack) w1_netlink_setup_msg() argument
131 if (block->cn && block->cn->ack == ack) { w1_netlink_setup_msg()
132 block->msg = (struct w1_netlink_msg *)(block->cn->data + block->cn->len); w1_netlink_setup_msg()
135 if (block->cn) w1_netlink_setup_msg()
136 block->cn = (struct cn_msg *)(block->cn->data + w1_netlink_setup_msg()
137 block->cn->len); w1_netlink_setup_msg()
139 block->cn = block->first_cn; w1_netlink_setup_msg()
141 memcpy(block->cn, &block->request_cn, sizeof(*block->cn)); w1_netlink_setup_msg()
142 block->cn->len = 0; w1_netlink_setup_msg()
143 block->cn->ack = ack; w1_netlink_setup_msg()
144 block->msg = (struct w1_netlink_msg *)block->cn->data; w1_netlink_setup_msg()
152 static void w1_netlink_queue_cmd(struct w1_cb_block *block, w1_netlink_queue_cmd() argument
156 w1_reply_make_space(block, sizeof(struct cn_msg) + w1_netlink_queue_cmd()
163 w1_netlink_setup_msg(block, block->request_cn.seq + 1); w1_netlink_queue_cmd()
164 memcpy(block->msg, block->cur_msg, sizeof(*block->msg)); w1_netlink_queue_cmd()
165 block->cn->len += sizeof(*block->msg); w1_netlink_queue_cmd()
166 block->msg->len = 0; w1_netlink_queue_cmd()
167 block->cmd = (struct w1_netlink_cmd *)(block->msg->data); w1_netlink_queue_cmd()
170 if (block->cmd != cmd) w1_netlink_queue_cmd()
171 memcpy(block->cmd, cmd, space); w1_netlink_queue_cmd()
172 block->cn->len += space; w1_netlink_queue_cmd()
173 block->msg->len += space; w1_netlink_queue_cmd()
179 static void w1_netlink_queue_status(struct w1_cb_block *block, w1_netlink_queue_status() argument
184 w1_reply_make_space(block, space); w1_netlink_queue_status()
185 w1_netlink_setup_msg(block, block->request_cn.ack); w1_netlink_queue_status()
187 memcpy(block->msg, req_msg, sizeof(*req_msg)); w1_netlink_queue_status()
188 block->cn->len += sizeof(*req_msg); w1_netlink_queue_status()
189 block->msg->len = 0; w1_netlink_queue_status()
190 block->msg->status = (u8)-error; w1_netlink_queue_status()
192 struct w1_netlink_cmd *cmd = (struct w1_netlink_cmd *)block->msg->data; w1_netlink_queue_status()
194 block->cn->len += sizeof(*cmd); w1_netlink_queue_status()
195 block->msg->len += sizeof(*cmd); w1_netlink_queue_status()
198 w1_netlink_check_send(block); w1_netlink_queue_status()
208 * Use when a block isn't available to queue the message to and cn, msg
255 struct w1_cb_block *block = dev->priv; w1_send_slave() local
256 struct w1_netlink_cmd *cache_cmd = block->cmd; w1_send_slave()
259 w1_reply_make_space(block, sizeof(*data)); w1_send_slave()
262 if (!block->cmd) { w1_send_slave()
264 w1_netlink_queue_cmd(block, cache_cmd); w1_send_slave()
267 data = (u64 *)(block->cmd->data + block->cmd->len); w1_send_slave()
270 block->cn->len += sizeof(*data); w1_send_slave()
271 block->msg->len += sizeof(*data); w1_send_slave()
272 block->cmd->len += sizeof(*data); w1_send_slave()
472 dev->priv = node->block; w1_process_cb()
475 node->block->cur_msg = node->msg; w1_process_cb()
487 w1_netlink_check_send(node->block); w1_process_cb()
489 w1_netlink_queue_status(node->block, node->msg, cmd, err); w1_process_cb()
498 w1_netlink_queue_status(node->block, node->msg, cmd, err); w1_process_cb()
501 * the block w1_process_cb()
514 w1_unref_block(node->block); w1_process_cb()
562 struct w1_cb_block *block = NULL; w1_cn_callback() local
610 /* allocate space for the block, a copy of the original message, w1_cn_callback()
614 * cn->len doesn't include itself which is part of the block w1_cn_callback()
616 size = /* block + original message */ w1_cn_callback()
622 block = kzalloc(size, GFP_KERNEL); w1_cn_callback()
623 if (!block) { w1_cn_callback()
631 atomic_set(&block->refcnt, 1); w1_cn_callback()
632 block->portid = nsp->portid; w1_cn_callback()
633 memcpy(&block->request_cn, cn, sizeof(*cn) + cn->len); w1_cn_callback()
634 node = (struct w1_cb_node *)(block->request_cn.data + cn->len); w1_cn_callback()
645 block->maxlen = reply_size; w1_cn_callback()
646 block->first_cn = (struct cn_msg *)(node + node_count); w1_cn_callback()
647 memset(block->first_cn, 0, sizeof(*block->first_cn)); w1_cn_callback()
697 atomic_inc(&block->refcnt); w1_cn_callback()
699 node->block = block; w1_cn_callback()
700 node->msg = (struct w1_netlink_msg *)((u8 *)&block->request_cn + w1_cn_callback()
712 /* Can't queue because that modifies block and another w1_cn_callback()
728 if (block) w1_cn_callback()
729 w1_unref_block(block); w1_cn_callback()
/linux-4.1.27/arch/mips/alchemy/common/
H A Dvss.c2 * Au1300 media block power gating (VSS)
14 #define VSS_CLKRST 0x04 /* clock/block control */
21 /* enable a block as outlined in the databook */ __enable_block()
22 static inline void __enable_block(int block) __enable_block() argument
24 void __iomem *base = (void __iomem *)VSS_ADDR(block); __enable_block()
52 /* disable a block as outlined in the databook */ __disable_block()
53 static inline void __disable_block(int block) __disable_block() argument
55 void __iomem *base = (void __iomem *)VSS_ADDR(block); __disable_block()
69 void au1300_vss_block_control(int block, int enable) au1300_vss_block_control() argument
76 /* only one block at a time */ au1300_vss_block_control()
79 __enable_block(block); au1300_vss_block_control()
81 __disable_block(block); au1300_vss_block_control()
H A Dusb.c2 * USB block power/access management abstraction.
4 * Au1000+: The OHCI block control register is at the far end of the OHCI memory
26 /* Au1000 USB block config bits */
28 #define USBHEN_CE (1 << 3) /* OHCI block clock enable */
29 #define USBHEN_E (1 << 2) /* OHCI block enable */
30 #define USBHEN_C (1 << 1) /* OHCI block coherency bit */
114 /* no USB block active, do disable all PHYs */ __au1300_usb_phyctl()
130 r = __raw_readl(base + USB_DWC_CTRL3); /* enable OHCI block */ __au1300_ohci_control()
264 static inline int au1300_usb_control(int block, int enable) au1300_usb_control() argument
270 switch (block) { au1300_usb_control()
359 static inline int au1200_usb_control(int block, int enable) au1200_usb_control() argument
364 switch (block) { au1200_usb_control()
381 /* initialize USB block(s) to a known working state */ au1200_usb_init()
457 static inline int au1000_usb_control(int block, int enable, unsigned long rb, au1000_usb_control() argument
462 switch (block) { au1000_usb_control()
474 * @block: USB block to target
475 * @enable: set 1 to enable a block, 0 to disable
477 int alchemy_usb_control(int block, int enable) alchemy_usb_control() argument
487 ret = au1000_usb_control(block, enable, alchemy_usb_control()
491 ret = au1000_usb_control(block, enable, alchemy_usb_control()
495 ret = au1200_usb_control(block, enable); alchemy_usb_control()
498 ret = au1300_usb_control(block, enable); alchemy_usb_control()
/linux-4.1.27/fs/quota/
H A Dquota_tree.h12 * Structure of header of block with quota structures. It is padded to 16 bytes so
13 * there will be space for exactly 21 quota-entries in a block
16 __le32 dqdh_next_free; /* Number of next block with free entry */
17 __le32 dqdh_prev_free; /* Number of previous block with free entry */
18 __le16 dqdh_entries; /* Number of valid entries in block */
/linux-4.1.27/fs/befs/
H A Dio.c30 befs_blocknr_t block = 0; befs_bread_iaddr() local
43 block = iaddr2blockno(sb, &iaddr); befs_bread_iaddr()
45 befs_debug(sb, "%s: offset = %lu", __func__, (unsigned long)block); befs_bread_iaddr()
47 bh = sb_bread(sb, block); befs_bread_iaddr()
50 befs_error(sb, "Failed to read block %lu", befs_bread_iaddr()
51 (unsigned long)block); befs_bread_iaddr()
64 befs_bread(struct super_block *sb, befs_blocknr_t block) befs_bread() argument
68 befs_debug(sb, "---> Enter %s %lu", __func__, (unsigned long)block); befs_bread()
70 bh = sb_bread(sb, block); befs_bread()
73 befs_error(sb, "Failed to read block %lu", befs_bread()
74 (unsigned long)block); befs_bread()
H A Ddatastream.c53 befs_blocknr_t block; /* block coresponding to pos */ befs_read_datastream() local
56 block = pos >> BEFS_SB(sb)->block_shift; befs_read_datastream()
58 *off = pos - (block << BEFS_SB(sb)->block_shift); befs_read_datastream()
60 if (befs_fblock2brun(sb, ds, block, &run) != BEFS_OK) { befs_read_datastream()
61 befs_error(sb, "BeFS: Error finding disk addr of block %lu", befs_read_datastream()
62 (unsigned long)block); befs_read_datastream()
68 befs_error(sb, "BeFS: Error reading block %lu from datastream", befs_read_datastream()
69 (unsigned long)block); befs_read_datastream()
79 * Takes a file position and gives back a brun who's starting block
80 * is block number fblock of the file.
107 "befs_fblock2brun() was asked to find block %lu, " befs_fblock2brun()
136 befs_error(sb, "BeFS: Error reading datastream block " befs_read_lsymlink()
179 metablocks = 1; /* Start with 1 block for inode */ befs_count_blocks()
181 /* Size of indirect block */ befs_count_blocks()
186 Double indir block, plus all the indirect blocks it mapps befs_count_blocks()
187 In the double-indirect range, all block runs of data are befs_count_blocks()
189 how many data block runs are in the double-indirect region, befs_count_blocks()
216 Finds the block run that starts at file block number blockno
230 contains the blockno-th filesystem block. This is necessary
231 because the block runs map variable amounts of data. Simply
233 incrementing this by the length of each block run as we come
238 When/if blockno is found, if blockno is inside of a block
240 of the block run, so that blockno is the start and len is
258 befs_error(sb, "%s passed block outside of direct region", befs_find_brun_direct()
283 Finds the block run that starts at file block number blockno
296 For each block in the indirect run of the datastream, read
331 "disk block %lu from the indirect brun", befs_find_brun_indirect()
352 "<--- %s found file block " befs_find_brun_indirect()
366 "file block %lu", __func__, (unsigned long)blockno); befs_find_brun_indirect()
373 Finds the block run that starts at file block number blockno
386 The block runs in the double-indirect region are different.
388 block run maps a constant amount of file data. This means
389 that we can directly calculate how many block runs into the
391 maps a particular filesystem block.
394 inode addresses in the double-indirect block will point us
395 to the indirect block that contains the mapping for the data,
397 indirect block maps the data block we are after.
404 the indirect block and perform a similar process to find
405 the actual block run that maps the data block we are interested
439 * the indirect block pointed to by the double indirect block befs_find_brun_dblindirect()
444 * the double indirect block befs_find_brun_dblindirect()
454 * the indirect block contains pos. befs_find_brun_dblindirect()
461 /* Read double indirect block */ befs_find_brun_dblindirect()
466 "of the double-indirect block", __func__, befs_find_brun_dblindirect()
476 "double-indirect block at blockno %lu", __func__, befs_find_brun_dblindirect()
491 /* Read indirect block */ befs_find_brun_dblindirect()
496 "of the indirect block", __func__, indir_indx); befs_find_brun_dblindirect()
503 befs_error(sb, "%s couldn't read the indirect block " befs_find_brun_dblindirect()
524 befs_debug(sb, "Found file block %lu in double_indirect[%d][%d]," befs_find_brun_dblindirect()
/linux-4.1.27/sound/pci/ctxfi/
H A Dctvmem.c29 * Find or create vm block based on requested @size.
35 struct ct_vm_block *block = NULL, *entry; get_vm_block() local
49 break; /* found a block that is big enough */ get_vm_block()
58 block = entry; get_vm_block()
62 block = kzalloc(sizeof(*block), GFP_KERNEL); get_vm_block()
63 if (!block) get_vm_block()
66 block->addr = entry->addr; get_vm_block()
67 block->size = size; get_vm_block()
68 list_add(&block->list, &vm->used); get_vm_block()
75 return block; get_vm_block()
78 static void put_vm_block(struct ct_vm *vm, struct ct_vm_block *block) put_vm_block() argument
83 block->size = CT_PAGE_ALIGN(block->size); put_vm_block()
86 list_del(&block->list); put_vm_block()
87 vm->size += block->size; put_vm_block()
91 if (entry->addr >= (block->addr + block->size)) put_vm_block()
95 list_add_tail(&block->list, &vm->unused); put_vm_block()
96 entry = block; put_vm_block()
98 if ((block->addr + block->size) == entry->addr) { put_vm_block()
99 entry->addr = block->addr; put_vm_block()
100 entry->size += block->size; put_vm_block()
101 kfree(block); put_vm_block()
103 __list_add(&block->list, pos->prev, pos); put_vm_block()
104 entry = block; put_vm_block()
129 struct ct_vm_block *block; ct_vm_map() local
135 block = get_vm_block(vm, size, atc); ct_vm_map()
136 if (block == NULL) { ct_vm_map()
138 "No virtual memory block that is big enough to allocate!\n"); ct_vm_map()
143 pte_start = (block->addr >> CT_PAGE_SHIFT); ct_vm_map()
144 pages = block->size >> CT_PAGE_SHIFT; ct_vm_map()
151 block->size = size; ct_vm_map()
152 return block; ct_vm_map()
155 static void ct_vm_unmap(struct ct_vm *vm, struct ct_vm_block *block) ct_vm_unmap() argument
158 put_vm_block(vm, block); ct_vm_unmap()
179 struct ct_vm_block *block; ct_vm_create() local
209 block = kzalloc(sizeof(*block), GFP_KERNEL); ct_vm_create()
210 if (NULL != block) { ct_vm_create()
211 block->addr = 0; ct_vm_create()
212 block->size = vm->size; ct_vm_create()
213 list_add(&block->list, &vm->unused); ct_vm_create()
/linux-4.1.27/drivers/gpio/
H A Dgpio-sch311x.c43 struct sch311x_gpio_block { /* one GPIO block runtime data */
48 spinlock_t lock; /* lock for this GPIO block */
145 struct sch311x_gpio_block *block = to_sch311x_gpio_block(chip); sch311x_gpio_request() local
147 if (block->config_regs[offset] == 0) /* GPIO is not available */ sch311x_gpio_request()
150 if (!request_region(block->runtime_reg + block->config_regs[offset], sch311x_gpio_request()
153 block->runtime_reg + block->config_regs[offset]); sch311x_gpio_request()
161 struct sch311x_gpio_block *block = to_sch311x_gpio_block(chip); sch311x_gpio_free() local
163 if (block->config_regs[offset] == 0) /* GPIO is not available */ sch311x_gpio_free()
166 release_region(block->runtime_reg + block->config_regs[offset], 1); sch311x_gpio_free()
171 struct sch311x_gpio_block *block = to_sch311x_gpio_block(chip); sch311x_gpio_get() local
174 spin_lock(&block->lock); sch311x_gpio_get()
175 data = inb(block->runtime_reg + block->data_reg); sch311x_gpio_get()
176 spin_unlock(&block->lock); sch311x_gpio_get()
181 static void __sch311x_gpio_set(struct sch311x_gpio_block *block, __sch311x_gpio_set() argument
184 unsigned char data = inb(block->runtime_reg + block->data_reg); __sch311x_gpio_set()
189 outb(data, block->runtime_reg + block->data_reg); __sch311x_gpio_set()
195 struct sch311x_gpio_block *block = to_sch311x_gpio_block(chip); sch311x_gpio_set() local
197 spin_lock(&block->lock); sch311x_gpio_set()
198 __sch311x_gpio_set(block, offset, value); sch311x_gpio_set()
199 spin_unlock(&block->lock); sch311x_gpio_set()
204 struct sch311x_gpio_block *block = to_sch311x_gpio_block(chip); sch311x_gpio_direction_in() local
206 spin_lock(&block->lock); sch311x_gpio_direction_in()
207 outb(SCH311X_GPIO_CONF_IN, block->runtime_reg + sch311x_gpio_direction_in()
208 block->config_regs[offset]); sch311x_gpio_direction_in()
209 spin_unlock(&block->lock); sch311x_gpio_direction_in()
217 struct sch311x_gpio_block *block = to_sch311x_gpio_block(chip); sch311x_gpio_direction_out() local
219 spin_lock(&block->lock); sch311x_gpio_direction_out()
221 outb(SCH311X_GPIO_CONF_OUT, block->runtime_reg + sch311x_gpio_direction_out()
222 block->config_regs[offset]); sch311x_gpio_direction_out()
224 __sch311x_gpio_set(block, offset, value); sch311x_gpio_direction_out()
226 spin_unlock(&block->lock); sch311x_gpio_direction_out()
234 struct sch311x_gpio_block *block; sch311x_gpio_probe() local
251 block = &priv->blocks[i]; sch311x_gpio_probe()
253 spin_lock_init(&block->lock); sch311x_gpio_probe()
255 block->chip.label = DRV_NAME; sch311x_gpio_probe()
256 block->chip.owner = THIS_MODULE; sch311x_gpio_probe()
257 block->chip.request = sch311x_gpio_request; sch311x_gpio_probe()
258 block->chip.free = sch311x_gpio_free; sch311x_gpio_probe()
259 block->chip.direction_input = sch311x_gpio_direction_in; sch311x_gpio_probe()
260 block->chip.direction_output = sch311x_gpio_direction_out; sch311x_gpio_probe()
261 block->chip.get = sch311x_gpio_get; sch311x_gpio_probe()
262 block->chip.set = sch311x_gpio_set; sch311x_gpio_probe()
263 block->chip.ngpio = 8; sch311x_gpio_probe()
264 block->chip.dev = &pdev->dev; sch311x_gpio_probe()
265 block->chip.base = sch311x_gpio_blocks[i].base; sch311x_gpio_probe()
266 block->config_regs = sch311x_gpio_blocks[i].config_regs; sch311x_gpio_probe()
267 block->data_reg = sch311x_gpio_blocks[i].data_reg; sch311x_gpio_probe()
268 block->runtime_reg = pdata->runtime_reg; sch311x_gpio_probe()
270 err = gpiochip_add(&block->chip); sch311x_gpio_probe()
277 "SMSC SCH311x GPIO block %d registered.\n", i); sch311x_gpio_probe()
301 "SMSC SCH311x GPIO block %d unregistered.\n", i); sch311x_gpio_remove()
/linux-4.1.27/drivers/mtd/
H A Dinftlmount.c48 unsigned int i, block; find_boot_record() local
68 for (block = 0; block < inftl->nb_blocks; block++) { find_boot_record()
75 ret = mtd_read(mtd, block * inftl->EraseSize, SECTORSIZE, find_boot_record()
83 printk(KERN_WARNING "INFTL: block read at 0x%x " find_boot_record()
85 block * inftl->EraseSize, find_boot_record()
89 "failures for this block will " find_boot_record()
102 block * inftl->EraseSize + SECTORSIZE + 8, find_boot_record()
107 "(err %d)\n", block * inftl->EraseSize, find_boot_record()
120 mtd_read(mtd, block * inftl->EraseSize + 4096, SECTORSIZE, find_boot_record()
185 block >>= mh->BlockMultiplierBits; find_boot_record()
217 * to erase the hidden block for full find_boot_record()
299 /* Mark this boot record (NFTL MediaHeader) block as reserved */ find_boot_record()
300 inftl->PUtable[block] = BLOCK_RESERVED; find_boot_record()
314 inftl->MediaUnit = block; find_boot_record()
372 int INFTL_formatblock(struct INFTLrecord *inftl, int block) INFTL_formatblock() argument
380 pr_debug("INFTL: INFTL_formatblock(inftl=%p,block=%d)\n", inftl, block); INFTL_formatblock()
389 instr->addr = block * inftl->EraseSize; INFTL_formatblock()
393 mark only the failed block in the bbt. */ INFTL_formatblock()
399 printk(KERN_WARNING "INFTL: error while formatting block %d\n", INFTL_formatblock()
400 block); INFTL_formatblock()
419 instr->addr = block * inftl->EraseSize + SECTORSIZE * 2; INFTL_formatblock()
424 /* could not format, update the bad block table (caller is responsible INFTL_formatblock()
440 unsigned int block = first_block, block1; format_chain() local
442 printk(KERN_WARNING "INFTL: formatting chain at block %d\n", format_chain()
446 block1 = inftl->PUtable[block]; format_chain()
448 printk(KERN_WARNING "INFTL: formatting block %d\n", block); format_chain()
449 if (INFTL_formatblock(inftl, block) < 0) { format_chain()
453 inftl->PUtable[block] = BLOCK_RESERVED; format_chain()
455 inftl->PUtable[block] = BLOCK_FREE; format_chain()
458 /* Goto next block on the chain */ format_chain()
459 block = block1; format_chain()
461 if (block == BLOCK_NIL || block >= inftl->lastEUN) format_chain()
513 int logical, block, i; INFTL_dumpVUchains() local
520 block = s->VUtable[logical]; INFTL_dumpVUchains()
521 if (block >= s->nb_blocks) INFTL_dumpVUchains()
523 pr_debug(" LOGICAL %d --> %d ", logical, block); INFTL_dumpVUchains()
525 if (s->PUtable[block] == BLOCK_NIL) INFTL_dumpVUchains()
527 block = s->PUtable[block]; INFTL_dumpVUchains()
528 pr_debug("%d ", block); INFTL_dumpVUchains()
540 unsigned int block, first_block, prev_block, last_block; INFTL_mount() local
561 logical_block = block = BLOCK_NIL; INFTL_mount()
575 * Any block that is in any way invalid will be left in the INFTL_mount()
587 block = first_block; INFTL_mount()
592 (s->PUtable[block] != BLOCK_NOTEXPLORED)) { INFTL_mount()
593 /* Nothing to do here, onto next block */ INFTL_mount()
597 if (inftl_read_oob(mtd, block * s->EraseSize + 8, INFTL_mount()
599 inftl_read_oob(mtd, block * s->EraseSize + INFTL_mount()
610 ANACtable[block] = h0.ANAC; INFTL_mount()
612 /* Previous block is relative to start of Partition */ INFTL_mount()
617 if (s->PUtable[block] != BLOCK_NOTEXPLORED) { INFTL_mount()
621 s->PUtable[last_block] = block; INFTL_mount()
626 /* Check for invalid block */ INFTL_mount()
628 printk(KERN_WARNING "INFTL: corrupt block %d " INFTL_mount()
630 "mark 0x%x?\n", block, first_block, INFTL_mount()
644 s->PUtable[block] = BLOCK_FREE; INFTL_mount()
648 /* Sanity checks on block numbers */ INFTL_mount()
654 "block %d in chain %d?\n", INFTL_mount()
655 block, first_block); INFTL_mount()
671 * Current block is valid, so if we followed a virtual INFTL_mount()
673 * block pointer in our PUtable now. Then move onto INFTL_mount()
674 * the previous block in the chain. INFTL_mount()
676 s->PUtable[block] = BLOCK_NIL; INFTL_mount()
678 s->PUtable[last_block] = block; INFTL_mount()
679 last_block = block; INFTL_mount()
680 block = prev_block; INFTL_mount()
683 if (block == BLOCK_NIL) INFTL_mount()
686 /* Validate next block before following it... */ INFTL_mount()
687 if (block > s->lastEUN) { INFTL_mount()
689 "block %d in chain %d?\n", block, INFTL_mount()
703 * newest block in the chain, but it is the newest we have INFTL_mount()
720 block = s->VUtable[logical_block]; INFTL_mount()
724 if (block >= BLOCK_RESERVED) INFTL_mount()
727 ANAC = ANACtable[block]; INFTL_mount()
729 if (s->PUtable[block] == BLOCK_NIL) INFTL_mount()
731 if (s->PUtable[block] > s->lastEUN) { INFTL_mount()
734 s->PUtable[block], logical_block); INFTL_mount()
735 s->PUtable[block] = BLOCK_NIL; INFTL_mount()
738 if (ANACtable[block] != ANAC) { INFTL_mount()
742 * newest block and oldest block. INFTL_mount()
744 s->VUtable[logical_block] = block; INFTL_mount()
750 last_block = block; INFTL_mount()
751 block = s->PUtable[block]; INFTL_mount()
767 * Third pass, format unreferenced blocks and init free block count. INFTL_mount()
773 for (block = s->firstEUN; block <= s->lastEUN; block++) { INFTL_mount()
774 if (s->PUtable[block] == BLOCK_NOTEXPLORED) { INFTL_mount()
775 printk("INFTL: unreferenced block %d, formatting it\n", INFTL_mount()
776 block); INFTL_mount()
777 if (INFTL_formatblock(s, block) < 0) INFTL_mount()
778 s->PUtable[block] = BLOCK_RESERVED; INFTL_mount()
780 s->PUtable[block] = BLOCK_FREE; INFTL_mount()
782 if (s->PUtable[block] == BLOCK_FREE) { INFTL_mount()
785 s->LastFreeEUN = block; INFTL_mount()
H A Dnftlmount.c41 unsigned int block, boot_record_count = 0; find_boot_record() local
61 for (block = 0; block < nftl->nb_blocks; block++) { find_boot_record()
66 ret = mtd_read(mtd, block * nftl->EraseSize, SECTORSIZE, find_boot_record()
75 block * nftl->EraseSize, nftl->mbd.mtd->index, ret); find_boot_record()
77 printk(KERN_WARNING "Further failures for this block will not be printed\n"); find_boot_record()
86 block * nftl->EraseSize, nftl->mbd.mtd->index); find_boot_record()
92 ret = nftl_read_oob(mtd, block * nftl->EraseSize + find_boot_record()
97 block * nftl->EraseSize, nftl->mbd.mtd->index, ret); find_boot_record()
107 block * nftl->EraseSize, nftl->mbd.mtd->index, find_boot_record()
113 ret = mtd->read(mtd, block * nftl->EraseSize, SECTORSIZE, find_boot_record()
117 block * nftl->EraseSize, nftl->mbd.mtd->index, ret); find_boot_record()
124 block * nftl->EraseSize, nftl->mbd.mtd->index); find_boot_record()
137 nftl->MediaUnit * nftl->EraseSize, block * nftl->EraseSize); find_boot_record()
146 nftl->SpareMediaUnit = block; find_boot_record()
148 /* Mark this boot record (NFTL MediaHeader) block as reserved */ find_boot_record()
149 nftl->ReplUnitTable[block] = BLOCK_RESERVED; find_boot_record()
224 /* Mark this boot record (NFTL MediaHeader) block as reserved */ find_boot_record()
225 nftl->ReplUnitTable[block] = BLOCK_RESERVED; find_boot_record()
230 The new DiskOnChip driver already scanned the bad block table. Just query it. find_boot_record()
234 block * nftl->EraseSize + i + find_boot_record()
254 nftl->MediaUnit = block; find_boot_record()
257 } /* foreach (block) */ find_boot_record()
307 int NFTL_formatblock(struct NFTLrecord *nftl, int block) NFTL_formatblock() argument
316 if (nftl_read_oob(mtd, block * nftl->EraseSize + SECTORSIZE + 8, NFTL_formatblock()
332 instr->addr = block * nftl->EraseSize; NFTL_formatblock()
337 printk("Error while formatting block %d\n", block); NFTL_formatblock()
345 /* wrap (almost impossible with current flash) or free block */ NFTL_formatblock()
356 if (nftl_write_oob(mtd, block * nftl->EraseSize + SECTORSIZE + NFTL_formatblock()
361 /* could not format, update the bad block table (caller is responsible NFTL_formatblock()
373 * not updated according (due to power failure or something) which leaves the block
374 * in an inconsistent state. So we have to check if a block is really FREE in this
379 unsigned int block, i, status; check_sectors_in_chain() local
385 block = first_block; check_sectors_in_chain()
389 block * nftl->EraseSize + i * SECTORSIZE, check_sectors_in_chain()
400 check_free_sectors(nftl, block * nftl->EraseSize + i * SECTORSIZE, check_sectors_in_chain()
402 printk("Incorrect free sector %d in block %d: " check_sectors_in_chain()
404 i, block); check_sectors_in_chain()
409 nftl_write_oob(mtd, block * check_sectors_in_chain()
421 block = nftl->ReplUnitTable[block]; check_sectors_in_chain()
422 if (!(block == BLOCK_NIL || block < nftl->nb_blocks)) check_sectors_in_chain()
423 printk("incorrect ReplUnitTable[] : %d\n", block); check_sectors_in_chain()
424 if (block == BLOCK_NIL || block >= nftl->nb_blocks) check_sectors_in_chain()
432 unsigned int length = 0, block = first_block; calc_chain_length() local
443 block = nftl->ReplUnitTable[block]; calc_chain_length()
444 if (!(block == BLOCK_NIL || block < nftl->nb_blocks)) calc_chain_length()
445 printk("incorrect ReplUnitTable[] : %d\n", block); calc_chain_length()
446 if (block == BLOCK_NIL || block >= nftl->nb_blocks) calc_chain_length()
455 * It is not strictly correct to begin from the first block of the chain because
457 * flag in a block inside it. But is it really a problem ?
464 unsigned int block = first_block, block1; format_chain() local
466 printk("Formatting chain at block %d\n", first_block); format_chain()
469 block1 = nftl->ReplUnitTable[block]; format_chain()
471 printk("Formatting block %d\n", block); format_chain()
472 if (NFTL_formatblock(nftl, block) < 0) { format_chain()
474 nftl->ReplUnitTable[block] = BLOCK_RESERVED; format_chain()
476 nftl->ReplUnitTable[block] = BLOCK_FREE; format_chain()
479 /* goto next block on the chain */ format_chain()
480 block = block1; format_chain()
482 if (!(block == BLOCK_NIL || block < nftl->nb_blocks)) format_chain()
483 printk("incorrect ReplUnitTable[] : %d\n", block); format_chain()
484 if (block == BLOCK_NIL || block >= nftl->nb_blocks) format_chain()
489 /* check_and_mark_free_block: Verify that a block is free in the NFTL sense (valid erase mark) or
495 static int check_and_mark_free_block(struct NFTLrecord *nftl, int block) check_and_mark_free_block() argument
503 if (nftl_read_oob(mtd, block * nftl->EraseSize + SECTORSIZE + 8, 8, check_and_mark_free_block()
509 /* if no erase mark, the block must be totally free. This is check_and_mark_free_block()
511 if (check_free_sectors (nftl, block * nftl->EraseSize, nftl->EraseSize, 1) != 0) check_and_mark_free_block()
514 /* free block : write erase mark */ check_and_mark_free_block()
519 block * nftl->EraseSize + SECTORSIZE + 8, 8, check_and_mark_free_block()
527 if (check_free_sectors (nftl, block * nftl->EraseSize + i, check_and_mark_free_block()
531 if (nftl_read_oob(mtd, block * nftl->EraseSize + i, check_and_mark_free_block()
556 static int get_fold_mark(struct NFTLrecord *nftl, unsigned int block) get_fold_mark() argument
562 if (nftl_read_oob(mtd, block * nftl->EraseSize + 2 * SECTORSIZE + 8, get_fold_mark()
573 unsigned int block, first_block, is_first_block; NFTL_mount() local
591 /* first pass : explore each block chain */ NFTL_mount()
594 /* if the block was not already explored, we can look at it */ NFTL_mount()
596 block = first_block; NFTL_mount()
601 /* read the block header. If error, we format the chain */ NFTL_mount()
603 block * s->EraseSize + 8, 8, NFTL_mount()
606 block * s->EraseSize + NFTL_mount()
609 s->ReplUnitTable[block] = BLOCK_NIL; NFTL_mount()
622 /* invalid/free block test */ NFTL_mount()
626 if (check_and_mark_free_block(s, block) < 0) { NFTL_mount()
628 printk("Formatting block %d\n", block); NFTL_mount()
629 if (NFTL_formatblock(s, block) < 0) { NFTL_mount()
630 /* could not format: reserve the block */ NFTL_mount()
631 s->ReplUnitTable[block] = BLOCK_RESERVED; NFTL_mount()
633 s->ReplUnitTable[block] = BLOCK_FREE; NFTL_mount()
636 /* free block: mark it */ NFTL_mount()
637 s->ReplUnitTable[block] = BLOCK_FREE; NFTL_mount()
639 /* directly examine the next block. */ NFTL_mount()
642 /* the block was in a chain : this is bad. We NFTL_mount()
645 block, first_block); NFTL_mount()
646 s->ReplUnitTable[block] = BLOCK_NIL; NFTL_mount()
654 /* this block is not the first block in chain : NFTL_mount()
662 printk("Block %d: incorrect logical block: %d expected: %d\n", NFTL_mount()
663 block, logical_block, first_logical_block); NFTL_mount()
669 /* we accept that a block is marked as first NFTL_mount()
670 block while being last block in a chain NFTL_mount()
672 if (get_fold_mark(s, block) != FOLD_MARK_IN_PROGRESS || NFTL_mount()
674 printk("Block %d: incorrectly marked as first block in chain\n", NFTL_mount()
675 block); NFTL_mount()
680 printk("Block %d: folding in progress - ignoring first block flag\n", NFTL_mount()
681 block); NFTL_mount()
688 s->ReplUnitTable[block] = BLOCK_NIL; NFTL_mount()
691 printk("Block %d: referencing invalid block %d\n", NFTL_mount()
692 block, rep_block); NFTL_mount()
694 s->ReplUnitTable[block] = BLOCK_NIL; NFTL_mount()
698 we accept that the last block of a chain has NFTL_mount()
701 last block appeared first */ NFTL_mount()
706 printk("Block %d: folding in progress - ignoring first block flag\n", NFTL_mount()
708 s->ReplUnitTable[block] = rep_block; NFTL_mount()
711 printk("Block %d: referencing block %d already in another chain\n", NFTL_mount()
712 block, rep_block); NFTL_mount()
715 s->ReplUnitTable[block] = BLOCK_NIL; NFTL_mount()
720 s->ReplUnitTable[block] = rep_block; NFTL_mount()
721 block = rep_block; NFTL_mount()
738 printk("Could read foldmark at block %d\n", first_block); NFTL_mount()
771 /* second pass to format unreferenced blocks and init free block count */ NFTL_mount()
775 for (block = 0; block < s->nb_blocks; block++) { NFTL_mount()
776 if (s->ReplUnitTable[block] == BLOCK_NOTEXPLORED) { NFTL_mount()
777 printk("Unreferenced block %d, formatting it\n", block); NFTL_mount()
778 if (NFTL_formatblock(s, block) < 0) NFTL_mount()
779 s->ReplUnitTable[block] = BLOCK_RESERVED; NFTL_mount()
781 s->ReplUnitTable[block] = BLOCK_FREE; NFTL_mount()
783 if (s->ReplUnitTable[block] == BLOCK_FREE) { NFTL_mount()
785 s->LastFreeEUN = block; NFTL_mount()
H A Dsm_ftl.c147 * Read LBA associated with block
148 * returns -1, if block is erased
159 /* First test for erased block */ sm_read_lba()
195 static loff_t sm_mkoffset(struct sm_ftl *ftl, int zone, int block, int boffset) sm_mkoffset() argument
199 WARN_ON(block >= ftl->zone_size); sm_mkoffset()
202 if (block == -1) sm_mkoffset()
205 return (zone * SM_MAX_ZONE_SIZE + block) * ftl->block_size + boffset; sm_mkoffset()
210 int *zone, int *block, int *boffset) sm_break_offset()
213 *block = do_div(offset, ftl->max_lba); sm_break_offset()
237 int zone, int block, int boffset, sm_read_sector()
247 if (block == -1) { sm_read_sector()
267 if (zone == 0 && block == ftl->cis_block && boffset == sm_read_sector()
278 ret = mtd_read_oob(mtd, sm_mkoffset(ftl, zone, block, boffset), &ops); sm_read_sector()
282 dbg("read of block %d at zone %d, failed due to error (%d)", sm_read_sector()
283 block, zone, ret); sm_read_sector()
300 dbg("read of block %d at zone %d, failed because it is marked" sm_read_sector()
301 " as bad" , block, zone); sm_read_sector()
309 dbg("read of block %d at zone %d, failed due to ECC error", sm_read_sector()
310 block, zone); sm_read_sector()
319 int zone, int block, int boffset, sm_write_sector()
328 if (zone == 0 && (block == ftl->cis_block || block == 0)) { sm_write_sector()
343 ret = mtd_write_oob(mtd, sm_mkoffset(ftl, zone, block, boffset), &ops); sm_write_sector()
348 dbg("write to block %d at zone %d, failed with error %d", sm_write_sector()
349 block, zone, ret); sm_write_sector()
362 /* ------------------------ block IO ------------------------------------- */
364 /* Write a block using data and lba, and invalid sector bitmap */ sm_write_block()
366 int zone, int block, int lba, sm_write_block()
387 sm_printk("sector %d of block at LBA %d of zone %d" sm_write_block()
401 if (!sm_write_sector(ftl, zone, block, boffset, sm_write_block()
407 /* If write fails. try to erase the block */ sm_write_block()
410 This is intended to repair block that are marked sm_write_block()
413 if (sm_erase_block(ftl, zone, block, 0)) sm_write_block()
419 sm_mark_block_bad(ftl, zone, block); sm_write_block()
427 /* Mark whole block at offset 'offs' as bad. */ sm_mark_block_bad()
428 static void sm_mark_block_bad(struct sm_ftl *ftl, int zone, int block) sm_mark_block_bad() argument
442 sm_printk("marking block %d of zone %d as bad", block, zone); sm_mark_block_bad()
448 sm_write_sector(ftl, zone, block, boffset, NULL, &oob); sm_mark_block_bad()
452 * Erase a block within a zone
453 * If erase succeeds, it updates free block fifo, otherwise marks block as bad
455 static int sm_erase_block(struct sm_ftl *ftl, int zone_num, uint16_t block, sm_erase_block() argument
464 erase.addr = sm_mkoffset(ftl, zone_num, block, 0); sm_erase_block()
473 if (zone_num == 0 && (block == ftl->cis_block || block == 0)) { sm_erase_block()
479 sm_printk("erase of block %d in zone %d failed", sm_erase_block()
480 block, zone_num); sm_erase_block()
488 sm_printk("erase of block %d in zone %d failed after wait", sm_erase_block()
489 block, zone_num); sm_erase_block()
495 (const unsigned char *)&block, sizeof(block)); sm_erase_block()
499 sm_mark_block_bad(ftl, zone_num, block); sm_erase_block()
509 /* Thoroughly test that block is valid. */ sm_check_block()
510 static int sm_check_block(struct sm_ftl *ftl, int zone, int block) sm_check_block() argument
519 /* First just check that block doesn't look fishy */ sm_check_block()
526 if (sm_read_sector(ftl, zone, block, boffset, NULL, &oob)) sm_check_block()
539 /* If the block is sliced (partially erased usually) erase it */ sm_check_block()
541 sm_erase_block(ftl, zone, block, 1); sm_check_block()
689 int block, boffset; sm_find_cis() local
693 /* Search for first valid block */ sm_find_cis()
694 for (block = 0 ; block < ftl->zone_size - ftl->max_lba ; block++) { sm_find_cis()
696 if (sm_read_sector(ftl, 0, block, 0, NULL, &oob)) sm_find_cis()
708 /* Search for first valid sector in this block */ sm_find_cis()
712 if (sm_read_sector(ftl, 0, block, boffset, NULL, &oob)) sm_find_cis()
723 ftl->cis_block = block; sm_find_cis()
735 dbg("CIS block found at offset %x", sm_find_cis()
736 block * ftl->block_size + sm_find_cis()
762 uint16_t block; sm_init_zone() local
784 for (block = 0 ; block < ftl->zone_size ; block++) { sm_init_zone()
787 if (zone_num == 0 && block <= ftl->cis_block) sm_init_zone()
791 if (sm_read_sector(ftl, zone_num, block, 0, NULL, &oob)) sm_init_zone()
794 /* Test to see if block is erased. It is enough to test sm_init_zone()
798 (unsigned char *)&block, 2); sm_init_zone()
802 /* If block is marked as bad, skip it */ sm_init_zone()
804 /* However the way the block valid status is defined, ensures sm_init_zone()
807 dbg("PH %04d <-> <marked bad>", block); sm_init_zone()
814 /* Invalid LBA means that block is damaged. */ sm_init_zone()
818 dbg("PH %04d <-> LBA %04d(bad)", block, lba); sm_init_zone()
826 dbg_verbose("PH %04d <-> LBA %04d", block, lba); sm_init_zone()
827 zone->lba_to_phys_table[lba] = block; sm_init_zone()
833 lba, zone->lba_to_phys_table[lba], block, zone_num); sm_init_zone()
835 /* Test that this block is valid*/ sm_init_zone()
836 if (sm_check_block(ftl, zone_num, block)) sm_init_zone()
839 /* Test now the old block */ sm_init_zone()
842 zone->lba_to_phys_table[lba] = block; sm_init_zone()
851 sm_erase_block(ftl, zone_num, block, 1); sm_init_zone()
864 /* Randomize first block we write to */ sm_init_zone()
870 (unsigned char *)&block, 2); sm_init_zone()
872 kfifo_in(&zone->free_sectors, (const unsigned char *)&block, 2); sm_init_zone()
898 /* Initialize the one block cache */ sm_cache_init()
908 /* Put sector in one block cache */ sm_cache_put()
948 /* Try to read all unread areas of the cache block*/ sm_cache_flush()
964 /* we could still continue by erasing/writing the current block, sm_cache_flush()
981 /* Write succesfull, so erase and free the old block */ sm_cache_flush()
1016 int zone_num, block, boffset; sm_read() local
1018 sm_break_offset(ftl, sect_no << 9, &zone_num, &block, &boffset); sm_read()
1029 if (ftl->cache_zone == zone_num && ftl->cache_block == block) { sm_read()
1035 /* Translate the block and return if doesn't exist in the table */ sm_read()
1036 block = zone->lba_to_phys_table[block]; sm_read()
1038 if (block == -1) { sm_read()
1043 if (sm_read_sector(ftl, zone_num, block, boffset, buf, NULL)) { sm_read()
1061 int error = 0, zone_num, block, boffset; sm_write() local
1064 sm_break_offset(ftl, sec_no << 9, &zone_num, &block, &boffset); sm_write()
1077 if (ftl->cache_block != block || ftl->cache_zone != zone_num) { sm_write()
1083 ftl->cache_block = block; sm_write()
1203 dbg("each block consists of %d bytes", sm_add_mtd()
209 sm_break_offset(struct sm_ftl *ftl, loff_t offset, int *zone, int *block, int *boffset) sm_break_offset() argument
236 sm_read_sector(struct sm_ftl *ftl, int zone, int block, int boffset, uint8_t *buffer, struct sm_oob *oob) sm_read_sector() argument
318 sm_write_sector(struct sm_ftl *ftl, int zone, int block, int boffset, uint8_t *buffer, struct sm_oob *oob) sm_write_sector() argument
365 sm_write_block(struct sm_ftl *ftl, uint8_t *buf, int zone, int block, int lba, unsigned long invalid_bitmap) sm_write_block() argument
H A Drfd_ftl.c56 struct block { struct
79 int reserved_block; /* block next up for reclaim */
80 int current_block; /* block to write to */
87 struct block *blocks;
94 struct block *block = &part->blocks[block_no]; build_block_map() local
97 block->offset = part->block_size * block_no; build_block_map()
100 block->state = BLOCK_UNUSED; build_block_map()
104 block->state = BLOCK_OK; build_block_map()
115 block->free_sectors++; build_block_map()
138 part->sector_map[entry] = block->offset + build_block_map()
141 block->used_sectors++; build_block_map()
144 if (block->free_sectors == part->data_sectors_per_block) build_block_map()
163 /* each erase block has three bytes header, followed by the map */ scan_header()
187 part->blocks = kcalloc(part->total_blocks, sizeof(struct block), scan_header()
326 static int erase_block(struct partition *part, int block) erase_block() argument
337 erase->addr = part->blocks[block].offset; erase_block()
341 part->blocks[block].state = BLOCK_ERASING; erase_block()
342 part->blocks[block].free_sectors = 0; erase_block()
447 int block, best_block, score, old_sector_block; reclaim_block() local
460 for (block=0; block<part->total_blocks; block++) { reclaim_block()
463 if (block == part->reserved_block) reclaim_block()
471 if (part->blocks[block].free_sectors) reclaim_block()
474 this_score = part->blocks[block].used_sectors; reclaim_block()
476 if (block == old_sector_block) reclaim_block()
479 /* no point in moving a full block */ reclaim_block()
480 if (part->blocks[block].used_sectors == reclaim_block()
485 this_score += part->blocks[block].erases; reclaim_block()
488 best_block = block; reclaim_block()
499 pr_debug("reclaim_block: reclaiming block #%d with %d used " reclaim_block()
513 * IMPROVE: It would be best to choose the block with the most deleted sectors,
519 int block, stop; find_free_block() local
521 block = part->current_block == -1 ? find_free_block()
523 stop = block; find_free_block()
526 if (part->blocks[block].free_sectors && find_free_block()
527 block != part->reserved_block) find_free_block()
528 return block; find_free_block()
530 if (part->blocks[block].state == BLOCK_UNUSED) find_free_block()
531 erase_block(part, block); find_free_block()
533 if (++block >= part->total_blocks) find_free_block()
534 block = 0; find_free_block()
536 } while (block != stop); find_free_block()
543 int rc, block; find_writable_block() local
546 block = find_free_block(part); find_writable_block()
548 if (block == -1) { find_writable_block()
554 block = find_free_block(part); find_writable_block()
557 if (block == -1) { find_writable_block()
563 rc = mtd_read(part->mbd.mtd, part->blocks[block].offset, find_writable_block()
573 part->blocks[block].offset); find_writable_block()
577 part->current_block = block; find_writable_block()
585 int block, offset, rc; mark_sector_deleted() local
590 block = old_addr / part->block_size; mark_sector_deleted()
594 addr = part->blocks[block].offset + mark_sector_deleted()
607 if (block == part->current_block) mark_sector_deleted()
610 part->blocks[block].used_sectors--; mark_sector_deleted()
612 if (!part->blocks[block].used_sectors && mark_sector_deleted()
613 !part->blocks[block].free_sectors) mark_sector_deleted()
614 rc = erase_block(part, block); mark_sector_deleted()
620 static int find_free_sector(const struct partition *part, const struct block *block) find_free_sector() argument
624 i = stop = part->data_sectors_per_block - block->free_sectors; find_free_sector()
642 struct block *block; do_writesect() local
657 block = &part->blocks[part->current_block]; do_writesect()
659 i = find_free_sector(part, block); do_writesect()
667 block->offset; do_writesect()
686 addr = block->offset + (HEADER_MAP_OFFSET + i) * sizeof(u16); do_writesect()
698 block->used_sectors++; do_writesect()
699 block->free_sectors--; do_writesect()
H A Dsm_ftl.h35 int block_size; /* block size in bytes */
42 int cis_block; /* CIS block location */
43 int cis_boffset; /* CIS offset in the block */
48 int cache_block; /* block number of cached block */
49 int cache_zone; /* zone of cached block */
50 unsigned char *cache_data; /* cached block data */
90 static int sm_erase_block(struct sm_ftl *ftl, int zone_num, uint16_t block,
92 static void sm_mark_block_bad(struct sm_ftl *ftl, int zone_num, int block);
H A Dinftlcore.c42 * Maximum number of loops while examining next block, to have a
229 /* Scan for a free block */ INFTL_findfreeblock()
255 int block, silly; INFTL_foldchain() local
276 * 512-byte block within the Chain. INFTL_foldchain()
280 for (block = 0; block < inftl->EraseSize/SECTORSIZE; block ++) { INFTL_foldchain()
281 if ((BlockMap[block] != BLOCK_NIL) || INFTL_foldchain()
282 BlockDeleted[block]) INFTL_foldchain()
286 + (block * SECTORSIZE), 16, &retlen, INFTL_foldchain()
297 BlockMap[block] = thisEUN; INFTL_foldchain()
300 BlockDeleted[block] = 1; INFTL_foldchain()
304 "for block %d in EUN %d: %x\n", INFTL_foldchain()
305 block, thisEUN, status); INFTL_foldchain()
320 * OK. We now know the location of every block in the Virtual Unit INFTL_foldchain()
326 for (block = 0; block < inftl->EraseSize/SECTORSIZE ; block++) { INFTL_foldchain()
334 if (BlockMap[block] == targetEUN || (pendingblock == INFTL_foldchain()
335 (thisVUC * (inftl->EraseSize / SECTORSIZE) + block))) { INFTL_foldchain()
340 * Copy only in non free block (free blocks can only INFTL_foldchain()
343 if (BlockMap[block] == BLOCK_NIL) INFTL_foldchain()
347 (inftl->EraseSize * BlockMap[block]) + (block * SECTORSIZE), INFTL_foldchain()
353 (inftl->EraseSize * BlockMap[block]) + (block * SECTORSIZE), INFTL_foldchain()
364 (block * SECTORSIZE), SECTORSIZE, &retlen, INFTL_foldchain()
389 /* Unlink the last block from the chain. */ INFTL_foldchain()
395 * Could not erase : mark block as reserved. INFTL_foldchain()
471 * for this block. Make it available if it isn't already.
473 static inline u16 INFTL_findwriteunit(struct INFTLrecord *inftl, unsigned block) INFTL_findwriteunit() argument
475 unsigned int thisVUC = block / (inftl->EraseSize / SECTORSIZE); INFTL_findwriteunit()
477 unsigned long blockofs = (block * SECTORSIZE) & (inftl->EraseSize -1); INFTL_findwriteunit()
485 pr_debug("INFTL: INFTL_findwriteunit(inftl=%p,block=%d)\n", INFTL_findwriteunit()
486 inftl, block); INFTL_findwriteunit()
491 * a free space for the block in question. INFTL_findwriteunit()
502 pr_debug("INFTL: status of block %d in EUN %d is %x\n", INFTL_findwriteunit()
503 block , writeEUN, status); INFTL_findwriteunit()
517 * Invalid block. Don't use it any more. INFTL_findwriteunit()
529 /* Skip to next block in chain */ INFTL_findwriteunit()
550 thisEUN = INFTL_makefreeblock(inftl, block); INFTL_findwriteunit()
579 * Insert new block into virtual chain. Firstly update the INFTL_findwriteunit()
580 * block headers in flash... INFTL_findwriteunit()
644 int block, silly; INFTL_trydeletechain() local
667 for (block = 0; block < inftl->EraseSize/SECTORSIZE; block++) { INFTL_trydeletechain()
668 if (BlockUsed[block] || BlockDeleted[block]) INFTL_trydeletechain()
672 + (block * SECTORSIZE), 8 , &retlen, INFTL_trydeletechain()
683 BlockUsed[block] = 1; INFTL_trydeletechain()
686 BlockDeleted[block] = 1; INFTL_trydeletechain()
690 "for block %d in EUN %d: 0x%x\n", INFTL_trydeletechain()
691 block, thisEUN, status); INFTL_trydeletechain()
704 for (block = 0; block < inftl->EraseSize/SECTORSIZE; block++) INFTL_trydeletechain()
705 if (BlockUsed[block]) INFTL_trydeletechain()
709 * For each block in the chain free it and make it available INFTL_trydeletechain()
737 * Could not erase : mark block as reserved. INFTL_trydeletechain()
758 static int INFTL_deleteblock(struct INFTLrecord *inftl, unsigned block) INFTL_deleteblock() argument
760 unsigned int thisEUN = inftl->VUtable[block / (inftl->EraseSize / SECTORSIZE)]; INFTL_deleteblock()
761 unsigned long blockofs = (block * SECTORSIZE) & (inftl->EraseSize - 1); INFTL_deleteblock()
769 "block=%d)\n", inftl, block); INFTL_deleteblock()
789 "block %d in EUN %d: 0x%x\n", INFTL_deleteblock()
790 block, thisEUN, status); INFTL_deleteblock()
797 block / (inftl->EraseSize / SECTORSIZE)); INFTL_deleteblock()
812 INFTL_trydeletechain(inftl, block / (inftl->EraseSize / SECTORSIZE)); INFTL_deleteblock()
817 static int inftl_writeblock(struct mtd_blktrans_dev *mbd, unsigned long block, inftl_writeblock() argument
822 unsigned long blockofs = (block * SECTORSIZE) & (inftl->EraseSize - 1); inftl_writeblock()
827 pr_debug("INFTL: inftl_writeblock(inftl=%p,block=%ld," inftl_writeblock()
828 "buffer=%p)\n", inftl, block, buffer); inftl_writeblock()
830 /* Is block all zero? */ inftl_writeblock()
836 writeEUN = INFTL_findwriteunit(inftl, block); inftl_writeblock()
840 "block to write to\n"); inftl_writeblock()
842 * If we _still_ haven't got a block to use, inftl_writeblock()
859 INFTL_deleteblock(inftl, block); inftl_writeblock()
865 static int inftl_readblock(struct mtd_blktrans_dev *mbd, unsigned long block, inftl_readblock() argument
869 unsigned int thisEUN = inftl->VUtable[block / (inftl->EraseSize / SECTORSIZE)]; inftl_readblock()
870 unsigned long blockofs = (block * SECTORSIZE) & (inftl->EraseSize - 1); inftl_readblock()
877 pr_debug("INFTL: inftl_readblock(inftl=%p,block=%ld," inftl_readblock()
878 "buffer=%p)\n", inftl, block, buffer); inftl_readblock()
898 "block %ld in EUN %d: 0x%04x\n", inftl_readblock()
899 block, thisEUN, status); inftl_readblock()
906 block / (inftl->EraseSize / SECTORSIZE)); inftl_readblock()
915 /* The requested block is not on the media, return all 0x00 */ inftl_readblock()
H A Dnftlcore.c41 /* maximum number of loops while examining next block, to have a
205 /* For a given Virtual Unit Chain: find or create a free block and NFTL_findfreeblock()
218 /* Scan for a free block */ NFTL_findfreeblock()
251 int block; NFTL_foldchain() local
270 512-byte block within the Chain. NFTL_foldchain()
278 for (block = 0; block < nftl->EraseSize / 512; block ++) { NFTL_foldchain()
280 (block * 512), 16 , &retlen, NFTL_foldchain()
282 if (block == 2) { NFTL_foldchain()
295 BlockLastState[block] = status; NFTL_foldchain()
299 BlockFreeFound[block] = 1; NFTL_foldchain()
303 if (!BlockFreeFound[block]) NFTL_foldchain()
304 BlockMap[block] = thisEUN; NFTL_foldchain()
308 "in Virtual Unit Chain %d for block %d\n", NFTL_foldchain()
309 thisVUC, block); NFTL_foldchain()
312 if (!BlockFreeFound[block]) NFTL_foldchain()
313 BlockMap[block] = BLOCK_NIL; NFTL_foldchain()
317 "in Virtual Unit Chain %d for block %d\n", NFTL_foldchain()
318 thisVUC, block); NFTL_foldchain()
324 printk("Unknown status for block %d in EUN %d: %x\n", NFTL_foldchain()
325 block, thisEUN, status); NFTL_foldchain()
341 with them (i.e. BlockMap[block] != BLOCK_NIL) are NFTL_foldchain()
343 block. If not, we're going to have to fold out-of-place NFTL_foldchain()
346 for (block = 0; block < nftl->EraseSize / 512 ; block++) { NFTL_foldchain()
347 if (BlockLastState[block] != SECTOR_FREE && NFTL_foldchain()
348 BlockMap[block] != BLOCK_NIL && NFTL_foldchain()
349 BlockMap[block] != targetEUN) { NFTL_foldchain()
351 "block %d was %x lastEUN, " NFTL_foldchain()
353 thisVUC, block, BlockLastState[block], NFTL_foldchain()
354 BlockMap[block], NFTL_foldchain()
355 BlockMap[block]== targetEUN ? "==" : "!=", NFTL_foldchain()
399 /* OK. We now know the location of every block in the Virtual Unit Chain, NFTL_foldchain()
404 for (block = 0; block < nftl->EraseSize / 512 ; block++) { NFTL_foldchain()
409 if (BlockMap[block] == targetEUN || NFTL_foldchain()
410 (pendingblock == (thisVUC * (nftl->EraseSize / 512) + block))) { NFTL_foldchain()
414 /* copy only in non free block (free blocks can only NFTL_foldchain()
416 if (BlockMap[block] == BLOCK_NIL) NFTL_foldchain()
420 (nftl->EraseSize * BlockMap[block]) + (block * 512), NFTL_foldchain()
426 (nftl->EraseSize * BlockMap[block]) + (block * 512), NFTL_foldchain()
437 (block * 512), 512, &retlen, movebuf, (char *)&oob); NFTL_foldchain()
447 /* OK. We've moved the whole lot into the new block. Now we have to free the original blocks. */ NFTL_foldchain()
457 /* For each block in the old chain (except the targetEUN of course), NFTL_foldchain()
465 /* could not erase : mark block as reserved NFTL_foldchain()
533 for this block. Make it available if it isn't already
535 static inline u16 NFTL_findwriteunit(struct NFTLrecord *nftl, unsigned block) NFTL_findwriteunit() argument
538 u16 thisVUC = block / (nftl->EraseSize / 512); NFTL_findwriteunit()
541 unsigned long blockofs = (block * 512) & (nftl->EraseSize -1); NFTL_findwriteunit()
548 a free space for the block in question. NFTL_findwriteunit()
568 pr_debug("Status of block %d in EUN %d is %x\n", NFTL_findwriteunit()
569 block , writeEUN, le16_to_cpu(bci.Status)); NFTL_findwriteunit()
581 // Invalid block. Don't use it any more. Must implement. NFTL_findwriteunit()
592 /* Skip to next block in chain */ NFTL_findwriteunit()
599 /* Try to find an already-free block */ NFTL_findwriteunit()
639 /* We've found a free block. Insert it into the chain. */ NFTL_findwriteunit()
642 thisVUC |= 0x8000; /* It's a replacement block */ NFTL_findwriteunit()
644 /* The first block in a new chain */ NFTL_findwriteunit()
661 /* we link the new block to the chain only after the NFTL_findwriteunit()
662 block is ready. It avoids the case where the chain NFTL_findwriteunit()
663 could point to a free block */ NFTL_findwriteunit()
687 static int nftl_writeblock(struct mtd_blktrans_dev *mbd, unsigned long block, nftl_writeblock() argument
692 unsigned long blockofs = (block * 512) & (nftl->EraseSize - 1); nftl_writeblock()
696 writeEUN = NFTL_findwriteunit(nftl, block); nftl_writeblock()
700 "NFTL_writeblock(): Cannot find block to write to\n"); nftl_writeblock()
701 /* If we _still_ haven't got a block to use, we're screwed */ nftl_writeblock()
714 static int nftl_readblock(struct mtd_blktrans_dev *mbd, unsigned long block, nftl_readblock() argument
720 u16 thisEUN = nftl->EUNtable[block / (nftl->EraseSize / 512)]; nftl_readblock()
721 unsigned long blockofs = (block * 512) & (nftl->EraseSize - 1); nftl_readblock()
751 printk("Unknown status for block %ld in EUN %d: %x\n", nftl_readblock()
752 block, thisEUN, status); nftl_readblock()
758 block / (nftl->EraseSize / 512)); nftl_readblock()
767 /* the requested block is not on the media, return all 0x00 */ nftl_readblock()
H A Dmtdblock_ro.c30 unsigned long block, char *buf) mtdblock_readsect()
34 if (mtd_read(dev->mtd, (block * 512), 512, &retlen, buf)) mtdblock_readsect()
40 unsigned long block, char *buf) mtdblock_writesect()
44 if (mtd_write(dev->mtd, (block * 512), 512, &retlen, buf)) mtdblock_writesect()
99 MODULE_DESCRIPTION("Simple read-only block device emulation access to MTD devices");
29 mtdblock_readsect(struct mtd_blktrans_dev *dev, unsigned long block, char *buf) mtdblock_readsect() argument
39 mtdblock_writesect(struct mtd_blktrans_dev *dev, unsigned long block, char *buf) mtdblock_writesect() argument
/linux-4.1.27/arch/mips/cavium-octeon/crypto/
H A Docteon-md5.c56 const u64 *block = _block; octeon_md5_transform() local
58 write_octeon_64bit_block_dword(block[0], 0); octeon_md5_transform()
59 write_octeon_64bit_block_dword(block[1], 1); octeon_md5_transform()
60 write_octeon_64bit_block_dword(block[2], 2); octeon_md5_transform()
61 write_octeon_64bit_block_dword(block[3], 3); octeon_md5_transform()
62 write_octeon_64bit_block_dword(block[4], 4); octeon_md5_transform()
63 write_octeon_64bit_block_dword(block[5], 5); octeon_md5_transform()
64 write_octeon_64bit_block_dword(block[6], 6); octeon_md5_transform()
65 octeon_md5_start(block[7]); octeon_md5_transform()
85 const u32 avail = sizeof(mctx->block) - (mctx->byte_count & 0x3f); octeon_md5_update()
92 memcpy((char *)mctx->block + (sizeof(mctx->block) - avail), octeon_md5_update()
97 memcpy((char *)mctx->block + (sizeof(mctx->block) - avail), data, octeon_md5_update()
103 octeon_md5_transform(mctx->block); octeon_md5_update()
107 while (len >= sizeof(mctx->block)) { octeon_md5_update()
109 data += sizeof(mctx->block); octeon_md5_update()
110 len -= sizeof(mctx->block); octeon_md5_update()
116 memcpy(mctx->block, data, len); octeon_md5_update()
125 char *p = (char *)mctx->block + offset; octeon_md5_final()
137 octeon_md5_transform(mctx->block); octeon_md5_final()
138 p = (char *)mctx->block; octeon_md5_final()
143 mctx->block[14] = cpu_to_le32(mctx->byte_count << 3); octeon_md5_final()
144 mctx->block[15] = cpu_to_le32(mctx->byte_count >> 29); octeon_md5_final()
145 octeon_md5_transform(mctx->block); octeon_md5_final()
H A Docteon-sha512.c61 const u64 *block = _block; octeon_sha512_transform() local
63 write_octeon_64bit_block_sha512(block[0], 0); octeon_sha512_transform()
64 write_octeon_64bit_block_sha512(block[1], 1); octeon_sha512_transform()
65 write_octeon_64bit_block_sha512(block[2], 2); octeon_sha512_transform()
66 write_octeon_64bit_block_sha512(block[3], 3); octeon_sha512_transform()
67 write_octeon_64bit_block_sha512(block[4], 4); octeon_sha512_transform()
68 write_octeon_64bit_block_sha512(block[5], 5); octeon_sha512_transform()
69 write_octeon_64bit_block_sha512(block[6], 6); octeon_sha512_transform()
70 write_octeon_64bit_block_sha512(block[7], 7); octeon_sha512_transform()
71 write_octeon_64bit_block_sha512(block[8], 8); octeon_sha512_transform()
72 write_octeon_64bit_block_sha512(block[9], 9); octeon_sha512_transform()
73 write_octeon_64bit_block_sha512(block[10], 10); octeon_sha512_transform()
74 write_octeon_64bit_block_sha512(block[11], 11); octeon_sha512_transform()
75 write_octeon_64bit_block_sha512(block[12], 12); octeon_sha512_transform()
76 write_octeon_64bit_block_sha512(block[13], 13); octeon_sha512_transform()
77 write_octeon_64bit_block_sha512(block[14], 14); octeon_sha512_transform()
78 octeon_sha512_start(block[15]); octeon_sha512_transform()
H A Docteon-crypto.h66 * The value is the final block dword (64-bit).
77 * The value is the final block dword (64-bit).
88 * The value is the final block dword (64-bit).
140 * The value is the final block word (64-bit).
151 * The value is the final block dword (64-bit).
162 * The value is the final block dword (64-bit).
214 * The value is the final block word (64-bit).
H A Docteon-sha1.c66 const u64 *block = _block; octeon_sha1_transform() local
68 write_octeon_64bit_block_dword(block[0], 0); octeon_sha1_transform()
69 write_octeon_64bit_block_dword(block[1], 1); octeon_sha1_transform()
70 write_octeon_64bit_block_dword(block[2], 2); octeon_sha1_transform()
71 write_octeon_64bit_block_dword(block[3], 3); octeon_sha1_transform()
72 write_octeon_64bit_block_dword(block[4], 4); octeon_sha1_transform()
73 write_octeon_64bit_block_dword(block[5], 5); octeon_sha1_transform()
74 write_octeon_64bit_block_dword(block[6], 6); octeon_sha1_transform()
75 octeon_sha1_start(block[7]); octeon_sha1_transform()
/linux-4.1.27/drivers/s390/block/
H A Ddasd_genhd.c29 int dasd_gendisk_alloc(struct dasd_block *block) dasd_gendisk_alloc() argument
36 base = block->base; dasd_gendisk_alloc()
76 gdp->queue = block->request_queue; dasd_gendisk_alloc()
77 block->gdp = gdp; dasd_gendisk_alloc()
78 set_capacity(block->gdp, 0); dasd_gendisk_alloc()
79 add_disk(block->gdp); dasd_gendisk_alloc()
86 void dasd_gendisk_free(struct dasd_block *block) dasd_gendisk_free() argument
88 if (block->gdp) { dasd_gendisk_free()
89 del_gendisk(block->gdp); dasd_gendisk_free()
90 block->gdp->private_data = NULL; dasd_gendisk_free()
91 put_disk(block->gdp); dasd_gendisk_free()
92 block->gdp = NULL; dasd_gendisk_free()
99 int dasd_scan_partitions(struct dasd_block *block) dasd_scan_partitions() argument
105 bdev = bdget_disk(block->gdp, 0); dasd_scan_partitions()
107 DBF_DEV_EVENT(DBF_ERR, block->base, "%s", dasd_scan_partitions()
114 DBF_DEV_EVENT(DBF_ERR, block->base, dasd_scan_partitions()
128 DBF_DEV_EVENT(DBF_ERR, block->base, dasd_scan_partitions()
143 block->bdev = bdev; dasd_scan_partitions()
151 void dasd_destroy_partitions(struct dasd_block *block) dasd_destroy_partitions() argument
162 bdev = block->bdev; dasd_destroy_partitions()
163 block->bdev = NULL; dasd_destroy_partitions()
174 for (bpart.pno = block->gdp->minors - 1; bpart.pno > 0; bpart.pno--) dasd_destroy_partitions()
177 invalidate_partition(block->gdp, 0); dasd_destroy_partitions()
180 set_capacity(block->gdp, 0); dasd_destroy_partitions()
H A Ddasd_ioctl.c59 (loff_t)get_capacity(base->block->gdp) << 9); dasd_ioctl_enable()
83 * BIODASDDISABLE to disable accesses to the device via the block dasd_ioctl_disable()
103 static int dasd_ioctl_quiesce(struct dasd_block *block) dasd_ioctl_quiesce() argument
108 base = block->base; dasd_ioctl_quiesce()
124 static int dasd_ioctl_resume(struct dasd_block *block) dasd_ioctl_resume() argument
129 base = block->base; dasd_ioctl_resume()
139 dasd_schedule_block_bh(block); dasd_ioctl_resume()
146 static int dasd_ioctl_abortio(struct dasd_block *block) dasd_ioctl_abortio() argument
152 base = block->base; dasd_ioctl_abortio()
160 spin_lock_irqsave(&block->request_queue_lock, flags); dasd_ioctl_abortio()
161 spin_lock(&block->queue_lock); dasd_ioctl_abortio()
162 list_for_each_entry_safe(cqr, n, &block->ccw_queue, blocklist) { dasd_ioctl_abortio()
167 spin_unlock(&block->queue_lock); dasd_ioctl_abortio()
169 spin_lock(&block->queue_lock); dasd_ioctl_abortio()
172 spin_unlock(&block->queue_lock); dasd_ioctl_abortio()
173 spin_unlock_irqrestore(&block->request_queue_lock, flags); dasd_ioctl_abortio()
175 dasd_schedule_block_bh(block); dasd_ioctl_abortio()
182 static int dasd_ioctl_allowio(struct dasd_block *block) dasd_ioctl_allowio() argument
186 base = block->base; dasd_ioctl_allowio()
203 dasd_format(struct dasd_block *block, struct format_data_t *fdata) dasd_format() argument
210 base = block->base; dasd_format()
231 struct block_device *bdev = bdget_disk(block->gdp, 0); dasd_format()
295 rc = dasd_format(base->block, &fdata); dasd_ioctl_format()
304 static int dasd_ioctl_reset_profile(struct dasd_block *block) dasd_ioctl_reset_profile() argument
306 dasd_profile_reset(&block->profile); dasd_ioctl_reset_profile()
313 static int dasd_ioctl_read_profile(struct dasd_block *block, void __user *argp) dasd_ioctl_read_profile() argument
322 spin_lock_bh(&block->profile.lock); dasd_ioctl_read_profile()
323 if (block->profile.data) { dasd_ioctl_read_profile()
324 data->dasd_io_reqs = block->profile.data->dasd_io_reqs; dasd_ioctl_read_profile()
325 data->dasd_io_sects = block->profile.data->dasd_io_sects; dasd_ioctl_read_profile()
326 memcpy(data->dasd_io_secs, block->profile.data->dasd_io_secs, dasd_ioctl_read_profile()
328 memcpy(data->dasd_io_times, block->profile.data->dasd_io_times, dasd_ioctl_read_profile()
330 memcpy(data->dasd_io_timps, block->profile.data->dasd_io_timps, dasd_ioctl_read_profile()
332 memcpy(data->dasd_io_time1, block->profile.data->dasd_io_time1, dasd_ioctl_read_profile()
334 memcpy(data->dasd_io_time2, block->profile.data->dasd_io_time2, dasd_ioctl_read_profile()
337 block->profile.data->dasd_io_time2ps, dasd_ioctl_read_profile()
339 memcpy(data->dasd_io_time3, block->profile.data->dasd_io_time3, dasd_ioctl_read_profile()
342 block->profile.data->dasd_io_nr_req, dasd_ioctl_read_profile()
344 spin_unlock_bh(&block->profile.lock); dasd_ioctl_read_profile()
346 spin_unlock_bh(&block->profile.lock); dasd_ioctl_read_profile()
357 static int dasd_ioctl_reset_profile(struct dasd_block *block) dasd_ioctl_reset_profile() argument
362 static int dasd_ioctl_read_profile(struct dasd_block *block, void __user *argp) dasd_ioctl_read_profile() argument
371 static int dasd_ioctl_information(struct dasd_block *block, dasd_ioctl_information() argument
382 base = block->base; dasd_ioctl_information()
412 dasd_info->open_count = atomic_read(&block->open_count); dasd_ioctl_information()
413 if (!block->bdev) dasd_ioctl_information()
421 (dasd_check_blocksize(block->bp_block))) dasd_ioctl_information()
429 if (block->request_queue->request_fn) { dasd_ioctl_information()
434 spin_lock_irqsave(&block->lock, flags); dasd_ioctl_information()
435 list_for_each(l, &block->request_queue->queue_head) dasd_ioctl_information()
437 spin_unlock_irqrestore(&block->lock, flags); dasd_ioctl_information()
486 static int dasd_ioctl_readall_cmb(struct dasd_block *block, unsigned int cmd, dasd_ioctl_readall_cmb() argument
493 ret = cmf_readall(block->base->cdev, &data); dasd_ioctl_readall_cmb()
502 struct dasd_block *block; dasd_ioctl() local
520 block = base->block; dasd_ioctl()
530 rc = dasd_ioctl_quiesce(block); dasd_ioctl()
533 rc = dasd_ioctl_resume(block); dasd_ioctl()
536 rc = dasd_ioctl_abortio(block); dasd_ioctl()
539 rc = dasd_ioctl_allowio(block); dasd_ioctl()
545 rc = dasd_ioctl_information(block, cmd, argp); dasd_ioctl()
548 rc = dasd_ioctl_information(block, cmd, argp); dasd_ioctl()
551 rc = dasd_ioctl_read_profile(block, argp); dasd_ioctl()
554 rc = dasd_ioctl_reset_profile(block); dasd_ioctl()
569 rc = dasd_ioctl_readall_cmb(block, cmd, argp); dasd_ioctl()
575 rc = base->discipline->ioctl(block, cmd, argp); dasd_ioctl()
H A Ddasd_proc.c38 struct dasd_block *block; dasd_devices_show() local
44 if (device->block) dasd_devices_show()
45 block = device->block; dasd_devices_show()
58 if (block->gdp) dasd_devices_show()
60 MAJOR(disk_devt(block->gdp)), dasd_devices_show()
61 MINOR(disk_devt(block->gdp))); dasd_devices_show()
65 if (block->gdp) dasd_devices_show()
66 seq_printf(m, " is %-8s", block->gdp->disk_name); dasd_devices_show()
89 if (dasd_check_blocksize(block->bp_block)) dasd_devices_show()
94 block->bp_block, block->blocks, dasd_devices_show()
95 ((block->bp_block >> 9) * dasd_devices_show()
96 block->blocks) >> 11); dasd_devices_show()
157 if (device->block) dasd_stats_all_block_on()
158 rc = dasd_profile_on(&device->block->profile); dasd_stats_all_block_on()
175 if (device->block) dasd_stats_all_block_off()
176 dasd_profile_off(&device->block->profile); dasd_stats_all_block_off()
190 if (device->block) dasd_stats_all_block_reset()
191 dasd_profile_reset(&device->block->profile); dasd_stats_all_block_reset()
H A Ddasd_diag.c3 * Based on.......: linux/drivers/s390/block/mdisk.c
65 /* Perform DIAG250 call with block I/O parameter list iob (input and output)
92 /* Initialize block I/O to DIAG device using the specified blocksize and
93 * block offset. On success, return zero and set end_block to contain the
121 /* Remove block I/O environment for device. Return zero on success, non-zero
146 rc = mdsk_init_io(device, device->block->bp_block, 0, NULL); dasd_diag_erp()
223 mdsk_init_io(device, device->block->bp_block, 0, NULL); dasd_diag_term_IO()
316 struct dasd_block *block; dasd_diag_check_device() local
337 block = dasd_alloc_block(); dasd_diag_check_device()
338 if (IS_ERR(block)) { dasd_diag_check_device()
340 "could not allocate dasd block structure"); dasd_diag_check_device()
343 return PTR_ERR(block); dasd_diag_check_device()
345 device->block = block; dasd_diag_check_device()
346 block->base = device; dasd_diag_check_device()
364 /* Figure out position of label block */ dasd_diag_check_device()
432 /* check for label block */ dasd_diag_check_device()
435 /* get formatted blocksize from label block */ dasd_diag_check_device()
437 block->blocks = (unsigned long) label->block_count; dasd_diag_check_device()
439 block->blocks = end_block; dasd_diag_check_device()
440 block->bp_block = bsize; dasd_diag_check_device()
441 block->s2b_shift = 0; /* bits to shift 512 to get a block */ dasd_diag_check_device()
443 block->s2b_shift++; dasd_diag_check_device()
444 rc = mdsk_init_io(device, block->bp_block, 0, NULL); dasd_diag_check_device()
452 pr_info("%s: New DASD with %ld byte/block, total size %ld " dasd_diag_check_device()
454 (unsigned long) block->bp_block, dasd_diag_check_device()
455 (unsigned long) (block->blocks << dasd_diag_check_device()
456 block->s2b_shift) >> 1, dasd_diag_check_device()
464 device->block = NULL; dasd_diag_check_device()
465 dasd_free_block(block); dasd_diag_check_device()
475 dasd_diag_fill_geometry(struct dasd_block *block, struct hd_geometry *geo) dasd_diag_fill_geometry() argument
477 if (dasd_check_blocksize(block->bp_block) != 0) dasd_diag_fill_geometry()
479 geo->cylinders = (block->blocks << block->s2b_shift) >> 10; dasd_diag_fill_geometry()
481 geo->sectors = 128 >> block->s2b_shift; dasd_diag_fill_geometry()
497 /* Create DASD request from block device request. Return pointer to new
500 struct dasd_block *block, dasd_diag_build_cp()
520 blksize = block->bp_block; dasd_diag_build_cp()
521 /* Calculate record id of first and last block. */ dasd_diag_build_cp()
522 first_rec = blk_rq_pos(req) >> block->s2b_shift; dasd_diag_build_cp()
524 (blk_rq_pos(req) + blk_rq_sectors(req) - 1) >> block->s2b_shift; dasd_diag_build_cp()
531 count += bv.bv_len >> (block->s2b_shift + 9); rq_for_each_segment()
562 block->base->features & DASD_FEATURE_FAILFAST)
566 cqr->block = block;
499 dasd_diag_build_cp(struct dasd_device *memdev, struct dasd_block *block, struct request *req) dasd_diag_build_cp() argument
H A Ddasd.c96 /* Get two pages for normal block device operations. */ dasd_alloc_device()
147 struct dasd_block *block; dasd_alloc_block() local
149 block = kzalloc(sizeof(*block), GFP_ATOMIC); dasd_alloc_block()
150 if (!block) dasd_alloc_block()
153 atomic_set(&block->open_count, -1); dasd_alloc_block()
155 spin_lock_init(&block->request_queue_lock); dasd_alloc_block()
156 atomic_set(&block->tasklet_scheduled, 0); dasd_alloc_block()
157 tasklet_init(&block->tasklet, dasd_alloc_block()
159 (unsigned long) block); dasd_alloc_block()
160 INIT_LIST_HEAD(&block->ccw_queue); dasd_alloc_block()
161 spin_lock_init(&block->queue_lock); dasd_alloc_block()
162 init_timer(&block->timer); dasd_alloc_block()
163 block->timer.function = dasd_block_timeout; dasd_alloc_block()
164 block->timer.data = (unsigned long) block; dasd_alloc_block()
165 spin_lock_init(&block->profile.lock); dasd_alloc_block()
167 return block; dasd_alloc_block()
174 void dasd_free_block(struct dasd_block *block) dasd_free_block() argument
176 kfree(block); dasd_free_block()
193 if (device->block) { dasd_state_new_to_known()
194 rc = dasd_alloc_queue(device->block); dasd_state_new_to_known()
223 if (device->block) dasd_state_known_to_new()
224 dasd_free_queue(device->block); dasd_state_known_to_new()
249 struct dasd_block *block = device->block; dasd_state_known_to_basic() local
253 if (block) { dasd_state_known_to_basic()
254 rc = dasd_gendisk_alloc(block); dasd_state_known_to_basic()
257 block->debugfs_dentry = dasd_state_known_to_basic()
258 dasd_debugfs_setup(block->gdp->disk_name, dasd_state_known_to_basic()
260 dasd_profile_init(&block->profile, block->debugfs_dentry); dasd_state_known_to_basic()
262 dasd_profile_on(&device->block->profile); dasd_state_known_to_basic()
294 if (device->block) { dasd_state_basic_to_known()
295 dasd_profile_exit(&device->block->profile); dasd_state_basic_to_known()
296 debugfs_remove(device->block->debugfs_dentry); dasd_state_basic_to_known()
297 dasd_gendisk_free(device->block); dasd_state_basic_to_known()
298 dasd_block_clear_timer(device->block); dasd_state_basic_to_known()
324 * After the analysis ccw is done (do_analysis returned 0) the block
332 struct dasd_block *block; dasd_state_basic_to_ready() local
335 block = device->block; dasd_state_basic_to_ready()
337 if (block) { dasd_state_basic_to_ready()
338 if (block->base->discipline->do_analysis != NULL) dasd_state_basic_to_ready()
339 rc = block->base->discipline->do_analysis(block); dasd_state_basic_to_ready()
347 dasd_setup_queue(block); dasd_state_basic_to_ready()
348 set_capacity(block->gdp, dasd_state_basic_to_ready()
349 block->blocks << block->s2b_shift); dasd_state_basic_to_ready()
351 rc = dasd_scan_partitions(block); dasd_state_basic_to_ready()
368 if (device->block) _wait_for_empty_queues()
370 list_empty(&device->block->ccw_queue); _wait_for_empty_queues()
376 * Remove device from block device layer. Destroy dirty buffers.
385 if (device->block) { dasd_state_ready_to_basic()
386 struct dasd_block *block = device->block; dasd_state_ready_to_basic() local
387 rc = dasd_flush_block_queue(block); dasd_state_ready_to_basic()
392 dasd_flush_request_queue(block); dasd_state_ready_to_basic()
393 dasd_destroy_partitions(block); dasd_state_ready_to_basic()
394 block->blocks = 0; dasd_state_ready_to_basic()
395 block->bp_block = 0; dasd_state_ready_to_basic()
396 block->s2b_shift = 0; dasd_state_ready_to_basic()
423 if (device->block) { dasd_state_ready_to_online()
424 dasd_schedule_block_bh(device->block); dasd_state_ready_to_online()
426 disk = device->block->gdp; dasd_state_ready_to_online()
430 disk = device->block->bdev->bd_disk; dasd_state_ready_to_online()
456 if (device->block && !(device->features & DASD_FEATURE_USERAW)) { dasd_state_online_to_ready()
457 disk = device->block->bdev->bd_disk; dasd_state_online_to_ready()
688 static void dasd_profile_start(struct dasd_block *block, dasd_profile_start() argument
698 if (dasd_global_profile_level || block->profile.data) dasd_profile_start()
699 list_for_each(l, &block->ccw_queue) dasd_profile_start()
711 spin_lock(&block->profile.lock); dasd_profile_start()
712 if (block->profile.data) { dasd_profile_start()
713 block->profile.data->dasd_io_nr_req[counter]++; dasd_profile_start()
715 block->profile.data->dasd_read_nr_req[counter]++; dasd_profile_start()
717 spin_unlock(&block->profile.lock); dasd_profile_start()
798 static void dasd_profile_end(struct dasd_block *block, dasd_profile_end() argument
810 block->profile.data || dasd_profile_end()
837 cqr->startdev != block->base, dasd_profile_end()
847 spin_lock(&block->profile.lock); dasd_profile_end()
848 if (block->profile.data) dasd_profile_end()
849 dasd_profile_end_add_data(block->profile.data, dasd_profile_end()
850 cqr->startdev != block->base, dasd_profile_end()
857 spin_unlock(&block->profile.lock); dasd_profile_end()
862 cqr->startdev != block->base, dasd_profile_end()
1114 #define dasd_profile_start(block, cqr, req) do {} while (0)
1115 #define dasd_profile_end(block, cqr, req) do {} while (0)
1377 if (((cqr->block && dasd_start_IO()
1378 test_bit(DASD_FLAG_LOCK_STOLEN, &cqr->block->base->flags)) || dasd_start_IO()
1569 if (device->block) dasd_generic_handle_state_change()
1570 dasd_schedule_block_bh(device->block); dasd_generic_handle_state_change()
1740 if (!ref_cqr->block) __dasd_device_recovery()
1746 ref_cqr->block == cqr->block) { __dasd_device_recovery()
1788 struct dasd_block *block; __dasd_device_process_final_queue() local
1796 block = cqr->block; list_for_each_safe()
1799 if (block) list_for_each_safe()
1800 spin_lock_bh(&block->queue_lock); list_for_each_safe()
1821 if (block) list_for_each_safe()
1822 spin_unlock_bh(&block->queue_lock); list_for_each_safe()
1924 * device then all block layer requests must have been removed before
2396 if (device->block) dasd_sleep_on_immediatly()
2397 dasd_schedule_block_bh(device->block); dasd_sleep_on_immediatly()
2452 * Timeout function for dasd_block. This is used when the block layer
2459 struct dasd_block *block; dasd_block_timeout() local
2461 block = (struct dasd_block *) ptr; dasd_block_timeout()
2462 spin_lock_irqsave(get_ccwdev_lock(block->base->cdev), flags); dasd_block_timeout()
2464 dasd_device_remove_stop_bits(block->base, DASD_STOPPED_PENDING); dasd_block_timeout()
2465 spin_unlock_irqrestore(get_ccwdev_lock(block->base->cdev), flags); dasd_block_timeout()
2466 dasd_schedule_block_bh(block); dasd_block_timeout()
2472 void dasd_block_set_timer(struct dasd_block *block, int expires) dasd_block_set_timer() argument
2475 del_timer(&block->timer); dasd_block_set_timer()
2477 mod_timer(&block->timer, jiffies + expires); dasd_block_set_timer()
2484 void dasd_block_clear_timer(struct dasd_block *block) dasd_block_clear_timer() argument
2486 del_timer(&block->timer); dasd_block_clear_timer()
2507 * Fetch requests from the block device queue.
2509 static void __dasd_process_request_queue(struct dasd_block *block) __dasd_process_request_queue() argument
2516 queue = block->request_queue; __dasd_process_request_queue()
2517 basedev = block->base; __dasd_process_request_queue()
2523 * We requeue request from the block device queue to the ccw __dasd_process_request_queue()
2526 * for that. State DASD_STATE_ONLINE is normal block device __dasd_process_request_queue()
2530 while ((req = blk_fetch_request(block->request_queue))) __dasd_process_request_queue()
2560 cqr = basedev->discipline->build_cp(basedev, block, req); __dasd_process_request_queue()
2573 if (!list_empty(&block->ccw_queue)) __dasd_process_request_queue()
2581 dasd_block_set_timer(block, HZ/2); __dasd_process_request_queue()
2600 list_add_tail(&cqr->blocklist, &block->ccw_queue); __dasd_process_request_queue()
2602 dasd_profile_start(block, cqr, req); __dasd_process_request_queue()
2613 dasd_profile_end(cqr->block, cqr, req); __dasd_cleanup_cqr()
2614 status = cqr->block->base->discipline->free_cp(cqr, req); __dasd_cleanup_cqr()
2632 static void __dasd_process_block_ccw_queue(struct dasd_block *block, __dasd_process_block_ccw_queue() argument
2639 struct dasd_device *base = block->base; __dasd_process_block_ccw_queue()
2643 list_for_each_safe(l, n, &block->ccw_queue) { __dasd_process_block_ccw_queue()
2698 dasd_schedule_block_bh(cqr->block); dasd_return_cqr_cb()
2701 static void __dasd_block_start_head(struct dasd_block *block) __dasd_block_start_head() argument
2705 if (list_empty(&block->ccw_queue)) __dasd_block_start_head()
2711 list_for_each_entry(cqr, &block->ccw_queue, blocklist) { __dasd_block_start_head()
2714 if (test_bit(DASD_FLAG_LOCK_STOLEN, &block->base->flags) && __dasd_block_start_head()
2718 dasd_schedule_block_bh(block); __dasd_block_start_head()
2722 if (block->base->stopped & ~DASD_STOPPED_PENDING && __dasd_block_start_head()
2724 (!dasd_eer_enabled(block->base))) { __dasd_block_start_head()
2727 dasd_schedule_block_bh(block); __dasd_block_start_head()
2731 if (block->base->stopped) __dasd_block_start_head()
2736 cqr->startdev = block->base; __dasd_block_start_head()
2747 * block layer request queue, creates ccw requests, enqueues them on
2750 static void dasd_block_tasklet(struct dasd_block *block) dasd_block_tasklet() argument
2756 atomic_set(&block->tasklet_scheduled, 0); dasd_block_tasklet()
2758 spin_lock(&block->queue_lock); dasd_block_tasklet()
2760 __dasd_process_block_ccw_queue(block, &final_queue); dasd_block_tasklet()
2761 spin_unlock(&block->queue_lock); dasd_block_tasklet()
2763 spin_lock_irq(&block->request_queue_lock); dasd_block_tasklet()
2769 spin_lock(&block->queue_lock); dasd_block_tasklet()
2770 /* Get new request from the block device request queue */ dasd_block_tasklet()
2771 __dasd_process_request_queue(block); dasd_block_tasklet()
2773 __dasd_block_start_head(block); dasd_block_tasklet()
2774 spin_unlock(&block->queue_lock); dasd_block_tasklet()
2775 spin_unlock_irq(&block->request_queue_lock); dasd_block_tasklet()
2778 dasd_put_device(block->base); dasd_block_tasklet()
2787 * Requeue a request back to the block request queue
2788 * only works for block requests
2792 struct dasd_block *block = cqr->block; _dasd_requeue_request() local
2796 if (!block) _dasd_requeue_request()
2798 spin_lock_irqsave(&block->queue_lock, flags); _dasd_requeue_request()
2800 blk_requeue_request(block->request_queue, req); _dasd_requeue_request()
2801 spin_unlock_irqrestore(&block->queue_lock, flags); _dasd_requeue_request()
2809 * block layer.
2811 static int dasd_flush_block_queue(struct dasd_block *block) dasd_flush_block_queue() argument
2818 spin_lock_bh(&block->queue_lock); dasd_flush_block_queue()
2821 list_for_each_entry_safe(cqr, n, &block->ccw_queue, blocklist) { dasd_flush_block_queue()
2839 spin_unlock_bh(&block->queue_lock); dasd_flush_block_queue()
2846 spin_lock_bh(&block->queue_lock); dasd_flush_block_queue()
2847 __dasd_process_erp(block->base, cqr); dasd_flush_block_queue()
2848 spin_unlock_bh(&block->queue_lock); dasd_flush_block_queue()
2854 spin_lock_irq(&block->request_queue_lock); dasd_flush_block_queue()
2858 spin_unlock_irq(&block->request_queue_lock); dasd_flush_block_queue()
2866 void dasd_schedule_block_bh(struct dasd_block *block) dasd_schedule_block_bh() argument
2869 if (atomic_cmpxchg(&block->tasklet_scheduled, 0, 1) != 0) dasd_schedule_block_bh()
2871 /* life cycle of block is bound to it's base device */ dasd_schedule_block_bh()
2872 dasd_get_device(block->base); dasd_schedule_block_bh()
2873 tasklet_hi_schedule(&block->tasklet); dasd_schedule_block_bh()
2879 * SECTION: external block device operations
2888 struct dasd_block *block; do_dasd_request() local
2890 block = queue->queuedata; do_dasd_request()
2891 spin_lock(&block->queue_lock); do_dasd_request()
2892 /* Get new request from the block device request queue */ do_dasd_request()
2893 __dasd_process_request_queue(block); do_dasd_request()
2895 __dasd_block_start_head(block); do_dasd_request()
2896 spin_unlock(&block->queue_lock); do_dasd_request()
2900 * Block timeout callback, called from the block layer
2912 struct dasd_block *block = req->q->queuedata; dasd_times_out() local
2919 device = cqr->startdev ? cqr->startdev : block->base; dasd_times_out()
2926 spin_lock(&block->queue_lock); dasd_times_out()
2941 &block->ccw_queue, blocklist) { dasd_times_out()
2969 dasd_schedule_block_bh(block); dasd_times_out()
2970 spin_unlock(&block->queue_lock); dasd_times_out()
2978 static int dasd_alloc_queue(struct dasd_block *block) dasd_alloc_queue() argument
2980 block->request_queue = blk_init_queue(do_dasd_request, dasd_alloc_queue()
2981 &block->request_queue_lock); dasd_alloc_queue()
2982 if (block->request_queue == NULL) dasd_alloc_queue()
2985 block->request_queue->queuedata = block; dasd_alloc_queue()
2993 static void dasd_setup_queue(struct dasd_block *block) dasd_setup_queue() argument
2997 if (block->base->features & DASD_FEATURE_USERAW) { dasd_setup_queue()
3007 max = block->base->discipline->max_blocks << block->s2b_shift; dasd_setup_queue()
3009 blk_queue_logical_block_size(block->request_queue, dasd_setup_queue()
3010 block->bp_block); dasd_setup_queue()
3011 blk_queue_max_hw_sectors(block->request_queue, max); dasd_setup_queue()
3012 blk_queue_max_segments(block->request_queue, -1L); dasd_setup_queue()
3016 blk_queue_max_segment_size(block->request_queue, PAGE_SIZE); dasd_setup_queue()
3017 blk_queue_segment_boundary(block->request_queue, PAGE_SIZE - 1); dasd_setup_queue()
3023 static void dasd_free_queue(struct dasd_block *block) dasd_free_queue() argument
3025 if (block->request_queue) { dasd_free_queue()
3026 blk_cleanup_queue(block->request_queue); dasd_free_queue()
3027 block->request_queue = NULL; dasd_free_queue()
3034 static void dasd_flush_request_queue(struct dasd_block *block) dasd_flush_request_queue() argument
3038 if (!block->request_queue) dasd_flush_request_queue()
3041 spin_lock_irq(&block->request_queue_lock); dasd_flush_request_queue()
3042 while ((req = blk_fetch_request(block->request_queue))) dasd_flush_request_queue()
3044 spin_unlock_irq(&block->request_queue_lock); dasd_flush_request_queue()
3056 atomic_inc(&base->block->open_count); dasd_open()
3095 atomic_dec(&base->block->open_count); dasd_open()
3104 atomic_dec(&base->block->open_count); dasd_release()
3126 base->discipline->fill_geometry(base->block, geo); dasd_getgeo()
3127 geo->start = get_start_sect(bdev) >> base->block->s2b_shift; dasd_getgeo()
3143 * end of block device operations
3246 struct dasd_block *block; dasd_generic_remove() local
3269 block = device->block; dasd_generic_remove()
3272 * life cycle of block is bound to device, so delete it after dasd_generic_remove()
3275 if (block) dasd_generic_remove()
3276 dasd_free_block(block); dasd_generic_remove()
3322 /* check_device will allocate block device if necessary */ dasd_generic_set_online()
3339 if (device->block) dasd_generic_set_online()
3340 dasd_free_block(device->block); dasd_generic_set_online()
3356 struct dasd_block *block; dasd_generic_set_offline() local
3370 if (device->block) { dasd_generic_set_offline()
3371 max_count = device->block->bdev ? 0 : -1; dasd_generic_set_offline()
3372 open_count = atomic_read(&device->block->open_count); dasd_generic_set_offline()
3420 rc = fsync_bdev(device->block->bdev); dasd_generic_set_offline()
3435 block = device->block; dasd_generic_set_offline()
3438 * life cycle of block is bound to device, so delete it after dasd_generic_set_offline()
3441 if (block) dasd_generic_set_offline()
3442 dasd_free_block(block); dasd_generic_set_offline()
3493 if (device->block) dasd_generic_path_operational()
3494 dasd_schedule_block_bh(device->block); dasd_generic_path_operational()
3619 /* clear active requests and requeue them to block layer if possible */ dasd_generic_pm_freeze()
3648 block device requests */ dasd_generic_pm_freeze()
3652 /* remove requests from device and block queue */ dasd_generic_pm_freeze()
3656 /* remove the request from the block queue */ dasd_generic_pm_freeze()
3662 if (cqr->block) dasd_generic_pm_freeze()
3664 cqr->block->base->discipline->free_cp( dasd_generic_pm_freeze()
3710 if (device->block) dasd_generic_restore_device()
3711 dasd_schedule_block_bh(device->block); dasd_generic_restore_device()
3820 if (device->block) dasd_generic_shutdown()
3821 dasd_schedule_block_bh(device->block); dasd_generic_shutdown()
H A DMakefile2 # S/390 block devices
H A Ddasd_fba.c128 struct dasd_block *block; dasd_fba_check_characteristics() local
147 block = dasd_alloc_block(); dasd_fba_check_characteristics()
148 if (IS_ERR(block)) { dasd_fba_check_characteristics()
150 "dasd block structure"); dasd_fba_check_characteristics()
153 return PTR_ERR(block); dasd_fba_check_characteristics()
155 device->block = block; dasd_fba_check_characteristics()
156 block->base = device; dasd_fba_check_characteristics()
164 device->block = NULL; dasd_fba_check_characteristics()
165 dasd_free_block(block); dasd_fba_check_characteristics()
193 static int dasd_fba_do_analysis(struct dasd_block *block) dasd_fba_do_analysis() argument
198 private = (struct dasd_fba_private *) block->base->private; dasd_fba_do_analysis()
201 DBF_DEV_EVENT(DBF_WARNING, block->base, "unknown blocksize %d", dasd_fba_do_analysis()
205 block->blocks = private->rdc_data.blk_bdsa; dasd_fba_do_analysis()
206 block->bp_block = private->rdc_data.blk_size; dasd_fba_do_analysis()
207 block->s2b_shift = 0; /* bits to shift 512 to get a block */ dasd_fba_do_analysis()
209 block->s2b_shift++; dasd_fba_do_analysis()
213 static int dasd_fba_fill_geometry(struct dasd_block *block, dasd_fba_fill_geometry() argument
216 if (dasd_check_blocksize(block->bp_block) != 0) dasd_fba_fill_geometry()
218 geo->cylinders = (block->blocks << block->s2b_shift) >> 10; dasd_fba_fill_geometry()
220 geo->sectors = 128 >> block->s2b_shift; dasd_fba_fill_geometry()
254 struct dasd_block *block, dasd_fba_build_cp()
270 private = (struct dasd_fba_private *) block->base->private; dasd_fba_build_cp()
277 blksize = block->bp_block; dasd_fba_build_cp()
278 /* Calculate record id of first and last block. */ dasd_fba_build_cp()
279 first_rec = blk_rq_pos(req) >> block->s2b_shift; dasd_fba_build_cp()
281 (blk_rq_pos(req) + blk_rq_sectors(req) - 1) >> block->s2b_shift; dasd_fba_build_cp()
289 count += bv.bv_len >> (block->s2b_shift + 9); rq_for_each_segment()
316 block->bp_block, blk_rq_pos(req), blk_rq_sectors(req));
352 ccw->count = block->bp_block; rq_for_each_segment()
367 block->base->features & DASD_FEATURE_FAILFAST)
371 cqr->block = block;
392 private = (struct dasd_fba_private *) cqr->block->base->private; dasd_fba_free_cp()
393 blksize = cqr->block->bp_block; dasd_fba_free_cp()
581 * 24 bytes, the struct dasd_ccw_req has 136 bytes and each block can use
584 * locate record ccw for each block (stupid devices!) + 16 bytes of data.
253 dasd_fba_build_cp(struct dasd_device * memdev, struct dasd_block *block, struct request *req) dasd_fba_build_cp() argument
/linux-4.1.27/fs/squashfs/
H A Dfile_cache.c23 int squashfs_readpage_block(struct page *page, u64 block, int bsize) squashfs_readpage_block() argument
27 block, bsize); squashfs_readpage_block()
31 ERROR("Unable to read page, block %llx, size %x\n", block, squashfs_readpage_block()
H A Dnamei.c30 * decompressed block (<block, offset>).
35 * compressed metadata block, and therefore, can share the start block.
37 * header containing the shared start block value, and a sequence of directory
38 * entries, each of which share the shared start block. A new directory header
39 * is written once/if the inode start block changes. The directory
45 * in each metadata block. Directories are sorted in alphabetical order,
48 * location of the metadata block the filename is in has been found.
49 * The general idea of the index is ensure only one metadata block needs to be
70 * block containing it, and the directory index this represents.
130 * Return index (f_pos) of the looked up metadata block. Translate get_dir_index_using_name()
148 u64 block = squashfs_i(dir)->start + msblk->directory_table; squashfs_lookup() local
153 TRACE("Entered squashfs_lookup [%llx:%x]\n", block, offset); squashfs_lookup()
166 length = get_dir_index_using_name(dir->i_sb, &block, &offset, squashfs_lookup()
175 err = squashfs_read_metadata(dir->i_sb, &dirh, &block, squashfs_lookup()
191 err = squashfs_read_metadata(dir->i_sb, dire, &block, squashfs_lookup()
203 &block, &offset, size); squashfs_lookup()
239 ERROR("Unable to read directory block [%llx:%x]\n", squashfs_lookup()
H A Dinode.c28 * location of the compressed metadata block containing the inode, and the byte
29 * offset into that block where the inode is placed (<block, offset>).
116 u64 block = SQUASHFS_INODE_BLK(ino) + msblk->inode_table; squashfs_read_inode() local
127 err = squashfs_read_metadata(sb, sqshb_ino, &block, squashfs_read_inode()
136 block = SQUASHFS_INODE_BLK(ino) + msblk->inode_table; squashfs_read_inode()
147 err = squashfs_read_metadata(sb, sqsh_ino, &block, &offset, squashfs_read_inode()
175 squashfs_i(inode)->block_list_start = block; squashfs_read_inode()
181 offset, squashfs_i(inode)->start, block, offset); squashfs_read_inode()
190 err = squashfs_read_metadata(sb, sqsh_ino, &block, &offset, squashfs_read_inode()
222 squashfs_i(inode)->block_list_start = block; squashfs_read_inode()
228 offset, squashfs_i(inode)->start, block, offset); squashfs_read_inode()
234 err = squashfs_read_metadata(sb, sqsh_ino, &block, &offset, squashfs_read_inode()
258 err = squashfs_read_metadata(sb, sqsh_ino, &block, &offset, squashfs_read_inode()
271 squashfs_i(inode)->dir_idx_start = block; squashfs_read_inode()
286 err = squashfs_read_metadata(sb, sqsh_ino, &block, &offset, squashfs_read_inode()
296 squashfs_i(inode)->start = block; squashfs_read_inode()
302 err = squashfs_read_metadata(sb, NULL, &block, squashfs_read_inode()
306 err = squashfs_read_metadata(sb, &xattr, &block, squashfs_read_inode()
315 block, offset); squashfs_read_inode()
323 err = squashfs_read_metadata(sb, sqsh_ino, &block, &offset, squashfs_read_inode()
345 err = squashfs_read_metadata(sb, sqsh_ino, &block, &offset, squashfs_read_inode()
368 err = squashfs_read_metadata(sb, sqsh_ino, &block, &offset, squashfs_read_inode()
385 err = squashfs_read_metadata(sb, sqsh_ino, &block, &offset, squashfs_read_inode()
H A Dfile.c27 * compressed fragment block (tail-end packed block). The compressed size
28 * of each datablock is stored in a block list contained within the
33 * block index to datablock location on disk.
36 * retaining a simple and space-efficient block list on disk. The cache
170 * Read the next n blocks from the block list, starting from
171 * metadata block <start_block, offset>.
177 long long block = 0; read_indexes() local
191 ERROR("read_indexes: reading block [%llx:%x]\n", read_indexes()
198 block += SQUASHFS_COMPRESSED_SIZE_BLOCK(size); read_indexes()
204 return block; read_indexes()
214 * can cache one index -> datablock/blocklist-block mapping. We wish
233 * on-disk locations of the datablock and block list metadata block
278 * If necessary grow cache slot by reading block list. Cache fill_meta_index()
335 static int read_blocklist(struct inode *inode, int index, u64 *block) read_blocklist() argument
341 int res = fill_meta_index(inode, index, &start, &offset, block); read_blocklist()
344 " 0x%x, block 0x%llx\n", res, index, start, offset, read_blocklist()
345 *block); read_blocklist()
354 * extra block indexes needed. read_blocklist()
360 *block += blks; read_blocklist()
364 * Read length of block specified by index. read_blocklist()
385 * many PAGE_CACHE_SIZE pages (default block size is 128 KiB) explicitly squashfs_copy_cache()
418 /* Read datablock stored packed inside a fragment (tail-end packed block) */ squashfs_readpage_fragment()
429 ERROR("Unable to read page, block %llx, size %x\n", squashfs_readpage_fragment()
462 TRACE("Entered squashfs_readpage, page index %lx, start block %llx\n", squashfs_readpage()
471 u64 block = 0; squashfs_readpage() local
472 int bsize = read_blocklist(inode, index, &block); squashfs_readpage()
479 res = squashfs_readpage_block(page, block, bsize); squashfs_readpage()
H A Dblock.c21 * block.c
42 * Read the metadata block length, this is stored in the first two
43 * bytes of the metadata block.
82 * Read and decompress a metadata block or datablock. Length is non-zero
85 * the metadata block. A bit in the length field indicates if the block
87 * generated a larger block - this does occasionally happen with compression
130 * Metadata block. squashfs_read_data()
210 ERROR("squashfs_read_data failed to read block 0x%llx\n", squashfs_read_data()
H A Dfile_direct.c23 static int squashfs_read_cache(struct page *target_page, u64 block, int bsize,
27 int squashfs_readpage_block(struct page *target_page, u64 block, int bsize) squashfs_readpage_block() argument
59 /* Try to grab all the pages covered by the Squashfs block */ squashfs_readpage_block()
85 res = squashfs_read_cache(target_page, block, bsize, pages, squashfs_readpage_block()
94 res = squashfs_read_data(inode->i_sb, block, bsize, NULL, actor); squashfs_readpage_block()
140 static int squashfs_read_cache(struct page *target_page, u64 block, int bsize, squashfs_read_cache() argument
145 block, bsize); squashfs_read_cache()
150 ERROR("Unable to read page, block %llx, size %x\n", block, squashfs_read_cache()
H A Dsymlink.c52 u64 block = squashfs_i(inode)->start; squashfs_symlink_readpage() local
59 TRACE("Entered squashfs_symlink_readpage, page index %ld, start block " squashfs_symlink_readpage()
60 "%llx, offset %x\n", page->index, block, offset); squashfs_symlink_readpage()
66 bytes = squashfs_read_metadata(sb, NULL, &block, &offset, squashfs_symlink_readpage()
84 entry = squashfs_cache_get(sb, msblk->block_cache, block, 0); squashfs_symlink_readpage()
99 block = entry->next_index; squashfs_symlink_readpage()
H A Dcache.c62 * Look-up block in cache, and increment usage count. If not in cache, read
66 struct squashfs_cache *cache, u64 block, int length) squashfs_cache_get()
75 if (cache->entry[i].block == block) { squashfs_cache_get()
116 entry->block = block; squashfs_cache_get()
123 entry->length = squashfs_read_data(sb, block, length, squashfs_cache_get()
173 TRACE("Got %s %d, start block %lld, refcount %d, error %d\n", squashfs_cache_get()
174 cache->name, i, entry->block, entry->refcount, entry->error); squashfs_cache_get()
178 block); squashfs_cache_get()
195 * If there's any processes waiting for a block to become squashfs_cache_put()
270 entry->block = SQUASHFS_INVALID_BLK; squashfs_cache_init()
339 * Read length bytes from metadata position <block, offset> (block is the
340 * start of the compressed block on disk, and offset is the offset into
341 * the block once decompressed). Data is packed into consecutive blocks,
342 * and length bytes may require reading more than one block.
345 u64 *block, int *offset, int length) squashfs_read_metadata()
351 TRACE("Entered squashfs_read_metadata [%llx:%x]\n", *block, *offset); squashfs_read_metadata()
354 entry = squashfs_cache_get(sb, msblk->block_cache, *block, 0); squashfs_read_metadata()
370 *block = entry->next_index; squashfs_read_metadata()
416 void *squashfs_read_table(struct super_block *sb, u64 block, int length) squashfs_read_table() argument
442 res = squashfs_read_data(sb, block, length | squashfs_read_table()
65 squashfs_cache_get(struct super_block *sb, struct squashfs_cache *cache, u64 block, int length) squashfs_cache_get() argument
344 squashfs_read_metadata(struct super_block *sb, void *buffer, u64 *block, int *offset, int length) squashfs_read_metadata() argument
/linux-4.1.27/include/crypto/
H A Dmd5.h13 u32 block[MD5_BLOCK_WORDS]; member in struct:md5_state
/linux-4.1.27/drivers/video/fbdev/core/
H A Dfbmon.c96 static int edid_is_serial_block(unsigned char *block) edid_is_serial_block() argument
98 if ((block[0] == 0x00) && (block[1] == 0x00) && edid_is_serial_block()
99 (block[2] == 0x00) && (block[3] == 0xff) && edid_is_serial_block()
100 (block[4] == 0x00)) edid_is_serial_block()
106 static int edid_is_ascii_block(unsigned char *block) edid_is_ascii_block() argument
108 if ((block[0] == 0x00) && (block[1] == 0x00) && edid_is_ascii_block()
109 (block[2] == 0x00) && (block[3] == 0xfe) && edid_is_ascii_block()
110 (block[4] == 0x00)) edid_is_ascii_block()
116 static int edid_is_limits_block(unsigned char *block) edid_is_limits_block() argument
118 if ((block[0] == 0x00) && (block[1] == 0x00) && edid_is_limits_block()
119 (block[2] == 0x00) && (block[3] == 0xfd) && edid_is_limits_block()
120 (block[4] == 0x00)) edid_is_limits_block()
126 static int edid_is_monitor_block(unsigned char *block) edid_is_monitor_block() argument
128 if ((block[0] == 0x00) && (block[1] == 0x00) && edid_is_monitor_block()
129 (block[2] == 0x00) && (block[3] == 0xfc) && edid_is_monitor_block()
130 (block[4] == 0x00)) edid_is_monitor_block()
136 static int edid_is_timing_block(unsigned char *block) edid_is_timing_block() argument
138 if ((block[0] != 0x00) || (block[1] != 0x00) || edid_is_timing_block()
139 (block[2] != 0x00) || (block[4] != 0x00)) edid_is_timing_block()
147 unsigned char *block = edid + ID_MANUFACTURER_NAME, manufacturer[4]; check_edid() local
152 manufacturer[0] = ((block[0] & 0x7c) >> 2) + '@'; check_edid()
153 manufacturer[1] = ((block[0] & 0x03) << 3) + check_edid()
154 ((block[1] & 0xe0) >> 5) + '@'; check_edid()
155 manufacturer[2] = (block[1] & 0x1f) + '@'; check_edid()
157 model = block[2] + (block[3] << 8); check_edid()
292 static void parse_vendor_block(unsigned char *block, struct fb_monspecs *specs) parse_vendor_block() argument
294 specs->manufacturer[0] = ((block[0] & 0x7c) >> 2) + '@'; parse_vendor_block()
295 specs->manufacturer[1] = ((block[0] & 0x03) << 3) + parse_vendor_block()
296 ((block[1] & 0xe0) >> 5) + '@'; parse_vendor_block()
297 specs->manufacturer[2] = (block[1] & 0x1f) + '@'; parse_vendor_block()
299 specs->model = block[2] + (block[3] << 8); parse_vendor_block()
300 specs->serial = block[4] + (block[5] << 8) + parse_vendor_block()
301 (block[6] << 16) + (block[7] << 24); parse_vendor_block()
302 specs->year = block[9] + 1990; parse_vendor_block()
303 specs->week = block[8]; parse_vendor_block()
326 static void get_chroma(unsigned char *block, struct fb_monspecs *specs) get_chroma() argument
332 tmp = ((block[5] & (3 << 6)) >> 6) | (block[0x7] << 2); get_chroma()
338 tmp = ((block[5] & (3 << 4)) >> 4) | (block[0x8] << 2); get_chroma()
344 tmp = ((block[5] & (3 << 2)) >> 2) | (block[0x9] << 2); get_chroma()
350 tmp = (block[5] & 3) | (block[0xa] << 2); get_chroma()
356 tmp = ((block[6] & (3 << 6)) >> 6) | (block[0xb] << 2); get_chroma()
362 tmp = ((block[6] & (3 << 4)) >> 4) | (block[0xc] << 2); get_chroma()
368 tmp = ((block[6] & (3 << 2)) >> 2) | (block[0xd] << 2); get_chroma()
374 tmp = (block[6] & 3) | (block[0xe] << 2); get_chroma()
409 static int get_est_timing(unsigned char *block, struct fb_videomode *mode) get_est_timing() argument
414 c = block[0]; get_est_timing()
451 c = block[1]; get_est_timing()
485 c = block[2]; get_est_timing()
494 static int get_std_timing(unsigned char *block, struct fb_videomode *mode, get_std_timing() argument
500 u32 std_2byte_code = block[0] << 8 | block[1]; get_std_timing()
514 xres = (block[0] + 31) * 8; get_std_timing()
518 ratio = (block[1] & 0xc0) >> 6; get_std_timing()
537 refresh = (block[1] & 0x3f) + 60; get_std_timing()
553 static int get_dst_timing(unsigned char *block, struct fb_videomode *mode, get_dst_timing() argument
558 for (j = 0; j < 6; j++, block += STD_TIMING_DESCRIPTION_SIZE) get_dst_timing()
559 num += get_std_timing(block, &mode[num], ver, rev, specs); get_dst_timing()
564 static void get_detailed_timing(unsigned char *block, get_detailed_timing() argument
619 unsigned char *block; fb_create_modedb() local
639 block = edid + DETAILED_TIMING_DESCRIPTIONS_START; fb_create_modedb()
640 for (i = 0; i < 4; i++, block+= DETAILED_TIMING_DESCRIPTION_SIZE) { fb_create_modedb()
641 if (!(block[0] == 0x00 && block[1] == 0x00)) { fb_create_modedb()
642 get_detailed_timing(block, &mode[num]); fb_create_modedb()
652 block = edid + ESTABLISHED_TIMING_1; fb_create_modedb()
653 num += get_est_timing(block, &mode[num]); fb_create_modedb()
656 block = edid + STD_TIMING_DESCRIPTIONS_START; fb_create_modedb()
657 for (i = 0; i < STD_TIMING; i++, block += STD_TIMING_DESCRIPTION_SIZE) fb_create_modedb()
658 num += get_std_timing(block, &mode[num], ver, rev, specs); fb_create_modedb()
660 block = edid + DETAILED_TIMING_DESCRIPTIONS_START; fb_create_modedb()
661 for (i = 0; i < 4; i++, block+= DETAILED_TIMING_DESCRIPTION_SIZE) { fb_create_modedb()
662 if (block[0] == 0x00 && block[1] == 0x00 && block[3] == 0xfa) fb_create_modedb()
663 num += get_dst_timing(block + 5, &mode[num], fb_create_modedb()
697 unsigned char *block; fb_get_monitor_limits() local
699 block = edid + DETAILED_TIMING_DESCRIPTIONS_START; fb_get_monitor_limits()
703 for (i = 0; i < 4; i++, block += DETAILED_TIMING_DESCRIPTION_SIZE) { fb_get_monitor_limits()
704 if (edid_is_limits_block(block)) { fb_get_monitor_limits()
777 unsigned char c, *block; get_monspecs() local
779 block = edid + EDID_STRUCT_DISPLAY; get_monspecs()
783 c = block[0] & 0x80; get_monspecs()
790 switch ((block[0] & 0x60) >> 5) { get_monspecs()
810 c = block[0] & 0x10; get_monspecs()
813 c = block[0] & 0x0f; get_monspecs()
836 specs->max_x = block[1]; get_monspecs()
837 specs->max_y = block[2]; get_monspecs()
849 c = block[3]; get_monspecs()
854 get_dpms_capabilities(block[4], specs); get_monspecs()
856 switch ((block[4] & 0x18) >> 3) { get_monspecs()
875 get_chroma(block, specs); get_monspecs()
878 c = block[4] & 0x7; get_monspecs()
896 unsigned char *block; fb_parse_edid() local
907 block = edid + DETAILED_TIMING_DESCRIPTIONS_START; fb_parse_edid()
909 for (i = 0; i < 4; i++, block += DETAILED_TIMING_DESCRIPTION_SIZE) { fb_parse_edid()
910 if (edid_is_timing_block(block)) { fb_parse_edid()
938 unsigned char *block; fb_edid_to_monspecs() local
963 block = edid + DETAILED_TIMING_DESCRIPTIONS_START; fb_edid_to_monspecs()
964 for (i = 0; i < 4; i++, block += DETAILED_TIMING_DESCRIPTION_SIZE) { fb_edid_to_monspecs()
965 if (edid_is_serial_block(block)) { fb_edid_to_monspecs()
966 copy_string(block, specs->serial_no); fb_edid_to_monspecs()
968 } else if (edid_is_ascii_block(block)) { fb_edid_to_monspecs()
969 copy_string(block, specs->ascii); fb_edid_to_monspecs()
971 } else if (edid_is_monitor_block(block)) { fb_edid_to_monspecs()
972 copy_string(block, specs->monitor); fb_edid_to_monspecs()
1002 * @edid: 128 byte array with an E-EDID block
1007 unsigned char *block; fb_edid_add_monspecs() local
1027 pr_debug("Data block %u of %u bytes\n", type, len); fb_edid_add_monspecs()
1045 block = edid + edid[2]; fb_edid_add_monspecs()
1050 i++, block += DETAILED_TIMING_DESCRIPTION_SIZE) fb_edid_add_monspecs()
1052 edt[num++] = block - edid; fb_edid_add_monspecs()
1578 * We need to ensure that the EDID block is only returned for
H A Dfb_notify.c21 * @nb: notifier block to callback on events
31 * @nb: notifier block to callback on events
/linux-4.1.27/sound/soc/intel/common/
H A Dsst-firmware.c118 struct sst_mem_block *block, *tmp; block_list_remove() local
121 /* disable each block */ list_for_each_entry()
122 list_for_each_entry(block, block_list, module_list) { list_for_each_entry()
124 if (block->ops && block->ops->disable) { list_for_each_entry()
125 err = block->ops->disable(block); list_for_each_entry()
128 "error: cant disable block %d:%d\n", list_for_each_entry()
129 block->type, block->index); list_for_each_entry()
133 /* mark each block as free */ list_for_each_entry_safe()
134 list_for_each_entry_safe(block, tmp, block_list, module_list) { list_for_each_entry_safe()
135 list_del(&block->module_list); list_for_each_entry_safe()
136 list_move(&block->list, &dsp->free_block_list); list_for_each_entry_safe()
137 dev_dbg(dsp->dev, "block freed %d:%d at offset 0x%x\n", list_for_each_entry_safe()
138 block->type, block->index, block->offset); list_for_each_entry_safe()
142 /* prepare the memory block to receive data from host - callers hold locks */ block_list_prepare()
146 struct sst_mem_block *block; block_list_prepare() local
149 /* enable each block so that's it'e ready for data */ list_for_each_entry()
150 list_for_each_entry(block, block_list, module_list) { list_for_each_entry()
152 if (block->ops && block->ops->enable && !block->users) { list_for_each_entry()
153 ret = block->ops->enable(block); list_for_each_entry()
156 "error: cant disable block %d:%d\n", list_for_each_entry()
157 block->type, block->index); list_for_each_entry()
165 list_for_each_entry(block, block_list, module_list) { list_for_each_entry()
166 if (block->ops && block->ops->disable) list_for_each_entry()
167 block->ops->disable(block); list_for_each_entry()
564 struct sst_mem_block *block; find_block() local
566 list_for_each_entry(block, &dsp->free_block_list, list) { find_block()
567 if (block->type == ba->type && block->offset == ba->offset) find_block()
568 return block; find_block()
574 /* Block allocator must be on block boundary */ block_alloc_contiguous()
579 struct sst_mem_block *block; block_alloc_contiguous() local
585 block = find_block(dsp, ba); block_alloc_contiguous()
586 if (!block) { block_alloc_contiguous()
594 list_move_tail(&block->list, &tmp); block_alloc_contiguous()
595 ba->offset += block->size; block_alloc_contiguous()
596 ba->size -= block->size; block_alloc_contiguous()
601 list_for_each_entry(block, &tmp, list) { block_alloc_contiguous()
603 if (block->offset < block_start) block_alloc_contiguous()
604 block_start = block->offset; block_alloc_contiguous()
606 list_add(&block->module_list, block_list); block_alloc_contiguous()
608 dev_dbg(dsp->dev, "block allocated %d:%d at offset 0x%x\n", block_alloc_contiguous()
609 block->type, block->index, block->offset); block_alloc_contiguous()
620 struct sst_mem_block *block, *tmp; block_alloc() local
627 list_for_each_entry_safe(block, tmp, &dsp->free_block_list, list) { block_alloc()
630 if (block->type != ba->type) block_alloc()
633 if (ba->size > block->size) block_alloc()
636 ba->offset = block->offset; block_alloc()
637 block->bytes_used = ba->size % block->size; block_alloc()
638 list_add(&block->module_list, block_list); block_alloc()
639 list_move(&block->list, &dsp->used_block_list); block_alloc()
640 dev_dbg(dsp->dev, "block allocated %d:%d at offset 0x%x\n", block_alloc()
641 block->type, block->index, block->offset); block_alloc()
646 list_for_each_entry_safe(block, tmp, &dsp->free_block_list, list) { block_alloc()
649 if (block->type != ba->type) block_alloc()
653 if (ba->size > block->size) { block_alloc()
655 /* align ba to block boundary */ block_alloc()
656 ba->offset = block->offset; block_alloc()
665 /* not enough free block space */ block_alloc()
674 dev_dbg(dsp->dev, "block request 0x%x bytes at offset 0x%x type %d\n", sst_alloc_blocks()
709 struct sst_mem_block *block, *tmp; block_alloc_fixed() local
719 list_for_each_entry_safe(block, tmp, block_list, module_list) { list_for_each_entry_safe()
722 if (block->type != ba->type) list_for_each_entry_safe()
725 block_end = block->offset + block->size; list_for_each_entry_safe()
727 /* find block that holds section */ list_for_each_entry_safe()
728 if (ba->offset >= block->offset && end <= block_end) list_for_each_entry_safe()
731 /* does block span more than 1 section */ list_for_each_entry_safe()
732 if (ba->offset >= block->offset && ba->offset < block_end) { list_for_each_entry_safe()
734 /* align ba to block boundary */ list_for_each_entry_safe()
747 list_for_each_entry_safe(block, tmp, &dsp->free_block_list, list) {
748 block_end = block->offset + block->size;
751 if (block->type != ba->type)
754 /* find block that holds section */
755 if (ba->offset >= block->offset && end <= block_end) {
757 /* add block */
758 list_move(&block->list, &dsp->used_block_list);
759 list_add(&block->module_list, block_list);
760 dev_dbg(dsp->dev, "block allocated %d:%d at offset 0x%x\n",
761 block->type, block->index, block->offset);
765 /* does block span more than 1 section */
766 if (ba->offset >= block->offset && ba->offset < block_end) {
768 /* add block */
769 list_move(&block->list, &dsp->used_block_list);
770 list_add(&block->module_list, block_list);
771 /* align ba to block boundary */
799 dev_dbg(dsp->dev, "block request 0x%x bytes at offset 0x%x type %d\n", sst_module_alloc_blocks()
879 dev_dbg(dsp->dev, "persistent fixed block request 0x%x bytes type %d offset 0x%x\n", sst_module_runtime_alloc_blocks()
886 dev_dbg(dsp->dev, "persistent block request 0x%x bytes type %d\n", sst_module_runtime_alloc_blocks()
904 dev_err(dsp->dev, "error: runtime block prepare failed\n"); sst_module_runtime_alloc_blocks()
1021 /* register a DSP memory block for use with FW based modules */ sst_mem_block_register()
1026 struct sst_mem_block *block; sst_mem_block_register() local
1028 block = kzalloc(sizeof(*block), GFP_KERNEL); sst_mem_block_register()
1029 if (block == NULL) sst_mem_block_register()
1032 block->offset = offset; sst_mem_block_register()
1033 block->size = size; sst_mem_block_register()
1034 block->index = index; sst_mem_block_register()
1035 block->type = type; sst_mem_block_register()
1036 block->dsp = dsp; sst_mem_block_register()
1037 block->private = private; sst_mem_block_register()
1038 block->ops = ops; sst_mem_block_register()
1041 list_add(&block->list, &dsp->free_block_list); sst_mem_block_register()
1044 return block; sst_mem_block_register()
1051 struct sst_mem_block *block, *tmp; sst_mem_block_unregister_all() local
1056 list_for_each_entry_safe(block, tmp, &dsp->used_block_list, list) { sst_mem_block_unregister_all()
1057 list_del(&block->list); sst_mem_block_unregister_all()
1058 kfree(block); sst_mem_block_unregister_all()
1062 list_for_each_entry_safe(block, tmp, &dsp->free_block_list, list) { sst_mem_block_unregister_all()
1063 list_del(&block->list); sst_mem_block_unregister_all()
1064 kfree(block); sst_mem_block_unregister_all()
1107 dev_dbg(dsp->dev, "block request 0x%x bytes type %d at 0x%x\n", sst_block_alloc_scratch()
1116 dev_dbg(dsp->dev, "block request 0x%x bytes type %d\n", sst_block_alloc_scratch()
1130 dev_err(dsp->dev, "error: scratch block prepare failed\n"); sst_block_alloc_scratch()
1190 /* returns block address in DSP address space */ sst_dsp_get_offset()
/linux-4.1.27/fs/sysv/
H A Dballoc.c40 /* NOTE NOTE NOTE: nr is a block number _as_ _stored_ _on_ _disk_ */
48 unsigned block = fs32_to_cpu(sbi, nr); sysv_free_block() local
58 if (block < sbi->s_firstdatazone || block >= sbi->s_nzones) { sysv_free_block()
59 printk("sysv_free_block: trying to free block not in datazone\n"); sysv_free_block()
71 /* If the free list head in super-block is full, it is copied sysv_free_block()
72 * into this block being freed, ditto if it's completely empty sysv_free_block()
76 block += sbi->s_block_base; sysv_free_block()
77 bh = sb_getblk(sb, block); sysv_free_block()
102 unsigned int block; sysv_new_block() local
116 block = fs32_to_cpu(sbi, nr); sysv_new_block()
120 if (block < sbi->s_firstdatazone || block >= sbi->s_nzones) { sysv_new_block()
121 printk("sysv_new_block: new block %d is not in data zone\n", sysv_new_block()
122 block); sysv_new_block()
126 if (count == 0) { /* the last block continues the free list */ sysv_new_block()
129 block += sbi->s_block_base; sysv_new_block()
130 if (!(bh = sb_bread(sb, block))) { sysv_new_block()
131 printk("sysv_new_block: cannot read free-list block\n"); sysv_new_block()
132 /* retry this same block next time */ sysv_new_block()
138 printk("sysv_new_block: free-list block with >flc_size entries\n"); sysv_new_block()
165 unsigned block; sysv_count_free_blocks() local
171 * lie and say it has no free block at all. sysv_count_free_blocks()
196 block = fs32_to_cpu(sbi, zone); sysv_count_free_blocks()
200 if (block < sbi->s_firstdatazone || block >= sbi->s_nzones) sysv_count_free_blocks()
202 block += sbi->s_block_base; sysv_count_free_blocks()
203 bh = sb_bread(sb, block); sysv_count_free_blocks()
218 printk("sysv_count_free_blocks: new block %d is not in data zone\n", sysv_count_free_blocks()
219 block); sysv_count_free_blocks()
222 printk("sysv_count_free_blocks: cannot read free-list block\n"); sysv_count_free_blocks()
225 printk("sysv_count_free_blocks: >flc_size entries in free-list block\n"); sysv_count_free_blocks()
232 printk("sysv_count_free_blocks: free block count was %d, " sysv_count_free_blocks()
H A Ditree.c22 static int block_to_path(struct inode *inode, long block, int offsets[DEPTH]) block_to_path() argument
31 if (block < 0) { block_to_path()
32 printk("sysv_block_map: block < 0\n"); block_to_path()
33 } else if (block < DIRECT) { block_to_path()
34 offsets[n++] = block; block_to_path()
35 } else if ( (block -= DIRECT) < indirect_blocks) { block_to_path()
37 offsets[n++] = block; block_to_path()
38 } else if ((block -= indirect_blocks) < double_blocks) { block_to_path()
40 offsets[n++] = block >> ptrs_bits; block_to_path()
41 offsets[n++] = block & (indirect_blocks - 1); block_to_path()
42 } else if (((block -= double_blocks) >> (ptrs_bits * 2)) < indirect_blocks) { block_to_path()
44 offsets[n++] = block >> (ptrs_bits * 2); block_to_path()
45 offsets[n++] = (block >> ptrs_bits) & (indirect_blocks - 1); block_to_path()
46 offsets[n++] = block & (indirect_blocks - 1); block_to_path()
102 int block = block_to_cpu(SYSV_SB(sb), p->key); get_branch() local
103 bh = sb_bread(sb, block); get_branch()
137 /* Allocate the next block */ alloc_branch()
142 * Get buffer_head for parent block, zero it out and set alloc_branch()
183 /* had we spliced it onto indirect block? */ splice_branch()
220 /* Simplest case - block found, no allocation needed */ get_block()
230 /* Next simple case - plain lookup or failed read of indirect block */ get_block()
242 * Indirect block might be removed by truncate while we were get_block()
304 * OK, we've found the last block that must survive. The rest of our find_shared()
344 int block; free_branches() local
349 block = block_to_cpu(SYSV_SB(sb), nr); free_branches()
350 bh = sb_bread(sb, block); free_branches()
490 static sector_t sysv_bmap(struct address_space *mapping, sector_t block) sysv_bmap() argument
492 return generic_block_bmap(mapping,block,get_block); sysv_bmap()
H A Dinode.c42 * If we are going to write out the super block, sysv_sync_fs()
184 unsigned int block; sysv_iget() local
219 for (block = 0; block < 10+1+1+1; block++) sysv_iget()
220 read3byte(sbi, &raw_inode->i_data[3*block], sysv_iget()
221 (u8 *)&si->i_data[block]); sysv_iget()
244 unsigned int ino, block; __sysv_write_inode() local
255 printk("unable to read i-node block\n"); __sysv_write_inode()
271 for (block = 0; block < 10+1+1+1; block++) __sysv_write_inode()
272 write3byte(sbi, (u8 *)&si->i_data[block], __sysv_write_inode()
273 &raw_inode->i_data[3*block]); __sysv_write_inode()
/linux-4.1.27/arch/x86/platform/intel-mid/device_libs/
H A Dplatform_msic.c72 * msic_generic_platform_data - sets generic platform data for the block
73 * @info: pointer to the SFI device table entry for this block
74 * @block: MSIC block
79 void *msic_generic_platform_data(void *info, enum intel_msic_block block) msic_generic_platform_data() argument
83 BUG_ON(block < 0 || block >= INTEL_MSIC_BLOCK_LAST); msic_generic_platform_data()
84 msic_pdata.irq[block] = entry->irq; msic_generic_platform_data()
/linux-4.1.27/include/linux/
H A Dmigrate_mode.h4 * MIGRATE_ASYNC means never block
8 * MIGRATE_SYNC will block when migrating pages
H A Dsysv_fs.h25 /* Xenix super-block data on disk */
27 #define XENIX_NICFREE 100 /* number of free block list chunk entries */
31 /* the start of the free block list: */
33 sysv_zone_t s_free[XENIX_NICFREE]; /* first free block list chunk */
38 char s_flock; /* lock during free block list manipulation */
40 char s_fmod; /* super-block modified flag */
42 __fs32 s_time __packed2__; /* time of last super block update */
63 #define SYSV_NICFREE 50 /* number of free block list chunk entries */
65 /* SystemV4 super-block data on disk */
70 /* the start of the free block list: */
73 sysv_zone_t s_free[SYSV_NICFREE]; /* first free block list chunk */
79 char s_flock; /* lock during free block list manipulation */
81 char s_fmod; /* super-block modified flag */
83 __fs32 s_time; /* time of last super block update */
97 /* SystemV2 super-block data on disk */
101 /* the start of the free block list: */
103 sysv_zone_t s_free[SYSV_NICFREE]; /* first free block list chunk */
108 char s_flock; /* lock during free block list manipulation */
110 char s_fmod; /* super-block modified flag */
112 __fs32 s_time __packed2__; /* time of last super block update */
125 /* V7 super-block data on disk */
127 #define V7_NICFREE 50 /* number of free block list chunk entries */
131 /* the start of the free block list: */
133 sysv_zone_t s_free[V7_NICFREE]; /* first free block list chunk */
138 char s_flock; /* lock during free block list manipulation */
140 char s_fmod; /* super-block modified flag */
142 __fs32 s_time __packed2__; /* time of last super block update */
158 /* The disk addresses are three-byte (despite direct block addresses being
163 /* Coherent super-block data on disk */
165 #define COH_NICFREE 64 /* number of free block list chunk entries */
169 /* the start of the free block list: */
171 sysv_zone_t s_free[COH_NICFREE] __packed2__; /* first free block list chunk */
176 char s_flock; /* lock during free block list manipulation */
178 char s_fmod; /* super-block modified flag */
180 __fs32 s_time __packed2__; /* time of last super block update */
H A Dbuffer_head.h54 * Historically, a buffer_head was used to map a single block
56 * filesystem and block layers. Nowadays the basic I/O unit
57 * is the bio, and buffer_heads are used for extracting block
67 sector_t b_blocknr; /* start block number */
171 void unmap_underlying_metadata(struct block_device *bdev, sector_t block);
176 struct buffer_head *__find_get_block(struct block_device *bdev, sector_t block,
178 struct buffer_head *__getblk_gfp(struct block_device *bdev, sector_t block,
182 void __breadahead(struct block_device *, sector_t block, unsigned int size);
184 sector_t block, unsigned size, gfp_t gfp);
297 sb_bread(struct super_block *sb, sector_t block) sb_bread() argument
299 return __bread_gfp(sb->s_bdev, block, sb->s_blocksize, __GFP_MOVABLE); sb_bread()
303 sb_bread_unmovable(struct super_block *sb, sector_t block) sb_bread_unmovable() argument
305 return __bread_gfp(sb->s_bdev, block, sb->s_blocksize, 0); sb_bread_unmovable()
309 sb_breadahead(struct super_block *sb, sector_t block) sb_breadahead() argument
311 __breadahead(sb->s_bdev, block, sb->s_blocksize); sb_breadahead()
315 sb_getblk(struct super_block *sb, sector_t block) sb_getblk() argument
317 return __getblk_gfp(sb->s_bdev, block, sb->s_blocksize, __GFP_MOVABLE); sb_getblk()
322 sb_getblk_gfp(struct super_block *sb, sector_t block, gfp_t gfp) sb_getblk_gfp() argument
324 return __getblk_gfp(sb->s_bdev, block, sb->s_blocksize, gfp); sb_getblk_gfp()
328 sb_find_get_block(struct super_block *sb, sector_t block) sb_find_get_block() argument
330 return __find_get_block(sb->s_bdev, block, sb->s_blocksize); sb_find_get_block()
334 map_bh(struct buffer_head *bh, struct super_block *sb, sector_t block) map_bh() argument
338 bh->b_blocknr = block; map_bh()
362 sector_t block, getblk_unmovable()
365 return __getblk_gfp(bdev, block, size, 0); getblk_unmovable()
369 sector_t block, __getblk()
372 return __getblk_gfp(bdev, block, size, __GFP_MOVABLE); __getblk()
376 * __bread() - reads a specified block and returns the bh
378 * @block: number of block
381 * Reads a specified block, and returns buffer head that contains it.
383 * It returns NULL if the block was unreadable.
386 __bread(struct block_device *bdev, sector_t block, unsigned size) __bread() argument
388 return __bread_gfp(bdev, block, size, __GFP_MOVABLE); __bread()
361 getblk_unmovable(struct block_device *bdev, sector_t block, unsigned size) getblk_unmovable() argument
368 __getblk(struct block_device *bdev, sector_t block, unsigned size) __getblk() argument
H A Df2fs_fs.h21 #define F2FS_BLKSIZE 4096 /* support only 4KB block */
61 __le32 log_sectors_per_block; /* log2 # of sectors per block */
62 __le32 log_blocksize; /* log2 block size in bytes */
66 __le32 checksum_offset; /* checksum offset inside super block */
75 __le32 segment0_blkaddr; /* start block address of segment 0 */
76 __le32 cp_blkaddr; /* start block address of checkpoint */
77 __le32 sit_blkaddr; /* start block address of SIT */
78 __le32 nat_blkaddr; /* start block address of NAT */
79 __le32 ssa_blkaddr; /* start block address of SSA */
80 __le32 main_blkaddr; /* start block address of main area */
104 __le64 checkpoint_ver; /* checkpoint block version number */
119 __le32 cp_pack_start_sum; /* start block number of data summary */
125 __le32 checksum_offset; /* checksum offset inside cp block */
145 __le16 blk_addr; /* block index in current CP */
148 __le32 check_sum; /* CRC32 for orphan inode block */
156 __le32 blk; /* start block address of the extent */
219 __le32 addr[ADDRS_PER_BLOCK]; /* array of data block address */
223 __le32 nid[NIDS_PER_BLOCK]; /* array of data block address */
240 __le32 next_blkaddr; /* next node page block address */
261 __le32 block_addr; /* block address */
281 * [9:0] : valid block count
304 * One summary block contains exactly 512 summary entries, which represents
313 * from node's page's beginning to get a data block address.
321 /* a summary entry for a 4KB-sized block in a segment */
328 __le16 ofs_in_node; /* block index in parent node */
333 /* summary block type, node or data, is stored to the summary_footer */
381 /* 4KB-sized summary block structure */
412 /* the number of dentry in a block */
436 /* 4KB-sized directory entry block */
438 /* validity bitmap for directory entries in each block */
H A Ddqblk_qtree.h11 * possible block size (1024) */
31 unsigned int dqi_free_blk; /* First block in list of free blocks */
32 unsigned int dqi_free_entry; /* First block with free entry */
35 unsigned int dqi_usable_bs; /* Space usable in block for quota data */
H A Drfkill.h46 * @poll: poll the rfkill block state(s) -- only assign this method
50 * value of those functions to make sure the software block is
52 * @query: query the rfkill block state(s) and call exactly one of the
56 * block.
140 * rfkill_set_hw_state - Set the internal rfkill hardware block state
142 * @state: the current hardware block state to set
154 * The function returns the combined block state (true if transmitter
156 * block state -- which they might not be able to.
161 * rfkill_set_sw_state - Set the internal rfkill software block state
163 * @state: the current software block state to set
177 * The function returns the combined block state (true if transmitter
183 * rfkill_init_sw_state - Initialize persistent software block state
185 * @state: the current software block state to set
187 * rfkill drivers that preserve their software block state over power off
199 * rfkill_set_states - Set the internal rfkill block states
201 * @sw: the current software block state to set
202 * @hw: the current hardware block state to set
210 * rfkill_blocked - query rfkill block
H A Dcrc32.h20 * @crc1: crc32 of the first block
21 * @crc2: crc32 of the second block
22 * @len2: length of the second block
47 * @crc1: crc32c of the first block
48 * @crc2: crc32c of the second block
49 * @len2: length of the second block
H A Dnilfs2_fs.h61 * @i_bmap: block mapping
134 #define NILFS_MOUNT_BARRIER 0x1000 /* Use block barriers */
143 * struct nilfs_super_block - structure of super block on disk
155 /*10*/ __le32 s_sum; /* Check sum of super block */
161 /*20*/ __le64 s_dev_size; /* block device size in bytes */
162 __le64 s_first_data_block; /* 1st seg disk block number */
167 /*40*/ __le64 s_last_pseg; /* disk block addr pseg written last */
201 __u32 s_reserved[186]; /* padding to the end of the block */
259 * these files are written in super root block instead of ifile, and
266 * bytes offset of secondary super block
364 /* array of virtual block numbers */
368 * struct nilfs_binfo_v - information for the block to which a virtual block number is assigned
369 * @bi_vblocknr: virtual block number
370 * @bi_blkoff: block offset
378 * struct nilfs_binfo_dat - information for the block which belongs to the DAT file
379 * @bi_blkoff: block offset
390 * union nilfs_binfo: block information
466 * struct nilfs_palloc_group_desc - block group descriptor
467 * @pg_nfrees: number of free entries in block group
475 * @de_blocknr: block number
502 * @cp_checkpoints_count: checkpoints count in a block
837 * struct nilfs_vinfo - virtual block number information
838 * @vi_vblocknr: virtual block number
841 * @vi_blocknr: disk block number
851 * struct nilfs_vdesc - descriptor of virtual block number
854 * @vd_vblocknr: virtual block number
856 * @vd_blocknr: disk block number
857 * @vd_offset: logical block offset inside a file
858 * @vd_flags: flags (data or node block)
873 * struct nilfs_bdesc - descriptor of disk block number
875 * @bd_oblocknr: disk block address (for skipping dead blocks)
876 * @bd_blocknr: disk block address
877 * @bd_offset: logical block offset inside a file
/linux-4.1.27/drivers/md/
H A Ddm-log-writes.c128 struct pending_block *block; member in struct:per_bio_data
158 DMERR("Error writing log block, error=%d", err); log_end_io()
173 * associated with the block.
176 struct pending_block *block) free_pending_block()
180 for (i = 0; i < block->vec_cnt; i++) { free_pending_block()
181 if (block->vecs[i].bv_page) free_pending_block()
182 __free_page(block->vecs[i].bv_page); free_pending_block()
184 kfree(block->data); free_pending_block()
185 kfree(block); free_pending_block()
227 DMERR("Couldn't add page to the log block"); write_metadata()
241 struct pending_block *block, sector_t sector) log_one_block()
248 entry.sector = cpu_to_le64(block->sector); log_one_block()
249 entry.nr_sectors = cpu_to_le64(block->nr_sectors); log_one_block()
250 entry.flags = cpu_to_le64(block->flags); log_one_block()
251 entry.data_len = cpu_to_le64(block->datalen); log_one_block()
252 if (write_metadata(lc, &entry, sizeof(entry), block->data, log_one_block()
253 block->datalen, sector)) { log_one_block()
254 free_pending_block(lc, block); log_one_block()
258 if (!block->vec_cnt) log_one_block()
262 bio = bio_alloc(GFP_KERNEL, block->vec_cnt); log_one_block()
275 for (i = 0; i < block->vec_cnt; i++) { log_one_block()
280 ret = bio_add_page(bio, block->vecs[i].bv_page, log_one_block()
281 block->vecs[i].bv_len, 0); log_one_block()
282 if (ret != block->vecs[i].bv_len) { log_one_block()
285 bio = bio_alloc(GFP_KERNEL, block->vec_cnt - i); log_one_block()
297 ret = bio_add_page(bio, block->vecs[i].bv_page, log_one_block()
298 block->vecs[i].bv_len, 0); log_one_block()
299 if (ret != block->vecs[i].bv_len) { log_one_block()
305 sector += block->vecs[i].bv_len >> SECTOR_SHIFT; log_one_block()
309 kfree(block->data); log_one_block()
310 kfree(block); log_one_block()
314 free_pending_block(lc, block); log_one_block()
349 struct pending_block *block = NULL; log_writes_kthread() local
354 block = list_first_entry(&lc->logging_blocks, log_writes_kthread()
356 list_del_init(&block->list); log_writes_kthread()
361 if (block->flags & LOG_DISCARD_FLAG) log_writes_kthread()
364 lc->next_sector += block->nr_sectors + 1; log_writes_kthread()
381 super = (block->flags & (LOG_FUA_FLAG | LOG_MARK_FLAG)); log_writes_kthread()
388 if (block) { log_writes_kthread()
390 ret = log_one_block(lc, block, sector); log_writes_kthread()
399 free_pending_block(lc, block); log_writes_kthread()
487 struct pending_block *block; log_mark() local
490 block = kzalloc(sizeof(struct pending_block), GFP_KERNEL); log_mark()
491 if (!block) { log_mark()
492 DMERR("Error allocating pending block"); log_mark()
496 block->data = kstrndup(data, maxsize, GFP_KERNEL); log_mark()
497 if (!block->data) { log_mark()
499 kfree(block); log_mark()
503 block->datalen = strlen(block->data); log_mark()
504 block->flags |= LOG_MARK_FLAG; log_mark()
506 list_add_tail(&block->list, &lc->logging_blocks); log_mark()
548 struct pending_block *block; log_writes_map() local
557 pb->block = NULL; log_writes_map()
575 * allocate the size of the pending block. log_writes_map()
582 block = kzalloc(alloc_size, GFP_NOIO); log_writes_map()
583 if (!block) { log_writes_map()
584 DMERR("Error allocating pending block"); log_writes_map()
590 INIT_LIST_HEAD(&block->list); log_writes_map()
591 pb->block = block; log_writes_map()
595 block->flags |= LOG_FLUSH_FLAG; log_writes_map()
597 block->flags |= LOG_FUA_FLAG; log_writes_map()
599 block->flags |= LOG_DISCARD_FLAG; log_writes_map()
601 block->sector = bio->bi_iter.bi_sector; log_writes_map()
602 block->nr_sectors = bio_sectors(bio); log_writes_map()
616 list_splice_init(&lc->unflushed_blocks, &block->list); log_writes_map()
637 free_pending_block(lc, block); bio_for_each_segment()
649 block->vecs[i].bv_page = page; bio_for_each_segment()
650 block->vecs[i].bv_len = bv.bv_len; bio_for_each_segment()
651 block->vec_cnt++; bio_for_each_segment()
658 list_splice_init(&lc->unflushed_blocks, &block->list);
671 if (bio_data_dir(bio) == WRITE && pb->block) { normal_end_io()
672 struct pending_block *block = pb->block; normal_end_io() local
676 if (block->flags & LOG_FLUSH_FLAG) { normal_end_io()
677 list_splice_tail_init(&block->list, &lc->logging_blocks); normal_end_io()
678 list_add_tail(&block->list, &lc->logging_blocks); normal_end_io()
680 } else if (block->flags & LOG_FUA_FLAG) { normal_end_io()
681 list_add_tail(&block->list, &lc->logging_blocks); normal_end_io()
684 list_add_tail(&block->list, &lc->unflushed_blocks); normal_end_io()
175 free_pending_block(struct log_writes_c *lc, struct pending_block *block) free_pending_block() argument
240 log_one_block(struct log_writes_c *lc, struct pending_block *block, sector_t sector) log_one_block() argument
H A Ddm-cache-policy.h10 #include "dm-cache-block-types.h"
28 * That block is in the cache. Remap to the cache and carry on.
31 * This block is on the origin device. Remap and carry on.
34 * This block is currently on the origin device, but the policy wants to
37 * - hold any further io to this origin block
38 * - copy the origin to the given cache block
40 * - remap the original block to the cache
43 * This block is currently on the origin device. The policy wants to
45 * cache block needs a writeback first. The core should:
47 * - hold any further io to this origin block
48 * - hold any further io to the origin block that's being written back
50 * - copy new block to cache
61 * In general policy methods should never block, except in the case of the
74 * lock the block being demoted. This doesn't need to occur during a
75 * writeback operation since the block remains in the cache.
105 * block.
116 * oblock - the origin block we're interested in.
119 * block. -EWOULDBLOCK returned if it can't and would.
126 * discarded_oblock - indicates whether the whole origin block is
129 * cache block if it wants.)
141 * Sometimes we want to see if a block is in the cache, without
144 * Must not block.
181 * Provide a dirty block to be written back by the core target.
185 * 0 and @cblock,@oblock: block to write back provided
197 * Because of where we sit in the block layer, we can be asked to
198 * map a lot of little bios that are all in the same block (no
245 * Policies may store a hint for each each cache block.
H A Ddm-bufio.h44 * Read a given block from disk. Returns pointer to data. Returns a
48 void *dm_bufio_read(struct dm_bufio_client *c, sector_t block,
55 void *dm_bufio_get(struct dm_bufio_client *c, sector_t block,
62 void *dm_bufio_new(struct dm_bufio_client *c, sector_t block,
71 sector_t block, unsigned n_blocks);
107 * block. dm_bufio_write_dirty_buffers is needed to commit the new block.
116 void dm_bufio_forget(struct dm_bufio_client *c, sector_t block);
H A Ddm-verity.c61 u8 *root_digest; /* digest of the root block */
70 unsigned char hash_per_block_bits; /* log2(hashes in hash block) */
75 int hash_failed; /* set to 1 if hash of any block failed */
94 sector_t block; member in struct:dm_verity_io
115 sector_t block; member in struct:dm_verity_prefetch_work
136 * hash_verified is nonzero, hash of the block has been verified.
169 * Return hash position of a specified block at a specified tree level
172 * inside a hash block. The remaining bits denote location of the hash block.
174 static sector_t verity_position_at_level(struct dm_verity *v, sector_t block, verity_position_at_level() argument
177 return block >> (level * v->hash_per_block_bits); verity_position_at_level()
180 static void verity_hash_at_level(struct dm_verity *v, sector_t block, int level, verity_hash_at_level() argument
183 sector_t position = verity_position_at_level(v, block, level); verity_hash_at_level()
202 unsigned long long block) verity_handle_err()
228 DMERR("%s: %s block %llu is corrupted", v->data_dev->name, type_str, verity_handle_err()
229 block); verity_handle_err()
235 DM_VERITY_ENV_VAR_NAME, type, block); verity_handle_err()
250 * Verify hash of a metadata block pertaining to the specified data block
251 * ("block" argument) at a specified level ("level" argument).
254 * a lower tree level or for the data block (if we're at the lowest leve).
260 static int verity_verify_level(struct dm_verity_io *io, sector_t block, verity_verify_level() argument
271 verity_hash_at_level(v, block, level, &hash_block, &offset); verity_verify_level()
368 * the current block. If the hash block itself is verity_verify_io()
373 int r = verity_verify_level(io, io->block + b, 0, true); verity_verify_io()
383 int r = verity_verify_level(io, io->block + b, i, false); verity_verify_io()
443 io->block + b)) verity_verify_io()
500 verity_hash_at_level(v, pw->block, i, &hash_block_start, NULL); verity_prefetch_io()
501 verity_hash_at_level(v, pw->block + pw->n_blocks - 1, i, &hash_block_end, NULL); verity_prefetch_io()
537 pw->block = io->block; verity_submit_prefetch()
573 io->block = bio->bi_iter.bi_sector >> (v->data_dev_block_bits - SECTOR_SHIFT); verity_map()
723 * <data block size>
724 * <hash block size>
726 * <hash start block>
791 ti->error = "Invalid data device block size"; verity_ctr()
801 ti->error = "Invalid hash device block size"; verity_ctr()
201 verity_handle_err(struct dm_verity *v, enum verity_block_type type, unsigned long long block) verity_handle_err() argument
H A Ddm-thin-metadata.h10 #include "persistent-data/dm-block-manager.h"
136 dm_block_t block; member in struct:dm_thin_lookup_result
146 int dm_thin_find_block(struct dm_thin_device *td, dm_block_t block,
150 * Obtain an unused block.
155 * Insert or remove block.
157 int dm_thin_insert_block(struct dm_thin_device *td, dm_block_t block,
160 int dm_thin_remove_block(struct dm_thin_device *td, dm_block_t block);
197 * Flicks the underlying block manager into read only mode, so you know
/linux-4.1.27/arch/mips/include/asm/octeon/
H A Dcvmx-bootmem.h45 /* Allocate from end of block instead of beginning */
51 /* First bytes of each free physical block of memory contain this structure,
76 /* Base address of named block */
79 * Size actually allocated for named block (may differ from
83 /* name of named block */
122 /* address of named memory block descriptors */
149 * Allocate a block of memory from the free list that was passed
153 * @size: Size in bytes of block to allocate
156 * Returns pointer to block of memory, NULL on error
161 * Allocate a block of memory from the free list that was
167 * @size: Size in bytes of block to allocate
171 * Returns pointer to block of memory, NULL on error
177 * Allocate a block of memory from the free list that was
183 * @size: Size in bytes of block to allocate
187 * Returns pointer to block of memory, NULL on error
193 * Frees a previously allocated named bootmem block.
195 * @name: name of block to free
203 * Allocate a block of memory from the free list that was passed
205 * global named block table. (part of the cvmx_bootmem_descriptor_t structure)
208 * @size: Size in bytes of block to allocate
210 * @name: name of block - must be less than CVMX_BOOTMEM_NAME_LEN bytes
212 * Returns a pointer to block of memory, NULL on error
220 * Allocate a block of memory from the free list that was passed
222 * global named block table. (part of the cvmx_bootmem_descriptor_t structure)
225 * @size: Size in bytes of block to allocate
228 * @name: name of block - must be less than CVMX_BOOTMEM_NAME_LEN
231 * Returns a pointer to block of memory, NULL on error
239 * Allocate a block of memory from a specific range of the free list
241 * a name in the global named block table. (part of the
246 * @size: Size in bytes of block to allocate
250 * @name: name of block - must be less than CVMX_BOOTMEM_NAME_LEN bytes
252 * Returns a pointer to block of memory, NULL on error
261 * Finds a named bootmem block by name.
263 * @name: name of block to free
265 * Returns pointer to named block descriptor on success
271 * Allocates a block of physical memory from the free list, at
277 * @address_min: Minimum address that block can occupy.
282 * @alignment: Requested alignment of the block. If this alignment
292 * Returns physical address of block allocated, or -1 on failure
299 * Allocates a named block of physical memory from the free list, at
305 * @param min_addr Minimum address that block can occupy.
308 * @param alignment Requested alignment of the block. If this
315 * @param name name to assign to named block
318 * @return physical address of block allocated, or -1 on failure
326 * Finds a named memory block by name.
327 * Also used for finding an unused entry in the named block table.
329 * @name: Name of memory block to find. If NULL pointer given, then
334 * Returns Pointer to memory block descriptor, NULL if not found.
336 * block descriptors are available.
342 * Frees a named block.
344 * @name: name of block to free
353 * Frees a block to the bootmem allocator list. This must
355 * of the block that was allocated, or the list will become
358 * IMPORTANT: This is only intended to be used as part of named block
362 * @phy_addr: physical address of block
363 * @size: size of block in bytes.
/linux-4.1.27/drivers/mtd/onenand/
H A Donenand_bbt.c27 * Check for a pattern at the given place. Used to search bad block
28 * tables and good / bad block identifiers. Same as check_pattern, but
47 * create_bbt - [GENERIC] Create a bad block table by scanning the device
50 * @param bd descriptor for the good/bad block search pattern
54 * Create a bad block table by scanning the device
55 * for the given good/bad block identify pattern
98 /* If it is a initial bad block, just ignore it */ create_bbt()
106 "initial bad block\n", i >> 1); create_bbt()
125 * onenand_memory_bbt - [GENERIC] create a memory based bad block table
127 * @param bd descriptor for the good/bad block search pattern
140 * onenand_isbad_bbt - [OneNAND Interface] Check if a block is bad
143 * @param allowbbt allow access to bad block table region
149 int block; onenand_isbad_bbt() local
152 /* Get block number * 2 */ onenand_isbad_bbt()
153 block = (int) (onenand_block(this, offs) << 1); onenand_isbad_bbt()
154 res = (bbm->bbt[block >> 3] >> (block & 0x06)) & 0x03; onenand_isbad_bbt()
156 pr_debug("onenand_isbad_bbt: bbt info for offs 0x%08x: (block %d) 0x%02x\n", onenand_isbad_bbt()
157 (unsigned int) offs, block >> 1, res); onenand_isbad_bbt()
169 * onenand_scan_bbt - [OneNAND Interface] scan, find, read and maybe create bad block table(s)
171 * @param bd descriptor for the good/bad block search pattern
173 * The function checks, if a bad block table(s) is/are already
175 * marked good / bad blocks and writes the bad block table(s) to
178 * The bad block table memory is allocated here. It is freed
189 /* Allocate memory (2bit per block) and clear the memory bad block table */ onenand_scan_bbt()
194 /* Set the bad block position */ onenand_scan_bbt()
203 /* Scan the device to build a memory based bad block table */ onenand_scan_bbt()
214 * Define some generic bad / good block scan pattern which are used
227 * onenand_default_bbt - [OneNAND Interface] Select a default bad block table for the device
230 * This function selects the default bad block table
/linux-4.1.27/fs/ext3/
H A Dballoc.c9 * Enhanced block allocation by Stephen Tweedie (sct@redhat.com), 1993
24 * blocks groups. Each group contains 1 bitmap block for blocks, 1 bitmap
25 * block for inodes, N blocks for the inode table and data blocks.
28 * super block. Each descriptor contains the number of the bitmap block and
29 * the free blocks count in the block. The descriptors are loaded in memory
37 * Calculate the block group number and offset, given a block number
53 * @sb: super block
54 * @block_group: given block group
55 * @bh: pointer to the buffer head to store the block
105 /* check whether block bitmap block number is set */ ext3_valid_block_bitmap()
109 /* bad block bitmap */ ext3_valid_block_bitmap()
112 /* check whether the inode bitmap block number is set */ ext3_valid_block_bitmap()
116 /* bad block bitmap */ ext3_valid_block_bitmap()
119 /* check whether the inode table block number is set */ ext3_valid_block_bitmap()
131 "Invalid block bitmap - " ext3_valid_block_bitmap()
132 "block_group = %d, block = %lu", ext3_valid_block_bitmap()
139 * @sb: super block
140 * @block_group: given block group
143 * bits for block/inode/inode tables are set in the bitmaps
162 "Cannot read block bitmap - " read_block_bitmap()
173 "Cannot read block bitmap - " read_block_bitmap()
197 * __rsv_window_dump() -- Dump the filesystem block allocation reservation map
202 * If verbose is turned on, it will print the whole block reservation
258 * @grp_goal: given goal block relative to the allocation block group
259 * @group: the current allocation block group
260 * @sb: filesystem super block
262 * Test if the given goal block (group relative) is within the file's
263 * own block reservation window range.
266 * grp_goal (given goal block) could be -1, which means no specific
267 * goal block. In this case, always return 1.
268 * If the goal block is within the reservation window, return 1;
292 * @goal: target allocation block
331 * ext3_rsv_window_add() -- Insert a window to the block reservation rb tree.
332 * @sb: super block
370 * @sb: super block
373 * Mark the block reservation window as not allocated, and unlink it
390 * returns 1 if the end block is EXT3_RESERVE_WINDOW_NOT_ALLOCATED.
394 /* a valid reservation end block could not be 0 */ rsv_is_empty()
407 * needs a new block. So, before every ext3_new_block(s) call, for
410 * Fail to do so will result in block reservation being turned off for that
415 * is open for write (needs block allocation).
435 * block reservation is off ext3_init_block_alloc_info()
452 * Discard(free) block reservation window on last file close, or truncate
458 * ext3_truncate(): when the block indirect map is about to change.
485 * @sb: super block
486 * @block: start physical block to free
491 ext3_fsblk_t block, unsigned long count, ext3_free_blocks_sb()
509 if (block < le32_to_cpu(es->s_first_data_block) || ext3_free_blocks_sb()
510 block + count < block || ext3_free_blocks_sb()
511 block + count > le32_to_cpu(es->s_blocks_count)) { ext3_free_blocks_sb()
514 "block = "E3FSBLK", count = %lu", block, count); ext3_free_blocks_sb()
518 ext3_debug ("freeing block(s) %lu-%lu\n", block, block + count - 1); ext3_free_blocks_sb()
522 block_group = (block - le32_to_cpu(es->s_first_data_block)) / ext3_free_blocks_sb()
524 bit = (block - le32_to_cpu(es->s_first_data_block)) % ext3_free_blocks_sb()
542 if (in_range (le32_to_cpu(desc->bg_block_bitmap), block, count) || ext3_free_blocks_sb()
543 in_range (le32_to_cpu(desc->bg_inode_bitmap), block, count) || ext3_free_blocks_sb()
544 in_range (block, le32_to_cpu(desc->bg_inode_table), ext3_free_blocks_sb()
546 in_range (block + count - 1, le32_to_cpu(desc->bg_inode_table), ext3_free_blocks_sb()
551 block, count); ext3_free_blocks_sb()
585 debug_bh = sb_find_get_block(sb, block + i); ext3_free_blocks_sb()
608 * revoking the queued write of a data block, which ext3_free_blocks_sb()
610 * cannot block due to truncate races. ext3_free_blocks_sb()
636 "bit already cleared for block "E3FSBLK, ext3_free_blocks_sb()
637 block + i); ext3_free_blocks_sb()
651 /* We dirtied the bitmap block */ ext3_free_blocks_sb()
652 BUFFER_TRACE(bitmap_bh, "dirtied bitmap block"); ext3_free_blocks_sb()
655 /* And the group descriptor block */ ext3_free_blocks_sb()
656 BUFFER_TRACE(gd_bh, "dirtied group descriptor block"); ext3_free_blocks_sb()
662 block += count; ext3_free_blocks_sb()
677 * @block: start physical block to free
681 ext3_fsblk_t block, unsigned long count) ext3_free_blocks()
686 trace_ext3_free_blocks(inode, block, count); ext3_free_blocks()
687 ext3_free_blocks_sb(handle, sb, block, count, &dquot_freed_blocks); ext3_free_blocks()
695 * @nr: given allocation block group
696 * @bh: bufferhead contains the bitmap of the given block group
704 * data would allow the old block to be overwritten before the
732 * @start: the starting block (group relative) of the search
733 * @bh: bufferhead contains the block group bitmap
734 * @maxblocks: the ending block (group relative) of the reservation
764 * @start: the starting block (group relative) to find next
765 * allocatable block in bitmap.
766 * @bh: bufferhead contains the block group bitmap
767 * @maxblocks: the ending block (group relative) for the search
769 * Find an allocatable block in a bitmap. We honor both the bitmap and
771 * appropriate allocation" algorithm of looking for a free block near
785 * block within the next XX blocks. find_next_usable_block()
822 * @lock: the spin lock for this block group
823 * @block: the free block (group relative) to allocate
824 * @bh: the buffer_head contains the block group bitmap
826 * We think we can allocate this block in this bitmap. Try to set the bit.
828 * block since we saw that is was not marked in b_committed_data. If it _was_
833 claim_block(spinlock_t *lock, ext3_grpblk_t block, struct buffer_head *bh) claim_block() argument
838 if (ext3_set_bit_atomic(lock, block, bh->b_data)) claim_block()
841 if (jh->b_committed_data && ext3_test_bit(block,jh->b_committed_data)) { claim_block()
842 ext3_clear_bit_atomic(lock, block, bh->b_data); claim_block()
855 * @group: given allocation block group
856 * @bitmap_bh: bufferhead holds the block bitmap
857 * @grp_goal: given target block within the group
866 * if there is a reservation window, only try to allocate block(s) from the
868 * Otherwise, the allocation range starts from the give goal block, ends at
869 * the block group's last block.
871 * If we failed to allocate the desired block then we may end up crossing to a
930 * The block was allocated by another thread, or it was ext3_try_to_allocate()
971 * @sb: the super block
973 * @start_block: the first block we consider to start
977 * the maximum block number that our goal reservable space
978 * could start from. This is normally the last block in this
1084 * there, we check the bitmap for the first free block after
1085 * it. If there is no free block until the end of group, then the
1087 * block is inside the expected reservable space, if so, we
1089 * If the first free block is outside the reservable space, then
1090 * start from the first free block, we search for next available
1094 * It contains at least one free block, and it does not overlap with other
1104 * no grp_goal(grp_goal = -1), we start from the first block
1107 * @sb: the super block
1109 * @bitmap_bh: the block group block bitmap
1146 * Maybe we could shift the start block of the reservation alloc_new_reservation()
1147 * window to the first block of next group. alloc_new_reservation()
1172 * shift the search start to the window near the goal block alloc_new_reservation()
1198 * to make sure there is at least a free block inside this region. alloc_new_reservation()
1200 * searching the first free bit on the block bitmap and copy of alloc_new_reservation()
1202 * block. Search start from the start block of the reservable space alloc_new_reservation()
1212 * no free block left on the bitmap, no point alloc_new_reservation()
1224 * check if the first free block is within the alloc_new_reservation()
1235 * start from where the free block is, alloc_new_reservation()
1246 * @sb: super block
1289 * @group: given allocation block group
1290 * @bitmap_bh: bufferhead holds the block bitmap
1291 * @grp_goal: given target block within the group
1296 * This is the main function used to allocate a new block and its reservation
1299 * Each time when a new block allocation is need, first try to allocate from
1303 * reservation window for it starting from the goal first. Then do the block
1307 * again when somebody is looking for a free block (without
1333 BUFFER_TRACE(bitmap_bh, "get undo access for new block"); ext3_try_to_allocate_with_rsv()
1344 * or last attempt to allocate a block with reservation turned on failed ext3_try_to_allocate_with_rsv()
1352 * grp_goal is a group relative block number (if there is a goal) ext3_try_to_allocate_with_rsv()
1354 * first block is a filesystem wide block number ext3_try_to_allocate_with_rsv()
1355 * first block is the block number of the first block in this group ext3_try_to_allocate_with_rsv()
1361 * Basically we will allocate a new block from inode's reservation ext3_try_to_allocate_with_rsv()
1366 * b) last attempt to allocate a block from existing reservation ext3_try_to_allocate_with_rsv()
1415 "bitmap block"); ext3_try_to_allocate_with_rsv()
1431 * @sbi: in-core super block structure.
1433 * Check if filesystem has at least 1 free block available for allocation.
1452 * @sb: super block
1473 * ext3_new_blocks() -- core block(s) allocation function
1476 * @goal: given target block(filesystem wide)
1480 * ext3_new_blocks uses a goal block to assist allocation. It tries to
1481 * allocate block(s) from the block group contains the goal block first. If that
1482 * fails, it will try to allocate block(s) from other block groups without
1483 * any specific goal block.
1493 ext3_grpblk_t grp_target_blk; /* blockgroup relative goal block */ ext3_new_blocks()
1494 ext3_grpblk_t grp_alloc_blk; /* blockgroup-relative allocated block*/ ext3_new_blocks()
1495 ext3_fsblk_t ret_block; /* filesyetem-wide allocated block */ ext3_new_blocks()
1517 * Check quota for allocation of this block. ext3_new_blocks()
1531 * Allocate a block from reservation only when ext3_new_blocks()
1548 * First, test whether the goal block is free. ext3_new_blocks()
1620 * try to allocate block(s) from this group, without a goal(-1). ext3_new_blocks()
1635 * just do block allocation as without reservations. ext3_new_blocks()
1649 ext3_debug("using block group %d(%d)\n", ext3_new_blocks()
1666 "Allocating block in system zone - " ext3_new_blocks()
1682 /* Record bitmap buffer state in the newly allocated block */ ext3_new_blocks()
1698 printk("%s: block was unexpectedly set in " ext3_new_blocks()
1710 "block("E3FSBLK") >= blocks count(%d) - " ext3_new_blocks()
1721 ext3_debug("allocating block %lu. Goal hits %d of %d.\n", ext3_new_blocks()
1755 * Undo the block allocation ext3_new_blocks()
1775 * Adds up the number of free blocks from each block group.
1907 * @sb: super block for file system
1909 * @start: first group block to examine
1910 * @max: last group block to examine
1912 * @minblocks: minimum extent block count
1914 * ext3_trim_all_free walks through group's block bitmap searching for free
1915 * blocks. When the free block is found, it tries to allocate this block and
1916 * consequent free block to get the biggest free extent possible, until it
1917 * reaches any used block. Then issue a TRIM command on this extent and free
1918 * the extent in the block bitmap. This is done until whole group is scanned.
1934 * We will update one block bitmap, and one group descriptor ext3_trim_all_free()
1974 * block bitmap ext3_trim_all_free()
2016 "bit already cleared for block "E3FSBLK, ext3_trim_all_free()
2050 /* We dirtied the bitmap block */ ext3_trim_all_free()
2051 BUFFER_TRACE(bitmap_bh, "dirtied bitmap block"); ext3_trim_all_free()
2056 /* And the group descriptor block */ ext3_trim_all_free()
2057 BUFFER_TRACE(gdp_bh, "dirtied group descriptor block"); ext3_trim_all_free()
2120 /* end now represents the last block to discard in this group */ ext3_trim_fs()
2129 * For all the groups except the last one, last block will ext3_trim_fs()
2147 * that the first block to discard will be block #0. ext3_trim_fs()
490 ext3_free_blocks_sb(handle_t *handle, struct super_block *sb, ext3_fsblk_t block, unsigned long count, unsigned long *pdquot_freed_blocks) ext3_free_blocks_sb() argument
680 ext3_free_blocks(handle_t *handle, struct inode *inode, ext3_fsblk_t block, unsigned long count) ext3_free_blocks() argument
H A Dnamei.h12 int block, int create, ext3_dir_bread()
17 bh = ext3_bread(handle, inode, block, create, err); ext3_dir_bread()
10 ext3_dir_bread(handle_t *handle, struct inode *inode, int block, int create, int *err) ext3_dir_bread() argument
H A Dresize.c62 "Cannot read last block ("E3FSBLK")", verify_group_input()
66 "Block bitmap not in group (block %u)", verify_group_input()
70 "Inode bitmap not in group (block %u)", verify_group_input()
182 * Set up the block and inode bitmaps, and the inode table for the new group.
198 ext3_fsblk_t block; setup_new_group_blocks() local
226 for (i = 0, bit = 1, block = start + 1; setup_new_group_blocks()
227 i < gdblocks; i++, block++, bit++) { setup_new_group_blocks()
230 ext3_debug("update backup group %#04lx (+%d)\n", block, bit); setup_new_group_blocks()
236 gdb = sb_getblk(sb, block); setup_new_group_blocks()
259 for (i = 0, bit = gdblocks + 1, block = start + bit; setup_new_group_blocks()
260 i < reserved_gdb; i++, block++, bit++) { setup_new_group_blocks()
263 ext3_debug("clear reserved block %#04lx (+%d)\n", block, bit); setup_new_group_blocks()
269 if (IS_ERR(gdb = bclean(handle, sb, block))) { setup_new_group_blocks()
281 ext3_debug("mark block bitmap %#04x (+%ld)\n", input->block_bitmap, setup_new_group_blocks()
289 for (i = 0, block = input->inode_table, bit = block - start; setup_new_group_blocks()
290 i < sbi->s_itb_per_group; i++, bit++, block++) { setup_new_group_blocks()
293 ext3_debug("clear inode block %#04lx (+%d)\n", block, bit); setup_new_group_blocks()
299 if (IS_ERR(it = bclean(handle, sb, block))) { setup_new_group_blocks()
382 * Check that all of the backup GDT blocks are held in the primary GDT block.
415 * Called when we need to bring a reserved group descriptor table block into
416 * use from the resize inode. The primary copy of the new GDT block currently
417 * is an indirect block (under the double indirect block in the resize inode).
419 * block, in group order. Even though we know all the block numbers we need,
422 * Don't need to update the block bitmaps because the blocks are still in use.
444 "EXT3-fs: ext3_add_new_gdb: adding group block %lu\n", add_new_gdb()
479 "new group %u GDT block "E3FSBLK" not reserved", add_new_gdb()
510 * Remove new GDT block from inode double-indirect block and clear out add_new_gdb()
511 * the new GDT block for use (which also "frees" the backup GDT blocks add_new_gdb()
572 * Each reserved backup GDT block will go into a different indirect block.
574 * so we know in advance what their block numbers are. We only get the
575 * double-indirect block to verify it is pointing to the primary reserved
576 * GDT blocks so we don't overwrite a data block by accident. The reserved
577 * backup GDT blocks are stored in their reserved primary GDT block.
609 /* Get each reserved primary GDT block and verify it holds backups */ reserve_backup_gdb()
613 "reserved block "E3FSBLK reserve_backup_gdb()
650 * the new group to its reserved primary GDT block. reserve_backup_gdb()
684 * important part is that the new block and inode counts are in the backup
770 /* Add group descriptor data to an existing or new group descriptor block.
775 * If we are on a GDT block boundary, we need to get the reserved GDT block.
842 * block. If we are adding a group past the last current GDT block, ext3_group_add()
843 * we will also modify the inode and the dindirect block. If we ext3_group_add()
868 * or remove reserved blocks for the first group in a new group block. ext3_group_add()
902 /* Update group descriptor block for new group */ ext3_group_add()
916 * We always allocate group-by-group, then block-by-block or ext3_group_add()
941 * while freeing data, as we can only allocate from a block ext3_group_add()
955 /* Update the reserved block counts only once the new group is ext3_group_add()
1061 "can't read last block, resize aborted"); ext3_group_extend()
1066 /* We will update the superblock, one block bitmap, and ext3_group_extend()
/linux-4.1.27/fs/bfs/
H A Dfile.c6 * Make the file block allocation algorithm understand the size
7 * of the underlying block device.
56 dprintf("failed to move block %08lx -> %08lx\n", i, bfs_move_blocks()
63 static int bfs_get_block(struct inode *inode, sector_t block, bfs_get_block() argument
72 phys = bi->i_sblock + block; bfs_get_block()
76 create, (unsigned long)block, phys); bfs_get_block()
83 * If the file is not empty and the requested block is within the bfs_get_block()
87 dprintf("c=%d, b=%08lx, phys=%08lx (interim block granted)\n", bfs_get_block()
88 create, (unsigned long)block, phys); bfs_get_block()
101 * If the last data block for this file is the last allocated bfs_get_block()
102 * block, we can extend the file trivially, without moving it bfs_get_block()
107 create, (unsigned long)block, phys); bfs_get_block()
116 /* Ok, we have to move this entire file to the next free block. */ bfs_get_block()
118 if (phys + block >= info->si_blocks) { bfs_get_block()
135 create, (unsigned long)block, phys); bfs_get_block()
137 phys += block; bfs_get_block()
184 static sector_t bfs_bmap(struct address_space *mapping, sector_t block) bfs_bmap() argument
186 return generic_block_bmap(mapping, block, bfs_get_block); bfs_bmap()
H A Ddir.c35 int block; bfs_readdir() local
46 block = BFS_I(dir)->i_sblock + (ctx->pos >> BFS_BSIZE_BITS); bfs_readdir()
47 bh = sb_bread(dir->i_sb, block); bfs_readdir()
281 int block, sblock, eblock, off, pos; bfs_add_entry() local
293 for (block = sblock; block <= eblock; block++) { bfs_add_entry()
294 bh = sb_bread(dir->i_sb, block); bfs_add_entry()
300 pos = (block - sblock) * BFS_BSIZE + off; bfs_add_entry()
333 unsigned long block = 0, offset = 0; bfs_find_entry() local
341 while (block * BFS_BSIZE + offset < dir->i_size) { bfs_find_entry()
343 bh = sb_bread(dir->i_sb, BFS_I(dir)->i_sblock + block); bfs_find_entry()
345 block++; bfs_find_entry()
361 block++; bfs_find_entry()
/linux-4.1.27/fs/btrfs/
H A Dcheck-integrity.c26 * Code is added that examines all block write requests during
27 * runtime (including writes of the super block). Three rules
30 * 1. It is not allowed to write a disk block which is
31 * currently referenced by the super block (either directly
33 * 2. When a super block is written, it is verified that all
38 * referenced by the super block) or they have been
50 * block.
68 * the tree that the super block references to kernel messages
69 * each time after a super block was written:
77 * the integrity of (super)-block write requests, do not
148 unsigned int never_written:1; /* block was added because it was
177 * each block object can refer to and can be ref from multiple blocks.
179 * the block ref to plus the one from the block refered from.
184 * as a write operation to a block while that block is still referenced).
239 struct btrfsic_block *block; member in struct:btrfsic_stack_frame
305 struct btrfsic_block *block,
313 struct btrfsic_block *block,
324 struct btrfsic_block *block,
344 struct btrfsic_block *const block,
349 const struct btrfsic_block *block,
352 struct btrfsic_block *const block,
359 const struct btrfsic_block *block);
362 const struct btrfsic_block *block,
806 /* super block bytenr is always the unmapped device bytenr */ btrfsic_process_superblock_dev_mirror()
848 printk_in_rcu(KERN_INFO "New initial S-block (bdev %p, %s)" btrfsic_process_superblock_dev_mirror()
991 sf->block = first_block; btrfsic_process_metablock()
998 sf->block->generation = le64_to_cpu(sf->hdr->generation); btrfsic_process_metablock()
1070 sf->block, btrfsic_process_metablock()
1101 next_stack->block = sf->next_block; btrfsic_process_metablock()
1116 sf->block, btrfsic_process_metablock()
1171 sf->block, btrfsic_process_metablock()
1197 next_stack->block = sf->next_block; btrfsic_process_metablock()
1216 /* the one for the initial block is freed in the caller */ btrfsic_process_metablock()
1265 struct btrfsic_block *block, btrfsic_create_link_to_next_block()
1332 "Referenced block @%llu (%s/%llu/%d) found in hash table, %c, bytenr mismatch (!= stored %llu).\n", btrfsic_create_link_to_next_block()
1340 "Referenced block @%llu (%s/%llu/%d) found in hash table, %c.\n", btrfsic_create_link_to_next_block()
1369 l->block_ref_from = block; btrfsic_create_link_to_next_block()
1376 list_add(&l->node_ref_to, &block->ref_to_list); btrfsic_create_link_to_next_block()
1395 "btrfsic: read block @logical %llu failed!\n", btrfsic_create_link_to_next_block()
1413 struct btrfsic_block *block, btrfsic_handle_extent_data()
1537 "Referenced block" btrfsic_handle_extent_data()
1554 next_block, block, btrfsic_handle_extent_data()
1735 printk(KERN_INFO "%c-block @%llu (%s/%llu/%d)\n", btrfsic_dump_database()
1785 * Test whether the disk block contains a tree block (leaf or node)
1786 * (note that this test fails for the super block)
1826 struct btrfsic_block *block; btrfsic_process_written_block() local
1844 block = btrfsic_block_hashtable_lookup(bdev, dev_bytenr, btrfsic_process_written_block()
1846 if (NULL != block) { btrfsic_process_written_block()
1851 if (block->is_superblock) { btrfsic_process_written_block()
1867 btrfsic_dump_tree_sub(state, block, 0); btrfsic_process_written_block()
1871 if (!block->is_superblock) { btrfsic_process_written_block()
1887 if (block->logical_bytenr != bytenr && btrfsic_process_written_block()
1888 !(!block->is_metadata && btrfsic_process_written_block()
1889 block->logical_bytenr == 0)) btrfsic_process_written_block()
1891 "Written block @%llu (%s/%llu/%d) found in hash table, %c, bytenr mismatch (!= stored %llu).\n", btrfsic_process_written_block()
1894 block->mirror_num, btrfsic_process_written_block()
1896 block), btrfsic_process_written_block()
1897 block->logical_bytenr); btrfsic_process_written_block()
1900 "Written block @%llu (%s/%llu/%d) found in hash table, %c.\n", btrfsic_process_written_block()
1902 dev_bytenr, block->mirror_num, btrfsic_process_written_block()
1904 block)); btrfsic_process_written_block()
1906 block->logical_bytenr = bytenr; btrfsic_process_written_block()
1915 bytenr = block->logical_bytenr; btrfsic_process_written_block()
1918 "Written block @%llu (%s/%llu/%d)" btrfsic_process_written_block()
1921 block->mirror_num, btrfsic_process_written_block()
1922 btrfsic_get_block_type(state, block)); btrfsic_process_written_block()
1928 list_empty(&block->ref_to_list) ? ' ' : '!', btrfsic_process_written_block()
1929 list_empty(&block->ref_from_list) ? ' ' : '!'); btrfsic_process_written_block()
1930 if (btrfsic_is_block_ref_by_superblock(state, block, 0)) { btrfsic_process_written_block()
1931 printk(KERN_INFO "btrfs: attempt to overwrite %c-block" btrfsic_process_written_block()
1937 btrfsic_get_block_type(state, block), bytenr, btrfsic_process_written_block()
1938 dev_state->name, dev_bytenr, block->mirror_num, btrfsic_process_written_block()
1939 block->generation, btrfsic_process_written_block()
1940 btrfs_disk_key_objectid(&block->disk_key), btrfsic_process_written_block()
1941 block->disk_key.type, btrfsic_process_written_block()
1942 btrfs_disk_key_offset(&block->disk_key), btrfsic_process_written_block()
1949 if (!block->is_iodone && !block->never_written) { btrfsic_process_written_block()
1950 printk(KERN_INFO "btrfs: attempt to overwrite %c-block" btrfsic_process_written_block()
1953 btrfsic_get_block_type(state, block), bytenr, btrfsic_process_written_block()
1954 dev_state->name, dev_bytenr, block->mirror_num, btrfsic_process_written_block()
1955 block->generation, btrfsic_process_written_block()
1965 * Clear all references of this block. Do not free btrfsic_process_written_block()
1966 * the block itself even if is not referenced anymore btrfsic_process_written_block()
1971 &block->ref_to_list) { btrfsic_process_written_block()
1997 block->never_written = 0; btrfsic_process_written_block()
1998 block->iodone_w_error = 0; btrfsic_process_written_block()
2000 block->is_iodone = 0; btrfsic_process_written_block()
2003 block->orig_bio_bh_private = btrfsic_process_written_block()
2005 block->orig_bio_bh_end_io.bio = btrfsic_process_written_block()
2007 block->next_in_same_bio = NULL; btrfsic_process_written_block()
2008 bio->bi_private = block; btrfsic_process_written_block()
2017 block->orig_bio_bh_private = btrfsic_process_written_block()
2019 block->orig_bio_bh_end_io.bio = btrfsic_process_written_block()
2022 block->next_in_same_bio = chained_block; btrfsic_process_written_block()
2023 bio->bi_private = block; btrfsic_process_written_block()
2026 block->is_iodone = 0; btrfsic_process_written_block()
2027 block->orig_bio_bh_private = bh->b_private; btrfsic_process_written_block()
2028 block->orig_bio_bh_end_io.bh = bh->b_end_io; btrfsic_process_written_block()
2029 block->next_in_same_bio = NULL; btrfsic_process_written_block()
2030 bh->b_private = block; btrfsic_process_written_block()
2033 block->is_iodone = 1; btrfsic_process_written_block()
2034 block->orig_bio_bh_private = NULL; btrfsic_process_written_block()
2035 block->orig_bio_bh_end_io.bio = NULL; btrfsic_process_written_block()
2036 block->next_in_same_bio = NULL; btrfsic_process_written_block()
2040 block->flush_gen = dev_state->last_flush_gen + 1; btrfsic_process_written_block()
2041 block->submit_bio_bh_rw = submit_bio_bh_rw; btrfsic_process_written_block()
2043 block->logical_bytenr = bytenr; btrfsic_process_written_block()
2044 block->is_metadata = 1; btrfsic_process_written_block()
2045 if (block->is_superblock) { btrfsic_process_written_block()
2050 block, btrfsic_process_written_block()
2057 btrfsic_dump_tree_sub(state, block, 0); btrfsic_process_written_block()
2060 block->mirror_num = 0; /* unknown */ btrfsic_process_written_block()
2063 block, btrfsic_process_written_block()
2073 block->is_metadata = 0; btrfsic_process_written_block()
2074 block->mirror_num = 0; /* unknown */ btrfsic_process_written_block()
2075 block->generation = BTRFSIC_GENERATION_UNKNOWN; btrfsic_process_written_block()
2077 && list_empty(&block->ref_from_list)) { btrfsic_process_written_block()
2079 * disk block is overwritten with extent btrfsic_process_written_block()
2082 * chance and free the block's memory btrfsic_process_written_block()
2084 btrfsic_block_hashtable_remove(block); btrfsic_process_written_block()
2085 list_del(&block->all_blocks_node); btrfsic_process_written_block()
2086 btrfsic_block_free(block); btrfsic_process_written_block()
2091 /* block has not been found in hash table */ btrfsic_process_written_block()
2097 printk(KERN_INFO "Written block (%s/%llu/?)" btrfsic_process_written_block()
2101 /* ignore that written D block */ btrfsic_process_written_block()
2117 "Written block @%llu (%s/%llu/?)" btrfsic_process_written_block()
2130 block = btrfsic_block_alloc(); btrfsic_process_written_block()
2131 if (NULL == block) { btrfsic_process_written_block()
2136 block->dev_state = dev_state; btrfsic_process_written_block()
2137 block->dev_bytenr = dev_bytenr; btrfsic_process_written_block()
2138 block->logical_bytenr = bytenr; btrfsic_process_written_block()
2139 block->is_metadata = is_metadata; btrfsic_process_written_block()
2140 block->never_written = 0; btrfsic_process_written_block()
2141 block->iodone_w_error = 0; btrfsic_process_written_block()
2142 block->mirror_num = 0; /* unknown */ btrfsic_process_written_block()
2143 block->flush_gen = dev_state->last_flush_gen + 1; btrfsic_process_written_block()
2144 block->submit_bio_bh_rw = submit_bio_bh_rw; btrfsic_process_written_block()
2146 block->is_iodone = 0; btrfsic_process_written_block()
2149 block->orig_bio_bh_private = bio->bi_private; btrfsic_process_written_block()
2150 block->orig_bio_bh_end_io.bio = bio->bi_end_io; btrfsic_process_written_block()
2151 block->next_in_same_bio = NULL; btrfsic_process_written_block()
2152 bio->bi_private = block; btrfsic_process_written_block()
2161 block->orig_bio_bh_private = btrfsic_process_written_block()
2163 block->orig_bio_bh_end_io.bio = btrfsic_process_written_block()
2165 block->next_in_same_bio = chained_block; btrfsic_process_written_block()
2166 bio->bi_private = block; btrfsic_process_written_block()
2169 block->is_iodone = 0; btrfsic_process_written_block()
2170 block->orig_bio_bh_private = bh->b_private; btrfsic_process_written_block()
2171 block->orig_bio_bh_end_io.bh = bh->b_end_io; btrfsic_process_written_block()
2172 block->next_in_same_bio = NULL; btrfsic_process_written_block()
2173 bh->b_private = block; btrfsic_process_written_block()
2176 block->is_iodone = 1; btrfsic_process_written_block()
2177 block->orig_bio_bh_private = NULL; btrfsic_process_written_block()
2178 block->orig_bio_bh_end_io.bio = NULL; btrfsic_process_written_block()
2179 block->next_in_same_bio = NULL; btrfsic_process_written_block()
2183 "New written %c-block @%llu (%s/%llu/%d)\n", btrfsic_process_written_block()
2185 block->logical_bytenr, block->dev_state->name, btrfsic_process_written_block()
2186 block->dev_bytenr, block->mirror_num); btrfsic_process_written_block()
2187 list_add(&block->all_blocks_node, &state->all_blocks_list); btrfsic_process_written_block()
2188 btrfsic_block_hashtable_add(block, &state->block_hashtable); btrfsic_process_written_block()
2191 ret = btrfsic_process_metablock(state, block, btrfsic_process_written_block()
2212 struct btrfsic_block *block = (struct btrfsic_block *)bp->bi_private; btrfsic_bio_end_io() local
2221 BUG_ON(NULL == block); btrfsic_bio_end_io()
2222 bp->bi_private = block->orig_bio_bh_private; btrfsic_bio_end_io()
2223 bp->bi_end_io = block->orig_bio_bh_end_io.bio; btrfsic_bio_end_io()
2227 struct btrfsic_dev_state *const dev_state = block->dev_state; btrfsic_bio_end_io()
2234 btrfsic_get_block_type(dev_state->state, block), btrfsic_bio_end_io()
2235 block->logical_bytenr, dev_state->name, btrfsic_bio_end_io()
2236 block->dev_bytenr, block->mirror_num); btrfsic_bio_end_io()
2237 next_block = block->next_in_same_bio; btrfsic_bio_end_io()
2238 block->iodone_w_error = iodone_w_error; btrfsic_bio_end_io()
2239 if (block->submit_bio_bh_rw & REQ_FLUSH) { btrfsic_bio_end_io()
2248 if (block->submit_bio_bh_rw & REQ_FUA) btrfsic_bio_end_io()
2249 block->flush_gen = 0; /* FUA completed means block is btrfsic_bio_end_io()
2251 block->is_iodone = 1; /* for FLUSH, this releases the block */ btrfsic_bio_end_io()
2252 block = next_block; btrfsic_bio_end_io()
2253 } while (NULL != block); btrfsic_bio_end_io()
2260 struct btrfsic_block *block = (struct btrfsic_block *)bh->b_private; btrfsic_bh_end_io() local
2264 BUG_ON(NULL == block); btrfsic_bh_end_io()
2265 dev_state = block->dev_state; btrfsic_bh_end_io()
2270 btrfsic_get_block_type(dev_state->state, block), btrfsic_bh_end_io()
2271 block->logical_bytenr, block->dev_state->name, btrfsic_bh_end_io()
2272 block->dev_bytenr, block->mirror_num); btrfsic_bh_end_io()
2274 block->iodone_w_error = iodone_w_error; btrfsic_bh_end_io()
2275 if (block->submit_bio_bh_rw & REQ_FLUSH) { btrfsic_bh_end_io()
2283 if (block->submit_bio_bh_rw & REQ_FUA) btrfsic_bh_end_io()
2284 block->flush_gen = 0; /* FUA completed means block is on disk */ btrfsic_bh_end_io()
2286 bh->b_private = block->orig_bio_bh_private; btrfsic_bh_end_io()
2287 bh->b_end_io = block->orig_bio_bh_end_io.bh; btrfsic_bh_end_io()
2288 block->is_iodone = 1; /* for FLUSH, this releases the block */ btrfsic_bh_end_io()
2436 struct btrfsic_block *const block, btrfsic_check_all_ref_blocks()
2448 * block free operations, it just recognizes block btrfsic_check_all_ref_blocks()
2450 * information for a block until a block is btrfsic_check_all_ref_blocks()
2454 * by the most recent super block. btrfsic_check_all_ref_blocks()
2467 list_for_each(elem_ref_to, &block->ref_to_list) { btrfsic_check_all_ref_blocks()
2477 btrfsic_get_block_type(state, block), btrfsic_check_all_ref_blocks()
2478 block->logical_bytenr, block->dev_state->name, btrfsic_check_all_ref_blocks()
2479 block->dev_bytenr, block->mirror_num, btrfsic_check_all_ref_blocks()
2488 " which references block %c @%llu (%s/%llu/%d)" btrfsic_check_all_ref_blocks()
2498 " which references block %c @%llu (%s/%llu/%d)" btrfsic_check_all_ref_blocks()
2508 " which references block %c @%llu (%s/%llu/%d)" btrfsic_check_all_ref_blocks()
2523 " which references block %c @%llu (%s/%llu/%d)" btrfsic_check_all_ref_blocks()
2537 " which references block %c @%llu (%s/%llu/%d)" btrfsic_check_all_ref_blocks()
2539 " (block flush_gen=%llu," btrfsic_check_all_ref_blocks()
2545 l->block_ref_to->mirror_num, block->flush_gen, btrfsic_check_all_ref_blocks()
2561 const struct btrfsic_block *block, btrfsic_is_block_ref_by_superblock()
2579 list_for_each(elem_ref_from, &block->ref_from_list) { btrfsic_is_block_ref_by_superblock()
2589 btrfsic_get_block_type(state, block), btrfsic_is_block_ref_by_superblock()
2590 block->logical_bytenr, block->dev_state->name, btrfsic_is_block_ref_by_superblock()
2591 block->dev_bytenr, block->mirror_num, btrfsic_is_block_ref_by_superblock()
2649 const struct btrfsic_block *block) btrfsic_get_block_type()
2651 if (block->is_superblock && btrfsic_get_block_type()
2652 state->latest_superblock->dev_bytenr == block->dev_bytenr && btrfsic_get_block_type()
2653 state->latest_superblock->dev_state->bdev == block->dev_state->bdev) btrfsic_get_block_type()
2655 else if (block->is_superblock) btrfsic_get_block_type()
2657 else if (block->is_metadata) btrfsic_get_block_type()
2669 const struct btrfsic_block *block, btrfsic_dump_tree_sub()
2687 btrfsic_get_block_type(state, block), btrfsic_dump_tree_sub()
2688 block->logical_bytenr, block->dev_state->name, btrfsic_dump_tree_sub()
2689 block->dev_bytenr, block->mirror_num); btrfsic_dump_tree_sub()
2696 if (list_empty(&block->ref_to_list)) { btrfsic_dump_tree_sub()
2700 if (block->mirror_num > 1 && btrfsic_dump_tree_sub()
2707 list_for_each(elem_ref_to, &block->ref_to_list) { btrfsic_dump_tree_sub()
2790 struct btrfsic_block *block; btrfsic_block_lookup_or_add() local
2792 block = btrfsic_block_hashtable_lookup(block_ctx->dev->bdev, btrfsic_block_lookup_or_add()
2795 if (NULL == block) { btrfsic_block_lookup_or_add()
2798 block = btrfsic_block_alloc(); btrfsic_block_lookup_or_add()
2799 if (NULL == block) { btrfsic_block_lookup_or_add()
2807 btrfsic_block_free(block); btrfsic_block_lookup_or_add()
2810 block->dev_state = dev_state; btrfsic_block_lookup_or_add()
2811 block->dev_bytenr = block_ctx->dev_bytenr; btrfsic_block_lookup_or_add()
2812 block->logical_bytenr = block_ctx->start; btrfsic_block_lookup_or_add()
2813 block->is_metadata = is_metadata; btrfsic_block_lookup_or_add()
2814 block->is_iodone = is_iodone; btrfsic_block_lookup_or_add()
2815 block->never_written = never_written; btrfsic_block_lookup_or_add()
2816 block->mirror_num = mirror_num; btrfsic_block_lookup_or_add()
2819 "New %s%c-block @%llu (%s/%llu/%d)\n", btrfsic_block_lookup_or_add()
2821 btrfsic_get_block_type(state, block), btrfsic_block_lookup_or_add()
2822 block->logical_bytenr, dev_state->name, btrfsic_block_lookup_or_add()
2823 block->dev_bytenr, mirror_num); btrfsic_block_lookup_or_add()
2824 list_add(&block->all_blocks_node, &state->all_blocks_list); btrfsic_block_lookup_or_add()
2825 btrfsic_block_hashtable_add(block, &state->block_hashtable); btrfsic_block_lookup_or_add()
2833 return block; btrfsic_block_lookup_or_add()
2871 printk(KERN_INFO "btrfs: attempt to write M-block which contains logical bytenr that doesn't map to dev+physical bytenr of submit_bio," btrfsic_cmp_log_and_dev_bytenr()
2940 " but dummy block already in use" btrfsic_submit_bh()
2944 struct btrfsic_block *const block = btrfsic_submit_bh() local
2947 block->is_iodone = 0; btrfsic_submit_bh()
2948 block->never_written = 0; btrfsic_submit_bh()
2949 block->iodone_w_error = 0; btrfsic_submit_bh()
2950 block->flush_gen = dev_state->last_flush_gen + 1; btrfsic_submit_bh()
2951 block->submit_bio_bh_rw = rw; btrfsic_submit_bh()
2952 block->orig_bio_bh_private = bh->b_private; btrfsic_submit_bh()
2953 block->orig_bio_bh_end_io.bh = bh->b_end_io; btrfsic_submit_bh()
2954 block->next_in_same_bio = NULL; btrfsic_submit_bh()
2955 bh->b_private = block; btrfsic_submit_bh()
3038 " but dummy block already in use" __btrfsic_submit_bio()
3042 struct btrfsic_block *const block = __btrfsic_submit_bio() local
3045 block->is_iodone = 0; __btrfsic_submit_bio()
3046 block->never_written = 0; __btrfsic_submit_bio()
3047 block->iodone_w_error = 0; __btrfsic_submit_bio()
3048 block->flush_gen = dev_state->last_flush_gen + 1; __btrfsic_submit_bio()
3049 block->submit_bio_bh_rw = rw; __btrfsic_submit_bio()
3050 block->orig_bio_bh_private = bio->bi_private; __btrfsic_submit_bio()
3051 block->orig_bio_bh_end_io.bio = bio->bi_end_io; __btrfsic_submit_bio()
3052 block->next_in_same_bio = NULL; __btrfsic_submit_bio()
3053 bio->bi_private = block; __btrfsic_submit_bio()
3234 printk(KERN_INFO "btrfs: attempt to free %c-block"
1263 btrfsic_create_link_to_next_block( struct btrfsic_state *state, struct btrfsic_block *block, struct btrfsic_block_data_ctx *block_ctx, u64 next_bytenr, int limit_nesting, struct btrfsic_block_data_ctx *next_block_ctx, struct btrfsic_block **next_blockp, int force_iodone_flag, int *num_copiesp, int *mirror_nump, struct btrfs_disk_key *disk_key, u64 parent_generation) btrfsic_create_link_to_next_block() argument
1411 btrfsic_handle_extent_data( struct btrfsic_state *state, struct btrfsic_block *block, struct btrfsic_block_data_ctx *block_ctx, u32 item_offset, int force_iodone_flag) btrfsic_handle_extent_data() argument
2435 btrfsic_check_all_ref_blocks(struct btrfsic_state *state, struct btrfsic_block *const block, int recursion_level) btrfsic_check_all_ref_blocks() argument
2559 btrfsic_is_block_ref_by_superblock( const struct btrfsic_state *state, const struct btrfsic_block *block, int recursion_level) btrfsic_is_block_ref_by_superblock() argument
2648 btrfsic_get_block_type(const struct btrfsic_state *state, const struct btrfsic_block *block) btrfsic_get_block_type() argument
2668 btrfsic_dump_tree_sub(const struct btrfsic_state *state, const struct btrfsic_block *block, int indent_level) btrfsic_dump_tree_sub() argument
/linux-4.1.27/fs/freevxfs/
H A Dvxfs_subr.c90 * vxfs_bread - read buffer for a give inode,block tuple
92 * @block: logical block
95 * The vxfs_bread function reads block no @block of
102 vxfs_bread(struct inode *ip, int block) vxfs_bread() argument
107 pblock = vxfs_bmap1(ip, block); vxfs_bread()
114 * vxfs_get_block - locate buffer for given inode,block tuple
116 * @iblock: logical block
122 * block and device number to perform a lowlevel read/write on
165 * vxfs_bmap - perform logical to physical block mapping
167 * @block: logical block (relative to @mapping).
170 * Vxfs_bmap find out the corresponding phsical block to the
171 * @mapping, @block pair.
174 * Physical block number on success, else Zero.
180 vxfs_bmap(struct address_space *mapping, sector_t block) vxfs_bmap() argument
182 return generic_block_bmap(mapping, block, vxfs_getblk); vxfs_bmap()
H A Dvxfs_bmap.c31 * Veritas filesystem driver - filesystem to disk block mapping.
48 printk("block=%x ", typ->vt_block); vxfs_typdump()
56 * @iblock: logical block.
64 * The physical block number on success, else Zero.
113 * @indir: indirect block we start reading at
115 * @block: partially result from further searches
122 * The physical block number on success, else Zero.
128 vxfs_bmap_indir(struct inode *ip, long indir, int size, long block) vxfs_bmap_indir() argument
147 if (block < off) { vxfs_bmap_indir()
155 typ->vt_size, block - off); vxfs_bmap_indir()
160 if ((block - off) >= typ->vt_size) vxfs_bmap_indir()
162 pblock = (typ->vt_block + block - off); vxfs_bmap_indir()
170 printk(KERN_INFO "block: %Lu\tsize: %Ld\tdev: %d\n", vxfs_bmap_indir()
192 * @iblock: logical block
198 * The physical block number on success, else Zero.
233 printk(KERN_INFO "block: %Lu\tsize: %Ld\tdev: %d\n", vxfs_bmap_typed()
250 * @iblock: logical block
253 * vxfs_bmap1 perfoms a logical to physical block mapping
257 * The physical block number on success, else Zero.
H A Dvxfs_lookup.c116 u_long npages, page, nblocks, pblocks, block; vxfs_find_entry() local
134 for (block = 0; block <= nblocks && block <= pblocks; block++) { vxfs_find_entry()
139 baddr = kaddr + (block * bsize); vxfs_find_entry()
243 u_long page, npages, block, pblocks, nblocks, offset; vxfs_readdir() local
267 block = (u_long)(pos >> sbp->s_blocksize_bits) % pblocks; vxfs_readdir()
269 for (; page < npages; page++, block = 0) { vxfs_readdir()
278 for (; block <= nblocks && block <= pblocks; block++) { vxfs_readdir()
283 baddr = kaddr + (block * bsize); vxfs_readdir()
/linux-4.1.27/fs/omfs/
H A Domfs.h28 /* convert a cluster number to a scaled block number */ clus_to_blk()
29 static inline sector_t clus_to_blk(struct omfs_sb_info *sbi, sector_t block) clus_to_blk() argument
31 return block << sbi->s_block_shift; clus_to_blk()
41 extern int omfs_allocate_block(struct super_block *sb, u64 block);
44 extern int omfs_clear_range(struct super_block *sb, u64 block, int count);
61 extern struct buffer_head *omfs_bread(struct super_block *sb, sector_t block);
64 extern int omfs_reserve_block(struct super_block *sb, sector_t block);
H A Domfs_fs.h25 __be64 s_root_block; /* block number of omfs_root_block */
28 __be32 s_blocksize; /* size of a block */
34 __be64 h_self; /* FS block where this is located */
49 __be64 r_root_dir; /* block # of root directory */
50 __be64 r_bitmap; /* block # of free space bitmap */
51 __be32 r_blocksize; /* size of a block */
H A Dfile.c141 /* trivially grow current extent, if next block is not taken */ omfs_grow_extent()
157 /* TODO: add a continuation block here */ omfs_grow_extent()
188 * Scans across the directory table for a given file block number.
189 * If block not found, return 0.
192 sector_t block, int count, int *left) find_block()
200 if (block >= searched && find_block()
201 block < searched + numblocks) { find_block()
203 * found it at cluster + (block - searched) find_block()
204 * numblocks - (block - searched) is remainder find_block()
206 *left = numblocks - (block - searched); find_block()
209 block - searched; find_block()
217 static int omfs_get_block(struct inode *inode, sector_t block, omfs_get_block() argument
253 offset = find_block(inode, entry, block, extent_count, &remain); omfs_get_block()
333 static sector_t omfs_bmap(struct address_space *mapping, sector_t block) omfs_bmap() argument
335 return generic_block_bmap(mapping, block, omfs_get_block); omfs_bmap()
191 find_block(struct inode *inode, struct omfs_extent_entry *ent, sector_t block, int count, int *left) find_block() argument
H A Ddir.c21 * Finds the bucket for a given name and reads the containing block;
34 static struct buffer_head *omfs_scan_list(struct inode *dir, u64 block, omfs_scan_list() argument
43 while (block != ~0) { omfs_scan_list()
44 bh = omfs_bread(dir->i_sb, block); omfs_scan_list()
51 if (omfs_is_bad(OMFS_SB(dir->i_sb), &oi->i_head, block)) { omfs_scan_list()
59 *prev_block = block; omfs_scan_list()
60 block = be64_to_cpu(oi->i_sibling); omfs_scan_list()
72 u64 block, dummy; omfs_find_entry() local
78 block = be64_to_cpu(*((__be64 *) &bh->b_data[ofs])); omfs_find_entry()
81 return omfs_scan_list(dir, block, name, namelen, &dummy); omfs_find_entry()
118 u64 block; omfs_add_link() local
128 block = be64_to_cpu(*entry); omfs_add_link()
141 oi->i_sibling = cpu_to_be64(block); omfs_add_link()
165 u64 block, prev; omfs_delete_entry() local
175 block = be64_to_cpu(*entry); omfs_delete_entry()
177 bh2 = omfs_scan_list(dir, block, name, namelen, &prev); omfs_delete_entry()
315 /* sanity check block's self pointer */ omfs_is_bad()
/linux-4.1.27/fs/xfs/libxfs/
H A Dxfs_alloc_btree.h30 * Btree block header size depends on a superblock flag.
41 #define XFS_ALLOC_REC_ADDR(mp, block, index) \
43 ((char *)(block) + \
47 #define XFS_ALLOC_KEY_ADDR(mp, block, index) \
49 ((char *)(block) + \
53 #define XFS_ALLOC_PTR_ADDR(mp, block, index, maxrecs) \
55 ((char *)(block) + \
H A Dxfs_ialloc_btree.h30 * Btree block header size depends on a superblock flag.
41 #define XFS_INOBT_REC_ADDR(mp, block, index) \
43 ((char *)(block) + \
47 #define XFS_INOBT_KEY_ADDR(mp, block, index) \
49 ((char *)(block) + \
53 #define XFS_INOBT_PTR_ADDR(mp, block, index, maxrecs) \
55 ((char *)(block) + \
H A Dxfs_btree.c57 struct xfs_btree_block *block, /* btree long form block pointer */ xfs_btree_check_lblock()
58 int level, /* level of the btree block */ xfs_btree_check_lblock()
59 struct xfs_buf *bp) /* buffer for block, if any */ xfs_btree_check_lblock()
61 int lblock_ok = 1; /* block passes checks */ xfs_btree_check_lblock()
68 uuid_equal(&block->bb_u.l.bb_uuid, &mp->m_sb.sb_uuid) && xfs_btree_check_lblock()
69 block->bb_u.l.bb_blkno == cpu_to_be64( xfs_btree_check_lblock()
74 be32_to_cpu(block->bb_magic) == xfs_btree_magic(cur) && xfs_btree_check_lblock()
75 be16_to_cpu(block->bb_level) == level && xfs_btree_check_lblock()
76 be16_to_cpu(block->bb_numrecs) <= xfs_btree_check_lblock()
78 block->bb_u.l.bb_leftsib && xfs_btree_check_lblock()
79 (block->bb_u.l.bb_leftsib == cpu_to_be64(NULLFSBLOCK) || xfs_btree_check_lblock()
81 be64_to_cpu(block->bb_u.l.bb_leftsib))) && xfs_btree_check_lblock()
82 block->bb_u.l.bb_rightsib && xfs_btree_check_lblock()
83 (block->bb_u.l.bb_rightsib == cpu_to_be64(NULLFSBLOCK) || xfs_btree_check_lblock()
85 be64_to_cpu(block->bb_u.l.bb_rightsib))); xfs_btree_check_lblock()
101 struct xfs_btree_block *block, /* btree short form block pointer */ xfs_btree_check_sblock()
102 int level, /* level of the btree block */ xfs_btree_check_sblock()
103 struct xfs_buf *bp) /* buffer containing block */ xfs_btree_check_sblock()
109 int sblock_ok = 1; /* block passes checks */ xfs_btree_check_sblock()
118 uuid_equal(&block->bb_u.s.bb_uuid, &mp->m_sb.sb_uuid) && xfs_btree_check_sblock()
119 block->bb_u.s.bb_blkno == cpu_to_be64( xfs_btree_check_sblock()
124 be32_to_cpu(block->bb_magic) == xfs_btree_magic(cur) && xfs_btree_check_sblock()
125 be16_to_cpu(block->bb_level) == level && xfs_btree_check_sblock()
126 be16_to_cpu(block->bb_numrecs) <= xfs_btree_check_sblock()
128 (block->bb_u.s.bb_leftsib == cpu_to_be32(NULLAGBLOCK) || xfs_btree_check_sblock()
129 be32_to_cpu(block->bb_u.s.bb_leftsib) < agflen) && xfs_btree_check_sblock()
130 block->bb_u.s.bb_leftsib && xfs_btree_check_sblock()
131 (block->bb_u.s.bb_rightsib == cpu_to_be32(NULLAGBLOCK) || xfs_btree_check_sblock()
132 be32_to_cpu(block->bb_u.s.bb_rightsib) < agflen) && xfs_btree_check_sblock()
133 block->bb_u.s.bb_rightsib; xfs_btree_check_sblock()
147 * Debug routine: check that block header is ok.
152 struct xfs_btree_block *block, /* generic btree block pointer */ xfs_btree_check_block()
153 int level, /* level of the btree block */ xfs_btree_check_block()
154 struct xfs_buf *bp) /* buffer containing block, if any */ xfs_btree_check_block()
157 return xfs_btree_check_lblock(cur, block, level, bp); xfs_btree_check_block()
159 return xfs_btree_check_sblock(cur, block, level, bp); xfs_btree_check_block()
168 xfs_fsblock_t bno, /* btree block disk address */ xfs_btree_check_lptr()
169 int level) /* btree block level */ xfs_btree_check_lptr()
185 xfs_agblock_t bno, /* btree block disk address */ xfs_btree_check_sptr()
186 int level) /* btree block level */ xfs_btree_check_sptr()
199 * Check that block ptr is ok.
204 union xfs_btree_ptr *ptr, /* btree block disk address */ xfs_btree_check_ptr()
206 int level) /* btree block level */ xfs_btree_check_ptr()
219 * Calculate CRC on the whole btree block and stuff it into the
230 struct xfs_btree_block *block = XFS_BUF_TO_BLOCK(bp); xfs_btree_lblock_calc_crc() local
236 block->bb_u.l.bb_lsn = cpu_to_be64(bip->bli_item.li_lsn); xfs_btree_lblock_calc_crc()
251 * Calculate CRC on the whole btree block and stuff it into the
262 struct xfs_btree_block *block = XFS_BUF_TO_BLOCK(bp); xfs_btree_sblock_calc_crc() local
268 block->bb_u.s.bb_lsn = cpu_to_be64(bip->bli_item.li_lsn); xfs_btree_sblock_calc_crc()
329 xfs_buf_t *bp; /* btree block's buffer pointer */ xfs_btree_dup_cursor()
331 int i; /* level number of btree block */ xfs_btree_dup_cursor()
374 * XFS btree block layout and addressing:
379 * the values. A non-leaf block also starts with the same header, and
392 * and comes in different versions for short (32bit) and long (64bit) block
394 * and opaque to the btree core. The block pointers are simple disk endian
398 * into a btree block (xfs_btree_*_offset) or return a pointer to the given
400 * inside the btree block is done using indices starting at one, not zero!
404 * Return size of the btree block header for this btree instance.
419 * Return size of btree block pointers for this btree instance.
428 * Calculate offset of the n-th record in a btree block.
440 * Calculate offset of the n-th key in a btree block.
452 * Calculate offset of the n-th block pointer in a btree block.
466 * Return a pointer to the n-th record in the btree block.
472 struct xfs_btree_block *block) xfs_btree_rec_addr()
475 ((char *)block + xfs_btree_rec_offset(cur, n)); xfs_btree_rec_addr()
479 * Return a pointer to the n-th key in the btree block.
485 struct xfs_btree_block *block) xfs_btree_key_addr()
488 ((char *)block + xfs_btree_key_offset(cur, n)); xfs_btree_key_addr()
492 * Return a pointer to the n-th block pointer in the btree block.
498 struct xfs_btree_block *block) xfs_btree_ptr_addr()
500 int level = xfs_btree_get_level(block); xfs_btree_ptr_addr()
502 ASSERT(block->bb_level != 0); xfs_btree_ptr_addr()
505 ((char *)block + xfs_btree_ptr_offset(cur, n, level)); xfs_btree_ptr_addr()
509 * Get the root block which is stored in the inode.
525 * Retrieve the block pointer from the cursor at the given level.
528 STATIC struct xfs_btree_block * /* generic btree block pointer */ xfs_btree_get_block()
532 struct xfs_buf **bpp) /* buffer containing the block */ xfs_btree_get_block()
545 * Get a buffer for the block, return it with no data read.
552 xfs_fsblock_t fsbno, /* file system block number */ xfs_btree_get_bufl()
555 xfs_daddr_t d; /* real disk block address */ xfs_btree_get_bufl()
563 * Get a buffer for the block, return it with no data read.
571 xfs_agblock_t agbno, /* allocation group block number */ xfs_btree_get_bufs()
574 xfs_daddr_t d; /* real disk block address */ xfs_btree_get_bufs()
583 * Check for the cursor referring to the last block at the given level.
585 int /* 1=is last block, 0=not last block */ xfs_btree_islastblock()
590 struct xfs_btree_block *block; /* generic btree block pointer */ xfs_btree_islastblock() local
591 xfs_buf_t *bp; /* buffer containing block */ xfs_btree_islastblock()
593 block = xfs_btree_get_block(cur, level, &bp); xfs_btree_islastblock()
594 xfs_btree_check_block(cur, block, level, bp); xfs_btree_islastblock()
596 return block->bb_u.l.bb_rightsib == cpu_to_be64(NULLFSBLOCK); xfs_btree_islastblock()
598 return block->bb_u.s.bb_rightsib == cpu_to_be32(NULLAGBLOCK); xfs_btree_islastblock()
610 struct xfs_btree_block *block; /* generic btree block pointer */ xfs_btree_firstrec() local
611 xfs_buf_t *bp; /* buffer containing block */ xfs_btree_firstrec()
614 * Get the block pointer for this level. xfs_btree_firstrec()
616 block = xfs_btree_get_block(cur, level, &bp); xfs_btree_firstrec()
617 xfs_btree_check_block(cur, block, level, bp); xfs_btree_firstrec()
621 if (!block->bb_numrecs) xfs_btree_firstrec()
631 * Change the cursor to point to the last record in the current block
639 struct xfs_btree_block *block; /* generic btree block pointer */ xfs_btree_lastrec() local
640 xfs_buf_t *bp; /* buffer containing block */ xfs_btree_lastrec()
643 * Get the block pointer for this level. xfs_btree_lastrec()
645 block = xfs_btree_get_block(cur, level, &bp); xfs_btree_lastrec()
646 xfs_btree_check_block(cur, block, level, bp); xfs_btree_lastrec()
650 if (!block->bb_numrecs) xfs_btree_lastrec()
655 cur->bc_ptrs[level] = be16_to_cpu(block->bb_numrecs); xfs_btree_lastrec()
696 * Get a buffer for the block, return it read in.
703 xfs_fsblock_t fsbno, /* file system block number */ xfs_btree_read_bufl()
710 xfs_daddr_t d; /* real disk block address */ xfs_btree_read_bufl()
726 * Read-ahead the block, don't wait for it, don't return a buffer.
733 xfs_fsblock_t fsbno, /* file system block number */ xfs_btree_reada_bufl()
745 * Read-ahead the block, don't wait for it, don't return a buffer.
753 xfs_agblock_t agbno, /* allocation group block number */ xfs_btree_reada_bufs()
769 struct xfs_btree_block *block) xfs_btree_readahead_lblock()
772 xfs_fsblock_t left = be64_to_cpu(block->bb_u.l.bb_leftsib); xfs_btree_readahead_lblock()
773 xfs_fsblock_t right = be64_to_cpu(block->bb_u.l.bb_rightsib); xfs_btree_readahead_lblock()
794 struct xfs_btree_block *block) xfs_btree_readahead_sblock()
797 xfs_agblock_t left = be32_to_cpu(block->bb_u.s.bb_leftsib); xfs_btree_readahead_sblock()
798 xfs_agblock_t right = be32_to_cpu(block->bb_u.s.bb_rightsib); xfs_btree_readahead_sblock()
826 struct xfs_btree_block *block; xfs_btree_readahead() local
840 block = XFS_BUF_TO_BLOCK(cur->bc_bufs[lev]); xfs_btree_readahead()
843 return xfs_btree_readahead_lblock(cur, lr, block); xfs_btree_readahead()
844 return xfs_btree_readahead_sblock(cur, lr, block); xfs_btree_readahead()
892 struct xfs_btree_block *b; /* btree block */ xfs_btree_setbuf()
941 struct xfs_btree_block *block, xfs_btree_get_sibling()
949 ptr->l = block->bb_u.l.bb_rightsib; xfs_btree_get_sibling()
951 ptr->l = block->bb_u.l.bb_leftsib; xfs_btree_get_sibling()
954 ptr->s = block->bb_u.s.bb_rightsib; xfs_btree_get_sibling()
956 ptr->s = block->bb_u.s.bb_leftsib; xfs_btree_get_sibling()
963 struct xfs_btree_block *block, xfs_btree_set_sibling()
971 block->bb_u.l.bb_rightsib = ptr->l; xfs_btree_set_sibling()
973 block->bb_u.l.bb_leftsib = ptr->l; xfs_btree_set_sibling()
976 block->bb_u.s.bb_rightsib = ptr->s; xfs_btree_set_sibling()
978 block->bb_u.s.bb_leftsib = ptr->s; xfs_btree_set_sibling()
1069 struct xfs_btree_block *block, xfs_btree_is_lastrec()
1079 xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_RIGHTSIB); xfs_btree_is_lastrec()
1127 struct xfs_btree_block **block, xfs_btree_get_buf_block()
1144 *block = XFS_BUF_TO_BLOCK(*bpp); xfs_btree_get_buf_block()
1150 * the block pointer within the buffer.
1157 struct xfs_btree_block **block, xfs_btree_read_buf_block()
1175 *block = XFS_BUF_TO_BLOCK(*bpp); xfs_btree_read_buf_block()
1180 * Copy keys from one btree block to another.
1194 * Copy records from one btree block to another.
1208 * Copy block pointers from one btree block to another.
1222 * Shift keys one index left/right inside a single btree block.
1241 * Shift records one index left/right inside a single btree block.
1260 * Shift block pointers one index left/right inside a single btree block.
1279 * Log key values from the btree block.
1305 * Log record values from the btree block.
1326 * Log block pointer fields from a btree block (nonleaf).
1331 struct xfs_buf *bp, /* buffer containing btree block */ xfs_btree_log_ptrs()
1339 struct xfs_btree_block *block = XFS_BUF_TO_BLOCK(bp); xfs_btree_log_ptrs() local
1340 int level = xfs_btree_get_level(block); xfs_btree_log_ptrs()
1355 * Log fields from a btree block header.
1360 struct xfs_buf *bp, /* buffer containing btree block */ xfs_btree_log_block()
1402 * block but instead recreate it during log xfs_btree_log_block()
1437 struct xfs_btree_block *block; xfs_btree_increment() local
1451 /* Get a pointer to the btree block. */ xfs_btree_increment()
1452 block = xfs_btree_get_block(cur, level, &bp); xfs_btree_increment()
1455 error = xfs_btree_check_block(cur, block, level, bp); xfs_btree_increment()
1460 /* We're done if we remain in the block after the increment. */ xfs_btree_increment()
1461 if (++cur->bc_ptrs[level] <= xfs_btree_get_numrecs(block)) xfs_btree_increment()
1465 xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_RIGHTSIB); xfs_btree_increment()
1473 * Stop when we don't go off the right edge of a block. xfs_btree_increment()
1476 block = xfs_btree_get_block(cur, lev, &bp); xfs_btree_increment()
1479 error = xfs_btree_check_block(cur, block, lev, bp); xfs_btree_increment()
1484 if (++cur->bc_ptrs[lev] <= xfs_btree_get_numrecs(block)) xfs_btree_increment()
1487 /* Read-ahead the right block for the next loop. */ xfs_btree_increment()
1508 for (block = xfs_btree_get_block(cur, lev, &bp); lev > level; ) { xfs_btree_increment()
1511 ptrp = xfs_btree_ptr_addr(cur, cur->bc_ptrs[lev], block); xfs_btree_increment()
1513 error = xfs_btree_read_buf_block(cur, ptrp, 0, &block, &bp); xfs_btree_increment()
1545 struct xfs_btree_block *block; xfs_btree_decrement() local
1559 /* We're done if we remain in the block after the decrement. */ xfs_btree_decrement()
1563 /* Get a pointer to the btree block. */ xfs_btree_decrement()
1564 block = xfs_btree_get_block(cur, level, &bp); xfs_btree_decrement()
1567 error = xfs_btree_check_block(cur, block, level, bp); xfs_btree_decrement()
1573 xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_LEFTSIB); xfs_btree_decrement()
1581 * Stop when we don't go off the left edge of a block. xfs_btree_decrement()
1586 /* Read-ahead the left block for the next loop. */ xfs_btree_decrement()
1607 for (block = xfs_btree_get_block(cur, lev, &bp); lev > level; ) { xfs_btree_decrement()
1610 ptrp = xfs_btree_ptr_addr(cur, cur->bc_ptrs[lev], block); xfs_btree_decrement()
1612 error = xfs_btree_read_buf_block(cur, ptrp, 0, &block, &bp); xfs_btree_decrement()
1616 cur->bc_ptrs[lev] = xfs_btree_get_numrecs(block); xfs_btree_decrement()
1637 union xfs_btree_ptr *pp, /* ptr to btree block */ xfs_btree_lookup_get_block()
1638 struct xfs_btree_block **blkp) /* return btree block */ xfs_btree_lookup_get_block()
1640 struct xfs_buf *bp; /* buffer pointer for btree block */ xfs_btree_lookup_get_block()
1643 /* special case the root block if in an inode */ xfs_btree_lookup_get_block()
1680 struct xfs_btree_block *block, xfs_lookup_get_search_key()
1685 xfs_btree_rec_addr(cur, keyno, block)); xfs_lookup_get_search_key()
1689 return xfs_btree_key_addr(cur, keyno, block); xfs_lookup_get_search_key()
1702 struct xfs_btree_block *block; /* current btree block */ xfs_btree_lookup() local
1707 union xfs_btree_ptr *pp; /* ptr to btree block */ xfs_btree_lookup()
1708 union xfs_btree_ptr ptr; /* ptr to btree block */ xfs_btree_lookup()
1715 block = NULL; xfs_btree_lookup()
1725 * on the lookup record, then follow the corresponding block xfs_btree_lookup()
1729 /* Get the block we need to do the lookup on. */ xfs_btree_lookup()
1730 error = xfs_btree_lookup_get_block(cur, level, pp, &block); xfs_btree_lookup()
1737 * know we need to use the first entry in this block. xfs_btree_lookup()
1741 /* Otherwise search this block. Do a binary search. */ xfs_btree_lookup()
1748 high = xfs_btree_get_numrecs(block); xfs_btree_lookup()
1759 /* Binary search the block. */ xfs_btree_lookup()
1771 keyno, block, &key); xfs_btree_lookup()
1791 * by getting the block number and filling in the cursor. xfs_btree_lookup()
1800 pp = xfs_btree_ptr_addr(cur, keyno, block); xfs_btree_lookup()
1815 * If ge search and we went off the end of the block, but it's xfs_btree_lookup()
1816 * not the last block, we're in the wrong block. xfs_btree_lookup()
1818 xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_RIGHTSIB); xfs_btree_lookup()
1820 keyno > xfs_btree_get_numrecs(block) && xfs_btree_lookup()
1838 if (keyno == 0 || keyno > xfs_btree_get_numrecs(block)) xfs_btree_lookup()
1861 struct xfs_btree_block *block; xfs_btree_updkey() local
1875 * at the first entry in the block. xfs_btree_updkey()
1881 block = xfs_btree_get_block(cur, level, &bp); xfs_btree_updkey()
1883 error = xfs_btree_check_block(cur, block, level, bp); xfs_btree_updkey()
1890 kp = xfs_btree_key_addr(cur, ptr, block); xfs_btree_updkey()
1909 struct xfs_btree_block *block; xfs_btree_update() local
1918 /* Pick up the current block. */ xfs_btree_update()
1919 block = xfs_btree_get_block(cur, 0, &bp); xfs_btree_update()
1922 error = xfs_btree_check_block(cur, block, 0, bp); xfs_btree_update()
1928 rp = xfs_btree_rec_addr(cur, ptr, block); xfs_btree_update()
1938 if (xfs_btree_is_lastrec(cur, block, 0)) { xfs_btree_update()
1939 cur->bc_ops->update_lastrec(cur, block, rec, xfs_btree_update()
1973 struct xfs_btree_block *left; /* left btree block */ xfs_btree_lshift()
1976 struct xfs_btree_block *right; /* right btree block */ xfs_btree_lshift()
1991 /* Set up variables for this block as "right". */ xfs_btree_lshift()
2036 * If non-leaf, copy a key and a ptr to the left block. xfs_btree_lshift()
2037 * Log the changes to the left block. xfs_btree_lshift()
2114 * If it's the first record in the block, we'll need a key xfs_btree_lshift()
2156 struct xfs_btree_block *left; /* left btree block */ xfs_btree_rshift()
2158 struct xfs_btree_block *right; /* right btree block */ xfs_btree_rshift()
2160 union xfs_btree_ptr rptr; /* right block pointer */ xfs_btree_rshift()
2174 /* Set up variables for this block as "left". */ xfs_btree_rshift()
2210 * Make a hole at the start of the right neighbor block, then xfs_btree_rshift()
2211 * copy the last left block entry to the hole. xfs_btree_rshift()
2282 * block on the right. xfs_btree_rshift()
2320 * Split cur/level block in half.
2321 * Return new block number and the key to its first
2333 union xfs_btree_ptr lptr; /* left sibling block ptr */ __xfs_btree_split()
2335 struct xfs_btree_block *left; /* left btree block */ __xfs_btree_split()
2336 union xfs_btree_ptr rptr; /* right sibling block ptr */ __xfs_btree_split()
2338 struct xfs_btree_block *right; /* right btree block */ __xfs_btree_split()
2341 struct xfs_btree_block *rrblock; /* right-right btree block */ __xfs_btree_split()
2355 /* Set up left block (current one). */ __xfs_btree_split()
2366 /* Allocate the new block. If we can't do it, we're toast. Give up. */ __xfs_btree_split()
2374 /* Set up the new block as "right". */ __xfs_btree_split()
2379 /* Fill in the btree header for the new right block. */ __xfs_btree_split()
2383 * Split the entries between the old and the new block evenly. __xfs_btree_split()
2385 * each new block will have the same number of entries. __xfs_btree_split()
2396 * Copy btree block entries from the left block over to the __xfs_btree_split()
2397 * new block, the right. Update the right block and log the __xfs_btree_split()
2426 /* Grab the keys to the entries moved to the right block */ __xfs_btree_split()
2445 * Find the left block number by looking in the buffer. __xfs_btree_split()
2461 * If there's a block to the new block's right, make that block __xfs_btree_split()
2473 * If the cursor is really in the right block, move it there. __xfs_btree_split()
2483 * the right block, no matter where this cursor was. __xfs_btree_split()
2533 * temporarily to ensure that we don't block waiting for memory reclaim xfs_btree_split_worker()
2585 * Copy the old inode root contents into a real block and make the
2595 struct xfs_btree_block *block; /* btree block */ xfs_btree_new_iroot() local
2596 struct xfs_btree_block *cblock; /* child btree block */ xfs_btree_new_iroot()
2600 union xfs_btree_ptr *pp; /* pointer to block addr */ xfs_btree_new_iroot()
2601 union xfs_btree_ptr nptr; /* new block addr */ xfs_btree_new_iroot()
2615 block = xfs_btree_get_iroot(cur); xfs_btree_new_iroot()
2616 pp = xfs_btree_ptr_addr(cur, 1, block); xfs_btree_new_iroot()
2618 /* Allocate the new block. If we can't do it, we're toast. Give up. */ xfs_btree_new_iroot()
2628 /* Copy the root into a real block. */ xfs_btree_new_iroot()
2637 memcpy(cblock, block, xfs_btree_block_len(cur)); xfs_btree_new_iroot()
2645 be16_add_cpu(&block->bb_level, 1); xfs_btree_new_iroot()
2646 xfs_btree_set_numrecs(block, 1); xfs_btree_new_iroot()
2650 kp = xfs_btree_key_addr(cur, 1, block); xfs_btree_new_iroot()
2696 * Allocate a new root block, fill it in.
2703 struct xfs_btree_block *block; /* one half of the old root block */ xfs_btree_new_root() local
2704 struct xfs_buf *bp; /* buffer containing block */ xfs_btree_new_root()
2707 struct xfs_btree_block *left; /* left btree block */ xfs_btree_new_root()
2709 struct xfs_btree_block *new; /* new (root) btree block */ xfs_btree_new_root()
2712 struct xfs_btree_block *right; /* right btree block */ xfs_btree_new_root()
2722 /* Allocate the new block. If we can't do it, we're toast. Give up. */ xfs_btree_new_root()
2730 /* Set up the new block. */ xfs_btree_new_root()
2740 * and the new block generated when it was split. We don't know which xfs_btree_new_root()
2744 block = xfs_btree_get_block(cur, cur->bc_nlevels - 1, &bp); xfs_btree_new_root()
2747 error = xfs_btree_check_block(cur, block, cur->bc_nlevels - 1, bp); xfs_btree_new_root()
2752 xfs_btree_get_sibling(cur, block, &rptr, XFS_BB_RIGHTSIB); xfs_btree_new_root()
2754 /* Our block is left, pick up the right block. */ xfs_btree_new_root()
2757 left = block; xfs_btree_new_root()
2764 /* Our block is right, pick up the left block. */ xfs_btree_new_root()
2767 right = block; xfs_btree_new_root()
2775 /* Fill in the new block's btree header and log it. */ xfs_btree_new_root()
2826 int numrecs,/* # of recs in block */ xfs_btree_make_block_unfull()
2842 /* A root block that can be made bigger. */ xfs_btree_make_block_unfull()
2845 /* A root block that needs replacing */ xfs_btree_make_block_unfull()
2874 * Next, try splitting the current block in half. xfs_btree_make_block_unfull()
2877 * could be in a different block now. xfs_btree_make_block_unfull()
2897 union xfs_btree_ptr *ptrp, /* i/o: block number inserted */ xfs_btree_insrec()
2902 struct xfs_btree_block *block; /* btree block */ xfs_btree_insrec() local
2903 struct xfs_buf *bp; /* buffer for block */ xfs_btree_insrec()
2905 union xfs_btree_ptr nptr; /* new block ptr */ xfs_btree_insrec()
2923 * root level, allocate a new root block and we're done. xfs_btree_insrec()
2949 /* Get pointers to the btree buffer and block. */ xfs_btree_insrec()
2950 block = xfs_btree_get_block(cur, level, &bp); xfs_btree_insrec()
2951 numrecs = xfs_btree_get_numrecs(block); xfs_btree_insrec()
2954 error = xfs_btree_check_block(cur, block, level, bp); xfs_btree_insrec()
2962 xfs_btree_rec_addr(cur, ptr, block))); xfs_btree_insrec()
2965 xfs_btree_key_addr(cur, ptr, block))); xfs_btree_insrec()
2971 * If the block is full, we can't insert the new entry until we xfs_btree_insrec()
2972 * make the block un-full. xfs_btree_insrec()
2983 * The current block may have changed if the block was xfs_btree_insrec()
2986 block = xfs_btree_get_block(cur, level, &bp); xfs_btree_insrec()
2987 numrecs = xfs_btree_get_numrecs(block); xfs_btree_insrec()
2990 error = xfs_btree_check_block(cur, block, level, bp); xfs_btree_insrec()
2996 * At this point we know there's room for our new entry in the block xfs_btree_insrec()
3006 kp = xfs_btree_key_addr(cur, ptr, block); xfs_btree_insrec()
3007 pp = xfs_btree_ptr_addr(cur, ptr, block); xfs_btree_insrec()
3030 xfs_btree_set_numrecs(block, numrecs); xfs_btree_insrec()
3036 xfs_btree_key_addr(cur, ptr + 1, block))); xfs_btree_insrec()
3043 rp = xfs_btree_rec_addr(cur, ptr, block); xfs_btree_insrec()
3049 xfs_btree_set_numrecs(block, ++numrecs); xfs_btree_insrec()
3054 xfs_btree_rec_addr(cur, ptr + 1, block))); xfs_btree_insrec()
3062 /* If we inserted at the start of a block, update the parents' keys. */ xfs_btree_insrec()
3073 if (xfs_btree_is_lastrec(cur, block, level)) { xfs_btree_insrec()
3074 cur->bc_ops->update_lastrec(cur, block, recp, xfs_btree_insrec()
3079 * Return the new block number, if any. xfs_btree_insrec()
3112 union xfs_btree_ptr nptr; /* new block number (split result) */ xfs_btree_insert()
3126 * Stop when we don't get a split block, that must mean that xfs_btree_insert()
3173 * Try to merge a non-leaf block back into the inode root.
3176 * killing the old root block. But because we can't just delete the
3177 * inode we have to copy the single block it was pointing to into the
3187 struct xfs_btree_block *block; xfs_btree_kill_iroot() local
3208 * Don't deal with the root block needs to be a leaf case. xfs_btree_kill_iroot()
3218 block = xfs_btree_get_iroot(cur); xfs_btree_kill_iroot()
3219 if (xfs_btree_get_numrecs(block) != 1) xfs_btree_kill_iroot()
3236 xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_LEFTSIB); xfs_btree_kill_iroot()
3238 xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_RIGHTSIB); xfs_btree_kill_iroot()
3246 block = ifp->if_broot; xfs_btree_kill_iroot()
3249 be16_add_cpu(&block->bb_numrecs, index); xfs_btree_kill_iroot()
3250 ASSERT(block->bb_numrecs == cblock->bb_numrecs); xfs_btree_kill_iroot()
3252 kp = xfs_btree_key_addr(cur, 1, block); xfs_btree_kill_iroot()
3256 pp = xfs_btree_ptr_addr(cur, 1, block); xfs_btree_kill_iroot()
3275 be16_add_cpu(&block->bb_level, -1); xfs_btree_kill_iroot()
3344 * Remove the record from its block then rebalance the tree.
3353 struct xfs_btree_block *block; /* btree block */ xfs_btree_delrec() local
3354 union xfs_btree_ptr cptr; /* current block ptr */ xfs_btree_delrec()
3355 struct xfs_buf *bp; /* buffer for block */ xfs_btree_delrec()
3360 union xfs_btree_ptr lptr; /* left sibling block ptr */ xfs_btree_delrec()
3362 struct xfs_btree_block *left; /* left btree block */ xfs_btree_delrec()
3365 union xfs_btree_ptr rptr; /* right sibling block ptr */ xfs_btree_delrec()
3367 struct xfs_btree_block *right; /* right btree block */ xfs_btree_delrec()
3368 struct xfs_btree_block *rrblock; /* right-right btree block */ xfs_btree_delrec()
3387 /* Get the buffer & block containing the record or key/ptr. */ xfs_btree_delrec()
3388 block = xfs_btree_get_block(cur, level, &bp); xfs_btree_delrec()
3389 numrecs = xfs_btree_get_numrecs(block); xfs_btree_delrec()
3392 error = xfs_btree_check_block(cur, block, level, bp); xfs_btree_delrec()
3397 /* Fail if we're off the end of the block. */ xfs_btree_delrec()
3413 lkp = xfs_btree_key_addr(cur, ptr + 1, block); xfs_btree_delrec()
3414 lpp = xfs_btree_ptr_addr(cur, ptr + 1, block); xfs_btree_delrec()
3432 * If it's the first record in the block, we'll need to pass a xfs_btree_delrec()
3436 keyp = xfs_btree_key_addr(cur, 1, block); xfs_btree_delrec()
3441 xfs_btree_rec_addr(cur, ptr + 1, block), xfs_btree_delrec()
3447 * If it's the first record in the block, we'll need a key xfs_btree_delrec()
3452 xfs_btree_rec_addr(cur, 1, block)); xfs_btree_delrec()
3458 * Decrement and log the number of entries in the block. xfs_btree_delrec()
3460 xfs_btree_set_numrecs(block, --numrecs); xfs_btree_delrec()
3467 if (xfs_btree_is_lastrec(cur, block, level)) { xfs_btree_delrec()
3468 cur->bc_ops->update_lastrec(cur, block, NULL, xfs_btree_delrec()
3473 * We're at the root level. First, shrink the root block in-memory. xfs_btree_delrec()
3501 * pp is still set to the first pointer in the block. xfs_btree_delrec()
3504 pp = xfs_btree_ptr_addr(cur, 1, block); xfs_btree_delrec()
3518 * If we deleted the leftmost entry in the block, update the xfs_btree_delrec()
3528 * If the number of records remaining in the block is at least xfs_btree_delrec()
3543 xfs_btree_get_sibling(cur, block, &rptr, XFS_BB_RIGHTSIB); xfs_btree_delrec()
3544 xfs_btree_get_sibling(cur, block, &lptr, XFS_BB_LEFTSIB); xfs_btree_delrec()
3581 * Move the temp cursor to the last entry in the next block. xfs_btree_delrec()
3595 /* Grab a pointer to the block. */ xfs_btree_delrec()
3602 /* Grab the current block number, for future use. */ xfs_btree_delrec()
3606 * If right block is full enough so that removing one entry xfs_btree_delrec()
3616 ASSERT(xfs_btree_get_numrecs(block) >= xfs_btree_delrec()
3632 * to our block again (last record). xfs_btree_delrec()
3653 * previous block. xfs_btree_delrec()
3664 /* Grab a pointer to the block. */ xfs_btree_delrec()
3671 /* Grab the current block number, for future use. */ xfs_btree_delrec()
3675 * If left block is full enough so that removing one entry xfs_btree_delrec()
3685 ASSERT(xfs_btree_get_numrecs(block) >= xfs_btree_delrec()
3712 lrecs + xfs_btree_get_numrecs(block) <= xfs_btree_delrec()
3715 * Set "right" to be the starting block, xfs_btree_delrec()
3719 right = block; xfs_btree_delrec()
3726 * If that won't work, see if we can join with the right neighbor block. xfs_btree_delrec()
3729 rrecs + xfs_btree_get_numrecs(block) <= xfs_btree_delrec()
3732 * Set "left" to be the starting block, xfs_btree_delrec()
3736 left = block; xfs_btree_delrec()
3799 * Fix up the number of records and right block pointer in the xfs_btree_delrec()
3800 * surviving block, and log it. xfs_btree_delrec()
3807 /* If there is a right sibling, point it to the remaining block. */ xfs_btree_delrec()
3817 /* Free the deleted block. */ xfs_btree_delrec()
3825 * cursor to the left block, and fix up the index. xfs_btree_delrec()
3920 struct xfs_btree_block *block; /* btree block */ xfs_btree_get_rec() local
3928 block = xfs_btree_get_block(cur, 0, &bp); xfs_btree_get_rec()
3931 error = xfs_btree_check_block(cur, block, 0, bp); xfs_btree_get_rec()
3939 if (ptr > xfs_btree_get_numrecs(block) || ptr <= 0) { xfs_btree_get_rec()
3947 *recp = xfs_btree_rec_addr(cur, ptr, block); xfs_btree_get_rec()
3965 * as the amount of CPU work we have to do before moving to the next block is
3968 * For each btree block that we load, modify the owner appropriately, set the
3983 struct xfs_btree_block *block; xfs_btree_block_change_owner() local
3991 block = xfs_btree_get_block(cur, level, &bp); xfs_btree_block_change_owner()
3993 block->bb_u.l.bb_owner = cpu_to_be64(new_owner); xfs_btree_block_change_owner()
3995 block->bb_u.s.bb_owner = cpu_to_be32(new_owner); xfs_btree_block_change_owner()
3998 * If the block is a root block hosted in an inode, we might not have a xfs_btree_block_change_owner()
4001 * block is formatted into the on-disk inode fork. We still change it, xfs_btree_block_change_owner()
4016 /* now read rh sibling block for next iteration */ xfs_btree_block_change_owner()
4017 xfs_btree_get_sibling(cur, block, &rptr, XFS_BB_RIGHTSIB); xfs_btree_block_change_owner()
4021 return xfs_btree_lookup_get_block(cur, level, &rptr, &block); xfs_btree_block_change_owner()
4032 struct xfs_btree_block *block = NULL; xfs_btree_change_owner() local
4039 /* grab the left hand block */ xfs_btree_change_owner()
4040 error = xfs_btree_lookup_get_block(cur, level, &lptr, &block); xfs_btree_change_owner()
4044 /* readahead the left most block for the next level down */ xfs_btree_change_owner()
4048 ptr = xfs_btree_ptr_addr(cur, 1, block); xfs_btree_change_owner()
55 xfs_btree_check_lblock( struct xfs_btree_cur *cur, struct xfs_btree_block *block, int level, struct xfs_buf *bp) xfs_btree_check_lblock() argument
99 xfs_btree_check_sblock( struct xfs_btree_cur *cur, struct xfs_btree_block *block, int level, struct xfs_buf *bp) xfs_btree_check_sblock() argument
150 xfs_btree_check_block( struct xfs_btree_cur *cur, struct xfs_btree_block *block, int level, struct xfs_buf *bp) xfs_btree_check_block() argument
469 xfs_btree_rec_addr( struct xfs_btree_cur *cur, int n, struct xfs_btree_block *block) xfs_btree_rec_addr() argument
482 xfs_btree_key_addr( struct xfs_btree_cur *cur, int n, struct xfs_btree_block *block) xfs_btree_key_addr() argument
495 xfs_btree_ptr_addr( struct xfs_btree_cur *cur, int n, struct xfs_btree_block *block) xfs_btree_ptr_addr() argument
766 xfs_btree_readahead_lblock( struct xfs_btree_cur *cur, int lr, struct xfs_btree_block *block) xfs_btree_readahead_lblock() argument
791 xfs_btree_readahead_sblock( struct xfs_btree_cur *cur, int lr, struct xfs_btree_block *block) xfs_btree_readahead_sblock() argument
939 xfs_btree_get_sibling( struct xfs_btree_cur *cur, struct xfs_btree_block *block, union xfs_btree_ptr *ptr, int lr) xfs_btree_get_sibling() argument
961 xfs_btree_set_sibling( struct xfs_btree_cur *cur, struct xfs_btree_block *block, union xfs_btree_ptr *ptr, int lr) xfs_btree_set_sibling() argument
1067 xfs_btree_is_lastrec( struct xfs_btree_cur *cur, struct xfs_btree_block *block, int level) xfs_btree_is_lastrec() argument
1123 xfs_btree_get_buf_block( struct xfs_btree_cur *cur, union xfs_btree_ptr *ptr, int flags, struct xfs_btree_block **block, struct xfs_buf **bpp) xfs_btree_get_buf_block() argument
1153 xfs_btree_read_buf_block( struct xfs_btree_cur *cur, union xfs_btree_ptr *ptr, int flags, struct xfs_btree_block **block, struct xfs_buf **bpp) xfs_btree_read_buf_block() argument
1676 xfs_lookup_get_search_key( struct xfs_btree_cur *cur, int level, int keyno, struct xfs_btree_block *block, union xfs_btree_key *kp) xfs_lookup_get_search_key() argument
H A Dxfs_rtbitmap.c45 * Get a buffer for the bitmap or summary file block specified.
52 xfs_rtblock_t block, /* block number in bitmap or summary */ xfs_rtbuf_get()
54 xfs_buf_t **bpp) /* output: buffer for the block */ xfs_rtbuf_get()
56 xfs_buf_t *bp; /* block buffer, result */ xfs_rtbuf_get()
64 error = xfs_bmapi_read(ip, block, 1, &map, &nmap, XFS_DATA_FORK); xfs_rtbuf_get()
79 * Searching backward from start to limit, find the first block whose
86 xfs_rtblock_t start, /* starting block to look at */ xfs_rtfind_back()
87 xfs_rtblock_t limit, /* last block to look at */ xfs_rtfind_back()
88 xfs_rtblock_t *rtblock) /* out: start block found */ xfs_rtfind_back()
92 xfs_rtblock_t block; /* bitmap block number */ xfs_rtfind_back() local
93 xfs_buf_t *bp; /* buf for the block */ xfs_rtfind_back()
105 * Compute and read in starting bitmap block for starting block. xfs_rtfind_back()
107 block = XFS_BITTOBLOCK(mp, start); xfs_rtfind_back()
108 error = xfs_rtbuf_get(mp, tp, block, 0, &bp); xfs_rtfind_back()
152 * Go on to previous block if that's where the previous word is xfs_rtfind_back()
157 * If done with this block, get the previous one. xfs_rtfind_back()
160 error = xfs_rtbuf_get(mp, tp, --block, 0, &bp); xfs_rtfind_back()
198 * Go on to previous block if that's where the previous word is xfs_rtfind_back()
203 * If done with this block, get the previous one. xfs_rtfind_back()
206 error = xfs_rtbuf_get(mp, tp, --block, 0, &bp); xfs_rtfind_back()
254 * Searching forward from start to limit, find the first block whose
261 xfs_rtblock_t start, /* starting block to look at */ xfs_rtfind_forw()
262 xfs_rtblock_t limit, /* last block to look at */ xfs_rtfind_forw()
263 xfs_rtblock_t *rtblock) /* out: start block found */ xfs_rtfind_forw()
267 xfs_rtblock_t block; /* bitmap block number */ xfs_rtfind_forw() local
268 xfs_buf_t *bp; /* buf for the block */ xfs_rtfind_forw()
280 * Compute and read in starting bitmap block for starting block. xfs_rtfind_forw()
282 block = XFS_BITTOBLOCK(mp, start); xfs_rtfind_forw()
283 error = xfs_rtbuf_get(mp, tp, block, 0, &bp); xfs_rtfind_forw()
326 * Go on to next block if that's where the next word is xfs_rtfind_forw()
331 * If done with this block, get the previous one. xfs_rtfind_forw()
334 error = xfs_rtbuf_get(mp, tp, ++block, 0, &bp); xfs_rtfind_forw()
371 * Go on to next block if that's where the next word is xfs_rtfind_forw()
376 * If done with this block, get the next one. xfs_rtfind_forw()
379 error = xfs_rtbuf_get(mp, tp, ++block, 0, &bp); xfs_rtfind_forw()
425 * bitmap block combination.
426 * Keeps track of a current summary block, so we don't keep reading
437 xfs_rtblock_t bbno, /* bitmap block number */ xfs_rtmodify_summary_int()
439 xfs_buf_t **rbpp, /* in/out: summary block buffer */ xfs_rtmodify_summary_int()
440 xfs_fsblock_t *rsb, /* in/out: summary block number */ xfs_rtmodify_summary_int()
441 xfs_suminfo_t *sum) /* out: summary info for this block */ xfs_rtmodify_summary_int()
443 xfs_buf_t *bp; /* buffer for the summary block */ xfs_rtmodify_summary_int()
454 * Compute the block number in the summary file. xfs_rtmodify_summary_int()
458 * If we have an old buffer, and the block number matches, use that. xfs_rtmodify_summary_int()
476 * Remember this buffer and block for the next call. xfs_rtmodify_summary_int()
501 xfs_rtblock_t bbno, /* bitmap block number */ xfs_rtmodify_summary()
503 xfs_buf_t **rbpp, /* in/out: summary block buffer */ xfs_rtmodify_summary()
504 xfs_fsblock_t *rsb) /* in/out: summary block number */ xfs_rtmodify_summary()
518 xfs_rtblock_t start, /* starting block to modify */ xfs_rtmodify_range()
524 xfs_rtblock_t block; /* bitmap block number */ xfs_rtmodify_range() local
525 xfs_buf_t *bp; /* buf for the block */ xfs_rtmodify_range()
535 * Compute starting bitmap block number. xfs_rtmodify_range()
537 block = XFS_BITTOBLOCK(mp, start); xfs_rtmodify_range()
539 * Read the bitmap block, and point to its data. xfs_rtmodify_range()
541 error = xfs_rtbuf_get(mp, tp, block, 0, &bp); xfs_rtmodify_range()
575 * Go on to the next block if that's where the next word is xfs_rtmodify_range()
580 * Log the changed part of this block. xfs_rtmodify_range()
586 error = xfs_rtbuf_get(mp, tp, ++block, 0, &bp); xfs_rtmodify_range()
615 * Go on to the next block if that's where the next word is xfs_rtmodify_range()
620 * Log the changed part of this block. xfs_rtmodify_range()
626 error = xfs_rtbuf_get(mp, tp, ++block, 0, &bp); xfs_rtmodify_range()
675 xfs_rtblock_t start, /* starting block to free */ xfs_rtfree_range()
677 xfs_buf_t **rbpp, /* in/out: summary block buffer */ xfs_rtfree_range()
678 xfs_fsblock_t *rsb) /* in/out: summary block number */ xfs_rtfree_range()
682 xfs_rtblock_t postblock; /* first block freed > end */ xfs_rtfree_range()
683 xfs_rtblock_t preblock; /* first block freed < start */ xfs_rtfree_range()
703 * Find the next allocated block (end of allocated extent). xfs_rtfree_range()
751 xfs_rtblock_t start, /* starting block number of extent */ xfs_rtcheck_range()
754 xfs_rtblock_t *new, /* out: first block not matching */ xfs_rtcheck_range()
759 xfs_rtblock_t block; /* bitmap block number */ xfs_rtcheck_range() local
760 xfs_buf_t *bp; /* buf for the block */ xfs_rtcheck_range()
770 * Compute starting bitmap block number xfs_rtcheck_range()
772 block = XFS_BITTOBLOCK(mp, start); xfs_rtcheck_range()
774 * Read the bitmap block. xfs_rtcheck_range()
776 error = xfs_rtbuf_get(mp, tp, block, 0, &bp); xfs_rtcheck_range()
819 * Go on to next block if that's where the next word is xfs_rtcheck_range()
824 * If done with this block, get the next one. xfs_rtcheck_range()
827 error = xfs_rtbuf_get(mp, tp, ++block, 0, &bp); xfs_rtcheck_range()
865 * Go on to next block if that's where the next word is xfs_rtcheck_range()
870 * If done with this block, get the next one. xfs_rtcheck_range()
873 error = xfs_rtbuf_get(mp, tp, ++block, 0, &bp); xfs_rtcheck_range()
921 * Check that the given extent (block range) is allocated already.
927 xfs_rtblock_t bno, /* starting block number of extent */ xfs_rtcheck_alloc_range()
945 * realtime extents, as is the block number.
950 xfs_rtblock_t bno, /* starting block number to free */ xfs_rtfree_extent()
955 xfs_fsblock_t sb; /* summary file block number */ xfs_rtfree_extent()
956 xfs_buf_t *sumbp = NULL; /* summary file block buffer */ xfs_rtfree_extent()
49 xfs_rtbuf_get( xfs_mount_t *mp, xfs_trans_t *tp, xfs_rtblock_t block, int issum, xfs_buf_t **bpp) xfs_rtbuf_get() argument
H A Dxfs_bmap_btree.h36 * Btree block header size depends on a superblock flag.
42 #define XFS_BMBT_REC_ADDR(mp, block, index) \
44 ((char *)(block) + \
48 #define XFS_BMBT_KEY_ADDR(mp, block, index) \
50 ((char *)(block) + \
54 #define XFS_BMBT_PTR_ADDR(mp, block, index, maxrecs) \
56 ((char *)(block) + \
61 #define XFS_BMDR_REC_ADDR(block, index) \
63 ((char *)(block) + \
67 #define XFS_BMDR_KEY_ADDR(block, index) \
69 ((char *)(block) + \
73 #define XFS_BMDR_PTR_ADDR(block, index, maxrecs) \
75 ((char *)(block) + \
81 * These are to be used when we know the size of the block and
H A Dxfs_btree.h42 xfs_bmdr_key_t bmbr; /* bmbt root block */
49 xfs_bmdr_rec_t bmbr; /* bmbt root block */
131 /* block allocation / freeing */
140 struct xfs_btree_block *block,
144 /* records in block/level */
240 * Convert from buffer to btree block header.
246 * Check that block header is ok.
251 struct xfs_btree_block *block, /* generic btree block pointer */
252 int level, /* level of the btree block */
253 struct xfs_buf *bp); /* buffer containing block, if any */
261 xfs_fsblock_t ptr, /* btree block disk address */
262 int level); /* btree block level */
282 * Get a buffer for the block, return it with no data read.
289 xfs_fsblock_t fsbno, /* file system block number */
293 * Get a buffer for the block, return it with no data read.
301 xfs_agblock_t agbno, /* allocation group block number */
305 * Check for the cursor referring to the last block at the given level.
307 int /* 1=is last block, 0=not last block */
325 * Get a buffer for the block, return it read in.
332 xfs_fsblock_t fsbno, /* file system block number */
339 * Read-ahead the block, don't wait for it, don't return a buffer.
345 xfs_fsblock_t fsbno, /* file system block number */
350 * Read-ahead the block, don't wait for it, don't return a buffer.
357 xfs_agblock_t agbno, /* allocation group block number */
362 * Initialise a new btree block header
400 * btree block CRC helpers
416 static inline int xfs_btree_get_numrecs(struct xfs_btree_block *block) xfs_btree_get_numrecs() argument
418 return be16_to_cpu(block->bb_numrecs); xfs_btree_get_numrecs()
421 static inline void xfs_btree_set_numrecs(struct xfs_btree_block *block, xfs_btree_set_numrecs() argument
424 block->bb_numrecs = cpu_to_be16(numrecs); xfs_btree_set_numrecs()
427 static inline int xfs_btree_get_level(struct xfs_btree_block *block) xfs_btree_get_level() argument
429 return be16_to_cpu(block->bb_level); xfs_btree_get_level()
454 * b = btree block buffer (xfs_buf_t)
H A Dxfs_dir2_block.c328 * Add an entry to a block directory.
334 xfs_dir2_data_hdr_t *hdr; /* block header */ xfs_dir2_block_addname()
335 xfs_dir2_leaf_entry_t *blp; /* block leaf entries */ xfs_dir2_block_addname()
336 struct xfs_buf *bp; /* buffer for block */ xfs_dir2_block_addname()
337 xfs_dir2_block_tail_t *btp; /* block tail */ xfs_dir2_block_addname()
339 xfs_dir2_data_entry_t *dep; /* block data entry */ xfs_dir2_block_addname()
341 xfs_dir2_data_unused_t *dup; /* block unused entry */ xfs_dir2_block_addname()
363 /* Read the (one and only) directory block into bp. */ xfs_dir2_block_addname()
371 * Set up pointers to parts of the block. xfs_dir2_block_addname()
565 * Log leaf entries from the block.
570 struct xfs_buf *bp, /* block buffer */ xfs_dir2_block_log_leaf()
585 * Log the block tail.
590 struct xfs_buf *bp) /* block buffer */ xfs_dir2_block_log_tail()
601 * Look up an entry in the block. This is the external routine,
608 xfs_dir2_data_hdr_t *hdr; /* block header */ xfs_dir2_block_lookup()
609 xfs_dir2_leaf_entry_t *blp; /* block leaf entries */ xfs_dir2_block_lookup()
610 struct xfs_buf *bp; /* block buffer */ xfs_dir2_block_lookup()
611 xfs_dir2_block_tail_t *btp; /* block tail */ xfs_dir2_block_lookup()
612 xfs_dir2_data_entry_t *dep; /* block data entry */ xfs_dir2_block_lookup()
637 * Fill in inode number, CI name if appropriate, release the block. xfs_dir2_block_lookup()
647 * Internal block lookup routine.
652 struct xfs_buf **bpp, /* returned block buffer */ xfs_dir2_block_lookup_int()
656 xfs_dir2_data_hdr_t *hdr; /* block header */ xfs_dir2_block_lookup_int()
657 xfs_dir2_leaf_entry_t *blp; /* block leaf entries */ xfs_dir2_block_lookup_int()
658 struct xfs_buf *bp; /* block buffer */ xfs_dir2_block_lookup_int()
659 xfs_dir2_block_tail_t *btp; /* block tail */ xfs_dir2_block_lookup_int()
660 xfs_dir2_data_entry_t *dep; /* block data entry */ xfs_dir2_block_lookup_int()
751 * Remove an entry from a block format directory.
752 * If that makes the block small enough to fit in shortform, transform it.
758 xfs_dir2_data_hdr_t *hdr; /* block header */ xfs_dir2_block_removename()
759 xfs_dir2_leaf_entry_t *blp; /* block leaf pointer */ xfs_dir2_block_removename()
760 struct xfs_buf *bp; /* block buffer */ xfs_dir2_block_removename()
761 xfs_dir2_block_tail_t *btp; /* block tail */ xfs_dir2_block_removename()
762 xfs_dir2_data_entry_t *dep; /* block data entry */ xfs_dir2_block_removename()
764 int ent; /* block leaf entry index */ xfs_dir2_block_removename()
766 int needlog; /* need to log block header */ xfs_dir2_block_removename()
775 * Look up the entry in the block. Gets the buffer and entry index. xfs_dir2_block_removename()
800 * Fix up the block tail. xfs_dir2_block_removename()
831 * Replace an entry in a V2 block directory.
838 xfs_dir2_data_hdr_t *hdr; /* block header */ xfs_dir2_block_replace()
839 xfs_dir2_leaf_entry_t *blp; /* block leaf entries */ xfs_dir2_block_replace()
840 struct xfs_buf *bp; /* block buffer */ xfs_dir2_block_replace()
841 xfs_dir2_block_tail_t *btp; /* block tail */ xfs_dir2_block_replace()
842 xfs_dir2_data_entry_t *dep; /* block data entry */ xfs_dir2_block_replace()
878 * Qsort comparison routine for the block leaf entries.
895 * Convert a V2 leaf directory to a V2 block directory if possible.
904 xfs_dir2_data_hdr_t *hdr; /* block header */ xfs_dir2_leaf_to_block()
905 xfs_dir2_block_tail_t *btp; /* block tail */ xfs_dir2_leaf_to_block()
919 int to; /* block/leaf to index */ xfs_dir2_leaf_to_block()
957 * Read the data block if we don't already have it, give up if it fails. xfs_dir2_leaf_to_block()
969 * Size of the "leaf" area in the block. xfs_dir2_leaf_to_block()
986 * Start converting it to block form. xfs_dir2_leaf_to_block()
993 * Use up the space at the end of the block (blp/btp). xfs_dir2_leaf_to_block()
998 * Initialize the block tail. xfs_dir2_leaf_to_block()
1005 * Initialize the block leaf area. We compact out stale entries. xfs_dir2_leaf_to_block()
1016 * Scan the bestfree if we need it and log the data block header. xfs_dir2_leaf_to_block()
1023 * Pitch the old leaf block. xfs_dir2_leaf_to_block()
1030 * Now see if the resulting block can be shrunken to shortform. xfs_dir2_leaf_to_block()
1040 * Convert the shortform directory to block form.
1046 xfs_dir2_db_t blkno; /* dir-relative block # (0) */ xfs_dir2_sf_to_block()
1047 xfs_dir2_data_hdr_t *hdr; /* block header */ xfs_dir2_sf_to_block()
1048 xfs_dir2_leaf_entry_t *blp; /* block leaf entries */ xfs_dir2_sf_to_block()
1049 struct xfs_buf *bp; /* block buffer */ xfs_dir2_sf_to_block()
1050 xfs_dir2_block_tail_t *btp; /* block tail pointer */ xfs_dir2_sf_to_block()
1059 int needlog; /* need to log block header */ xfs_dir2_sf_to_block()
1060 int needscan; /* need to scan block freespc */ xfs_dir2_sf_to_block()
1062 int offset; /* target block offset */ xfs_dir2_sf_to_block()
1105 * Add block 0 to the inode. xfs_dir2_sf_to_block()
1113 * Initialize the data block, then convert it to block format. xfs_dir2_sf_to_block()
1124 * Compute size of block "tail" area. xfs_dir2_sf_to_block()
H A Dxfs_alloc_btree.c79 /* Allocate the new block from the freelist. If we can't, give up. */ xfs_allocbt_alloc_block()
132 struct xfs_btree_block *block, xfs_allocbt_update_lastrec()
148 * If this is the last leaf block and it's the last record, xfs_allocbt_update_lastrec()
151 if (ptr != xfs_btree_get_numrecs(block)) xfs_allocbt_update_lastrec()
162 numrecs = xfs_btree_get_numrecs(block); xfs_allocbt_update_lastrec()
170 rrp = XFS_ALLOC_REC_ADDR(cur->bc_mp, block, numrecs); xfs_allocbt_update_lastrec()
277 struct xfs_btree_block *block = XFS_BUF_TO_BLOCK(bp); xfs_allocbt_verify() local
293 level = be16_to_cpu(block->bb_level); xfs_allocbt_verify()
294 switch (block->bb_magic) { xfs_allocbt_verify()
298 if (!uuid_equal(&block->bb_u.s.bb_uuid, &mp->m_sb.sb_uuid)) xfs_allocbt_verify()
300 if (block->bb_u.s.bb_blkno != cpu_to_be64(bp->b_bn)) xfs_allocbt_verify()
303 be32_to_cpu(block->bb_u.s.bb_owner) != pag->pag_agno) xfs_allocbt_verify()
316 if (!uuid_equal(&block->bb_u.s.bb_uuid, &mp->m_sb.sb_uuid)) xfs_allocbt_verify()
318 if (block->bb_u.s.bb_blkno != cpu_to_be64(bp->b_bn)) xfs_allocbt_verify()
321 be32_to_cpu(block->bb_u.s.bb_owner) != pag->pag_agno) xfs_allocbt_verify()
336 if (be16_to_cpu(block->bb_numrecs) > mp->m_alloc_mxr[level != 0]) xfs_allocbt_verify()
340 if (!block->bb_u.s.bb_leftsib || xfs_allocbt_verify()
341 (be32_to_cpu(block->bb_u.s.bb_leftsib) >= mp->m_sb.sb_agblocks && xfs_allocbt_verify()
342 block->bb_u.s.bb_leftsib != cpu_to_be32(NULLAGBLOCK))) xfs_allocbt_verify()
344 if (!block->bb_u.s.bb_rightsib || xfs_allocbt_verify()
345 (be32_to_cpu(block->bb_u.s.bb_rightsib) >= mp->m_sb.sb_agblocks && xfs_allocbt_verify()
346 block->bb_u.s.bb_rightsib != cpu_to_be32(NULLAGBLOCK))) xfs_allocbt_verify()
490 * Calculate number of records in an alloc btree block.
130 xfs_allocbt_update_lastrec( struct xfs_btree_cur *cur, struct xfs_btree_block *block, union xfs_btree_rec *rec, int ptr, int reason) xfs_allocbt_update_lastrec() argument
H A Dxfs_dir2_node.c52 * Check internal consistency of a leafn block.
216 * Initialize the new block to be empty, and remember xfs_dir3_free_get_buf()
238 * Log entries from a freespace block.
261 * Log header from a freespace block.
281 * We need to change the magic number of the leaf block, and copy
282 * the freespace table out of the leaf block into its own block.
292 xfs_dir2_db_t fdb; /* freespace block number */ xfs_dir2_leaf_to_node()
309 * Add a freespace block to the directory. xfs_dir2_leaf_to_node()
316 * Get the buffer for the new freespace block. xfs_dir2_leaf_to_node()
330 * Copy freespace entries from the leaf block to the new block. xfs_dir2_leaf_to_node()
342 * Now initialize the freespace block header. xfs_dir2_leaf_to_node()
369 * Add a leaf entry to a leaf block in a node-form directory.
405 * the block, if there are no stale entries it won't fit. xfs_dir2_leafn_add()
504 * Look up a leaf entry for space to add a name in a node-format leaf block.
505 * The extrablk in state is a freespace block.
515 xfs_dir2_db_t curdb = -1; /* current data block number */ xfs_dir2_leafn_lookup_for_addname()
516 xfs_dir2_db_t curfdb = -1; /* current free block number */ xfs_dir2_leafn_lookup_for_addname()
520 xfs_dir2_free_t *free = NULL; /* free block structure */ xfs_dir2_leafn_lookup_for_addname()
526 xfs_dir2_db_t newdb; /* new data block number */ xfs_dir2_leafn_lookup_for_addname()
527 xfs_dir2_db_t newfdb; /* new free block number */ xfs_dir2_leafn_lookup_for_addname()
550 /* If so, it's a free block buffer, get the block number. */ xfs_dir2_leafn_lookup_for_addname()
570 * Pull the data block number from the entry. xfs_dir2_leafn_lookup_for_addname()
576 * We want to use a data block with an entry of equal xfs_dir2_leafn_lookup_for_addname()
579 * If this block isn't the data block we already have xfs_dir2_leafn_lookup_for_addname()
587 * Convert the data block to the free block xfs_dir2_leafn_lookup_for_addname()
636 /* Giving back a free block. */ xfs_dir2_leafn_lookup_for_addname()
659 * Look up a leaf entry in a node-format leaf block.
660 * The extrablk in state a data block.
670 xfs_dir2_db_t curdb = -1; /* current data block number */ xfs_dir2_leafn_lookup_for_entry()
671 xfs_dir2_data_entry_t *dep; /* data block entry */ xfs_dir2_leafn_lookup_for_entry()
678 xfs_dir2_db_t newdb; /* new data block number */ xfs_dir2_leafn_lookup_for_entry()
717 * Pull the data block number from the entry. xfs_dir2_leafn_lookup_for_entry()
725 * If it's a different data block, go get it. xfs_dir2_leafn_lookup_for_entry()
729 * If we had a block before that we aren't saving xfs_dir2_leafn_lookup_for_entry()
736 * If needing the block that is saved with a CI match, xfs_dir2_leafn_lookup_for_entry()
737 * use it otherwise read in the new data block. xfs_dir2_leafn_lookup_for_entry()
763 * match, store the block & inode number and continue looking. xfs_dir2_leafn_lookup_for_entry()
767 /* If there is a CI match block, drop it */ xfs_dir2_leafn_lookup_for_entry()
790 /* Giving back last used data block. */ xfs_dir2_leafn_lookup_for_entry()
799 /* If the curbp is not the CI match block, drop it */ xfs_dir2_leafn_lookup_for_entry()
811 * Look up a leaf entry in a node-format leaf block.
812 * If this is an addname then the extrablk in state is a freespace block,
813 * otherwise it's a data block.
938 * This is actually only called when the second block is new,
946 xfs_da_state_blk_t *blk1, /* first btree block */ xfs_dir2_leafn_rebalance()
947 xfs_da_state_blk_t *blk2) /* second btree block */ xfs_dir2_leafn_rebalance()
968 * If the block order is wrong, swap the arguments. xfs_dir2_leafn_rebalance()
971 xfs_da_state_blk_t *tmp; /* temp for block swap */ xfs_dir2_leafn_rebalance()
1083 * Data block is not empty, just set the free entry to the new xfs_dir3_data_block_free()
1118 * If there are no useful entries left in the block, get rid of the xfs_dir3_data_block_free()
1119 * block if we can. xfs_dir3_data_block_free()
1133 * else will eventually get rid of this block. xfs_dir3_data_block_free()
1146 * and updates the free block if necessary.
1153 xfs_da_state_blk_t *dblk, /* data block */ xfs_dir2_leafn_remove()
1154 int *rval) /* resulting block needs join */ xfs_dir2_leafn_remove()
1156 xfs_dir2_data_hdr_t *hdr; /* data block header */ xfs_dir2_leafn_remove()
1157 xfs_dir2_db_t db; /* data block number */ xfs_dir2_leafn_remove()
1158 struct xfs_buf *dbp; /* data block buffer */ xfs_dir2_leafn_remove()
1159 xfs_dir2_data_entry_t *dep; /* data block entry */ xfs_dir2_leafn_remove()
1164 int off; /* data block entry offset */ xfs_dir2_leafn_remove()
1186 * Extract the data block and offset from the entry. xfs_dir2_leafn_remove()
1195 * Log the leaf block changes. xfs_dir2_leafn_remove()
1206 * in the data block in case it changes. xfs_dir2_leafn_remove()
1217 * Rescan the data block freespaces for bestfree. xfs_dir2_leafn_remove()
1218 * Log the data block header if needed. xfs_dir2_leafn_remove()
1226 * If the longest data block freespace changes, need to update xfs_dir2_leafn_remove()
1232 xfs_dir2_db_t fdb; /* freeblock block number */ xfs_dir2_leafn_remove()
1237 * Convert the data block number to a free block, xfs_dir2_leafn_remove()
1238 * read in the free block. xfs_dir2_leafn_remove()
1262 * If the data block is now empty we can get rid of it xfs_dir2_leafn_remove()
1268 * Try to punch out the data block. xfs_dir2_leafn_remove()
1278 * will eventually get rid of the empty block. xfs_dir2_leafn_remove()
1284 * If we got rid of the data block, we can eliminate that entry xfs_dir2_leafn_remove()
1285 * in the free block. xfs_dir2_leafn_remove()
1295 * Return indication of whether this leaf block is empty enough xfs_dir2_leafn_remove()
1305 * Split the leaf entries in the old block into old and new blocks.
1310 xfs_da_state_blk_t *oldblk, /* original block */ xfs_dir2_leafn_split()
1311 xfs_da_state_blk_t *newblk) /* newly created block */ xfs_dir2_leafn_split()
1314 xfs_dablk_t blkno; /* new leaf block number */ xfs_dir2_leafn_split()
1329 * Initialize the new leaf block. xfs_dir2_leafn_split()
1340 * block into the leaves. xfs_dir2_leafn_split()
1348 * Insert the new entry in the correct block. xfs_dir2_leafn_split()
1355 * Update last hashval in each block since we added the name. xfs_dir2_leafn_split()
1365 * Check a leaf block and its neighbors to see if the block should be
1366 * collapsed into one or the other neighbor. Always keep the block
1367 * with the smaller block number.
1368 * If the current block is over 50% full, don't try to join it, return 0.
1369 * If the block is empty, fill in the state structure and return 2.
1378 xfs_da_state_blk_t *blk; /* leaf block */ xfs_dir2_leafn_toosmall()
1379 xfs_dablk_t blkno; /* leaf block number */ xfs_dir2_leafn_toosmall()
1384 int forward; /* sibling block direction */ xfs_dir2_leafn_toosmall()
1393 * Check for the degenerate case of the block being over 50% full. xfs_dir2_leafn_toosmall()
1413 * Check for the degenerate case of the block being empty. xfs_dir2_leafn_toosmall()
1414 * If the block is empty, we'll simply delete it, no need to xfs_dir2_leafn_toosmall()
1415 * coalesce it with a sibling block. We choose (arbitrarily) xfs_dir2_leafn_toosmall()
1416 * to merge with the forward block unless it is NULL. xfs_dir2_leafn_toosmall()
1420 * Make altpath point to the block we want to keep and xfs_dir2_leafn_toosmall()
1421 * path point to the block we want to drop (this one). xfs_dir2_leafn_toosmall()
1433 * Examine each sibling block to see if we can coalesce with xfs_dir2_leafn_toosmall()
1435 * whether to merge with the forward or the backward block. xfs_dir2_leafn_toosmall()
1447 * Read the sibling leaf block. xfs_dir2_leafn_toosmall()
1475 * Didn't like either block, give up. xfs_dir2_leafn_toosmall()
1483 * Make altpath point to the block we want to keep (the lower xfs_dir2_leafn_toosmall()
1484 * numbered block) and path point to the block we want to drop. xfs_dir2_leafn_toosmall()
1507 xfs_da_state_blk_t *drop_blk, /* dead block */ xfs_dir2_leafn_unbalance()
1508 xfs_da_state_blk_t *save_blk) /* surviving block */ xfs_dir2_leafn_unbalance()
1570 xfs_da_state_blk_t *blk; /* leaf block for insert */ xfs_dir2_node_addname()
1594 * Add the data entry to a data block. xfs_dir2_node_addname()
1616 * It didn't work, we need to split the leaf block. xfs_dir2_node_addname()
1623 * Split the leaf block and insert the new entry. xfs_dir2_node_addname()
1635 * We may enter with a freespace block that the lookup found.
1640 xfs_da_state_blk_t *fblk) /* optional freespace block */ xfs_dir2_node_addname_int()
1642 xfs_dir2_data_hdr_t *hdr; /* data block header */ xfs_dir2_node_addname_int()
1643 xfs_dir2_db_t dbno; /* data block number */ xfs_dir2_node_addname_int()
1644 struct xfs_buf *dbp; /* data block buffer */ xfs_dir2_node_addname_int()
1649 xfs_dir2_db_t fbno; /* freespace block number */ xfs_dir2_node_addname_int()
1652 xfs_dir2_free_t *free=NULL; /* freespace block structure */ xfs_dir2_node_addname_int()
1653 xfs_dir2_db_t ifbno; /* initial freespace block no */ xfs_dir2_node_addname_int()
1654 xfs_dir2_db_t lastfbno=0; /* highest freespace block no */ xfs_dir2_node_addname_int()
1671 * If we came in with a freespace block that means that lookup xfs_dir2_node_addname_int()
1673 * block for that data entry. xfs_dir2_node_addname_int()
1678 * Remember initial freespace block number. xfs_dir2_node_addname_int()
1687 * This means the free entry showed that the data block had xfs_dir2_node_addname_int()
1689 * Use that data block. xfs_dir2_node_addname_int()
1698 * The data block looked at didn't have enough room. xfs_dir2_node_addname_int()
1706 * Didn't come in with a freespace block, so no data block. xfs_dir2_node_addname_int()
1714 * If we don't have a data block yet, we're going to scan the xfs_dir2_node_addname_int()
1716 * highest freespace block number is. xfs_dir2_node_addname_int()
1719 xfs_fileoff_t fo; /* freespace block number */ xfs_dir2_node_addname_int()
1727 * While we haven't identified a data block, search the freeblock xfs_dir2_node_addname_int()
1728 * data for a good data block. If we find a null freeblock entry, xfs_dir2_node_addname_int()
1738 * us a freespace block to start with. xfs_dir2_node_addname_int()
1754 * Read the block. There can be holes in the xfs_dir2_node_addname_int()
1788 * Drop the block. xfs_dir2_node_addname_int()
1798 * If we don't have a data block, we need to allocate one and make xfs_dir2_node_addname_int()
1809 * Allocate and initialize the new data block. xfs_dir2_node_addname_int()
1818 * If (somehow) we have a freespace block, get rid of it. xfs_dir2_node_addname_int()
1826 * Get the freespace block corresponding to the data block xfs_dir2_node_addname_int()
1837 * If there wasn't a freespace block, the read will xfs_dir2_node_addname_int()
1848 "%s: dir ino %llu needed freesp block %lld for\n" xfs_dir2_node_addname_int()
1849 " data block %lld, got %lld ifbno %llu lastfbno %d", xfs_dir2_node_addname_int()
1871 * Get a buffer for the new block. xfs_dir2_node_addname_int()
1894 * Set the freespace block index from the data block number. xfs_dir2_node_addname_int()
1899 * freespace block, extend that table. xfs_dir2_node_addname_int()
1910 * If this entry was for an empty data block xfs_dir2_node_addname_int()
1929 * We had a data block so we don't have to make a new one. xfs_dir2_node_addname_int()
1939 * Read the data block in. xfs_dir2_node_addname_int()
1975 * Rescan the block for bestfree if needed. xfs_dir2_node_addname_int()
1980 * Log the data block header if needed. xfs_dir2_node_addname_int()
1998 * Return the data block and offset in args, then drop the data block. xfs_dir2_node_addname_int()
2043 * Release the btree blocks and leaf block. xfs_dir2_node_lookup()
2050 * Release the data block if we have it. xfs_dir2_node_lookup()
2067 struct xfs_da_state_blk *blk; /* leaf block */ xfs_dir2_node_removename()
2097 * Extrablk refers to the data block. xfs_dir2_node_removename()
2129 xfs_da_state_blk_t *blk; /* leaf block */ xfs_dir2_node_replace()
2130 xfs_dir2_data_hdr_t *hdr; /* data block header */ xfs_dir2_node_replace()
2199 * Didn't find it, and we're holding a data block. Drop it. xfs_dir2_node_replace()
2217 * Trim off a trailing empty freespace block.
2223 xfs_fileoff_t fo, /* free block number */ xfs_dir2_node_trim_free()
2236 * Read the freespace block. xfs_dir2_node_trim_free()
2259 * Blow the block away. xfs_dir2_node_trim_free()
2267 * pieces. This is the last block of an extent. xfs_dir2_node_trim_free()
H A Dxfs_da_format.h26 * level in the Btree, and to identify which type of block this is.
34 __be32 forw; /* previous block in list */
35 __be32 back; /* following block in list */
36 __be16 magic; /* validity check on block */
60 __be32 crc; /* CRC of block */
61 __be64 blkno; /* first block of the buffer */
64 __be64 owner; /* inode that owns the block */
74 * all match in the block, not just the first match found.
79 struct xfs_da_blkinfo info; /* block type, links, etc. */
85 struct xfs_da3_blkinfo info; /* block type, links, etc. */
95 __be32 before; /* Btree block before this key */
126 * - single block - data with embedded leaf at the end
127 * - multiple data blocks, single leaf+freeindex block
134 #define XFS_DIR2_BLOCK_MAGIC 0x58443242 /* XD2B: single block dirs */
142 * is in the block header and dirent formats. In many cases the v3 structures
160 * - a larger block header for CRC and identification purposes and so the
166 #define XFS_DIR3_BLOCK_MAGIC 0x58444233 /* XDB3: single block dirs */
188 * Byte offset in data block and shortform entry.
195 * Normalized offset (in a data block) of the entry, really xfs_dir2_data_off_t.
196 * Only need 16 bits, this is the byte offset into the single block form.
213 * Directory block number (logical dirblk in file)
292 * Data block structures.
294 * A pure data block looks like the following drawing on disk:
311 * most structures are also used for the combined data/freespace "block"
329 * Describe a free area in the data block.
351 * directory block structures. This will be used in several structures.
357 __be32 crc; /* CRC of block */
358 __be64 blkno; /* first block of the buffer */
361 __be64 owner; /* inode that owns the block */
373 * Active entry in a data block.
392 * Unused entry in a data block.
415 * Leaf block structures.
417 * A pure leaf block looks like the following drawing on disk:
436 * The xfs_dir2_data_off_t members (bests) and tail are at the end of the block
446 * Offset of the leaf/node space. First block in this space
453 * Leaf block header.
477 * Leaf block entry.
485 * Leaf block tail.
492 * Leaf block.
507 * Get address of the bests array in the single-leaf block.
516 * Free space block defintions for the node format.
533 xfs_dir2_free_hdr_t hdr; /* block header */
555 * In core version of the free block header, abstracted away from on-disk format
568 * Single block format.
570 * The single block format looks like the following drawing on disk:
599 * Pointer to the leaf entries embedded in a data block (1-block format)
615 * internal links in the Btree are logical block offsets into the file.
622 * still don't have enough space, then we have to split the block. The
627 * takes the first-in-the-block key match found, so we should only have
649 typedef struct xfs_attr_leaf_hdr { /* constant-structure header block */
650 xfs_da_blkinfo_t info; /* block type, links, etc. */
674 __be32 valueblk; /* block number of value bytes */
681 xfs_attr_leaf_hdr_t hdr; /* constant-structure header block */
684 * The rest of the block contains the following structures after the
717 * The rest of the block contains the following structures after the
750 * Special value to represent fs block size in the leaf header firstused field.
751 * Only used when block size overflows the 2-bytes available on disk.
852 * Remote attribute block format definition
854 * There is one of these headers per filesystem block in a remote attribute.
H A Dxfs_dir2.h187 * Directory offset/block conversion functions.
189 * DB blocks here are logical directory block numbers, not filesystem blocks.
211 * Convert byte in space to (DB) block
220 * Convert dataptr to a block number
229 * Convert byte in space to offset in a block
238 * Convert dataptr to a byte offset in a block
247 * Convert block and offset to byte in space
257 * Convert block (DB) to block (dablk)
266 * Convert byte in space to (DA) block
275 * Convert block and offset to dataptr
285 * Convert block (dablk) to block (DB)
294 * Convert block (dablk) to byte offset in space
303 * Directory tail pointer accessor functions. Based on block geometry.
H A Dxfs_alloc.h36 #define XFS_ALLOCTYPE_START_BNO 0x10 /* near this block else anywhere */
37 #define XFS_ALLOCTYPE_NEAR_BNO 0x20 /* in this a.g. and near this block */
38 #define XFS_ALLOCTYPE_THIS_BNO 0x40 /* at exactly this block */
65 * block in a certain AG is allocated but there is no additional
66 * block for the additional bmap btree block due to a split of the
104 xfs_fsblock_t fsbno; /* file system block number */
106 xfs_agblock_t agbno; /* allocation group-relative block # */
122 xfs_fsblock_t firstblock; /* io first block allocated */
146 * Get a block from the freelist.
147 * Returns with the buffer for the block gotten.
153 xfs_agblock_t *bnop, /* block address retrieved from freelist */
176 * Put the block on the freelist for the allocation group.
182 struct xfs_buf *agflbp,/* buffer for a.g. free block array */
183 xfs_agblock_t bno, /* block being freed */
210 xfs_fsblock_t bno, /* starting block number of extent */
216 xfs_agblock_t bno, /* starting block of extent */
223 xfs_agblock_t bno, /* starting block of extent */
230 xfs_agblock_t *bno, /* output: starting block of extent */
H A Dxfs_trans_resv.c72 * on-disk format. In memory, the buffer contains a normal btree block header so
123 * the free inode btree: max depth * block size
124 * the allocation btrees: 2 trees * (max depth - 1) * block size
125 * the free inode btree entry: block size
151 * These are based on the size of the file system block because that is what
172 * the inode's bmap btree: max depth * block size
174 * the superblock free block counter: sector size
175 * the allocation btrees: 2 exts * 2 trees * (2 * max depth - 1) * block size
179 * the super block free block counter: sector size
180 * the allocation btrees: 2 exts * 2 trees * (2 * max depth - 1) * block size
201 * the inode's bmap btree: (max depth + 1) * block size
205 * the super block to reflect the freed blocks: sector size
207 * 4 exts * 2 trees * (2 * max depth - 1) * block size
209 * the allocation btrees: 2 trees * (max depth - 1) * block size
232 * the two directory btrees: 2 * (max depth + v2) * dir block size
233 * the two directory bmap btrees: 2 * max depth * block size
238 * the superblock for the free block count: sector size
239 * the allocation btrees: 3 exts * 2 trees * (2 * max depth - 1) * block size
271 * the directory btree could split: (max depth + v2) * dir block size
276 * the superblock for the free block count: sector size
277 * the allocation btrees: 2 trees * (2 * max depth - 1) * block size
309 * the directory btree could join: (max depth + v2) * dir block size
314 * the superblock for the free block count: sector size
315 * the allocation btrees: 2 exts * 2 trees * (2 * max depth - 1) * block size
341 * the inode btree entry: block size
343 * the directory btree: (max depth + v2) * dir block size
344 * the directory inode's bmap btree: (max depth + v2) * block size
364 * the allocation btrees: 2 trees * (max depth - 1) * block size
392 * the allocation btrees: 2 trees * (max depth - 1) * block size
466 * the super block free inode counter: sector size
468 * the inode btree entry: block size
471 * the allocation btrees: 2 trees * (max depth - 1) * block size
528 * allocation btrees for 1 block alloc: 2 * (2 * maxdepth - 1) * blocksize
545 * one bitmap/summary block: blocksize
561 * one bitmap block: blocksize
599 * agf block and superblock (for block allocation)
600 * the new block (directory sized)
601 * bmap blocks for the new directory block
621 * the inode's bmap btree: max depth * block size
625 * the super block to reflect the freed blocks: sector size
627 * 4 exts * 2 trees * (2 * max depth - 1) * block size
663 * Setting an attribute at runtime, transaction space unit per block.
665 * the inode bmap btree could join or split: max depth * block size
668 * one block so that the caller could figure out the total space according
684 * the attribute btree could join: max depth * block size
685 * the inode bmap btree could join or split: max depth * block size
689 * the superblock for the free block count: sector size
690 * the allocation btrees: 2 exts * 2 trees * (2 * max depth - 1) * block size
732 * the unit of quota allocation: one system block size
768 * Syncing the incore super block changes to disk.
769 * the super block to reflect the changes: sector size
H A Dxfs_dir2_leaf.c48 * Check the internal consistency of a leaf1 block.
289 * Initialize a new leaf block, leaf1 or leafn magic accepted.
367 * Convert a block form directory to a leaf form directory.
372 struct xfs_buf *dbp) /* input block's buffer */ xfs_dir2_block_to_leaf()
375 xfs_dablk_t blkno; /* leaf block's bno */ xfs_dir2_block_to_leaf()
376 xfs_dir2_data_hdr_t *hdr; /* block header */ xfs_dir2_block_to_leaf()
377 xfs_dir2_leaf_entry_t *blp; /* block's leaf entries */ xfs_dir2_block_to_leaf()
378 xfs_dir2_block_tail_t *btp; /* block's tail */ xfs_dir2_block_to_leaf()
381 struct xfs_buf *lbp; /* leaf block's buffer */ xfs_dir2_block_to_leaf()
382 xfs_dir2_db_t ldb; /* leaf block's bno */ xfs_dir2_block_to_leaf()
385 int needlog; /* need to log block header */ xfs_dir2_block_to_leaf()
397 * Add the leaf block to the inode. xfs_dir2_block_to_leaf()
399 * Since that's empty now, we'll get the root (block 0 in range). xfs_dir2_block_to_leaf()
407 * Initialize the leaf block, get a buffer for it. xfs_dir2_block_to_leaf()
439 * Make the space formerly occupied by the leaf entries and block xfs_dir2_block_to_leaf()
448 * Fix up the block header, make it a data block. xfs_dir2_block_to_leaf()
607 xfs_dir2_data_hdr_t *hdr; /* data block header */ xfs_dir2_leaf_addname()
608 struct xfs_buf *dbp; /* data block buffer */ xfs_dir2_leaf_addname()
609 xfs_dir2_data_entry_t *dep; /* data block entry */ xfs_dir2_leaf_addname()
613 int grown; /* allocated new data block */ xfs_dir2_leaf_addname()
625 int needbytes; /* leaf block bytes needed */ xfs_dir2_leaf_addname()
630 xfs_dir2_db_t use_block; /* data block number */ xfs_dir2_leaf_addname()
660 * and space in their block for the new entry. xfs_dir2_leaf_addname()
662 * in a data block, improving the lookup of those entries. xfs_dir2_leaf_addname()
678 * Didn't find a block yet, linear search all the data blocks. xfs_dir2_leaf_addname()
683 * Remember a block we see that's missing. xfs_dir2_leaf_addname()
695 * How many bytes do we need in the leaf block? xfs_dir2_leaf_addname()
704 * Now kill use_block if it refers to a missing block, so we xfs_dir2_leaf_addname()
748 * a new data block. xfs_dir2_leaf_addname()
781 * If there was no data block space found, we need to allocate xfs_dir2_leaf_addname()
786 * Add the new data block. xfs_dir2_leaf_addname()
794 * Initialize the block. xfs_dir2_leaf_addname()
801 * If we're adding a new data block on the end we need to xfs_dir2_leaf_addname()
814 * If we're filling in a previously empty block just log it. xfs_dir2_leaf_addname()
824 * Already had space in some data block. xfs_dir2_leaf_addname()
839 * Point to the biggest freespace in our data block. xfs_dir2_leaf_addname()
867 * Need to log the data block's header. xfs_dir2_leaf_addname()
1049 * Log the bests entries indicated from a leaf1 block.
1075 * Log the leaf entries indicated from a leaf1 or leafn block.
1103 * Log the header of the leaf1 or leafn block.
1123 * Log the tail of the leaf1 block.
1152 struct xfs_buf *dbp; /* data block buffer */ xfs_dir2_leaf_lookup()
1153 xfs_dir2_data_entry_t *dep; /* data block entry */ xfs_dir2_leaf_lookup()
1166 * Look up name in the leaf block, returning both buffers and index. xfs_dir2_leaf_lookup()
1199 * Look up name/hash in the leaf block.
1208 int *indexp, /* out: index in leaf block */ xfs_dir2_leaf_lookup_int()
1211 xfs_dir2_db_t curdb = -1; /* current data block number */ xfs_dir2_leaf_lookup_int()
1216 int index; /* index in leaf block */ xfs_dir2_leaf_lookup_int()
1221 xfs_dir2_db_t newdb; /* new data block number */ xfs_dir2_leaf_lookup_int()
1223 xfs_dir2_db_t cidb = -1; /* case match data block no. */ xfs_dir2_leaf_lookup_int()
1259 * Get the new data block number. xfs_dir2_leaf_lookup_int()
1264 * If it's not the same as the old data block number, xfs_dir2_leaf_lookup_int()
1306 * appropriate data block if required and return it. xfs_dir2_leaf_lookup_int()
1340 __be16 *bestsp; /* leaf block best freespace */ xfs_dir2_leaf_removename()
1341 xfs_dir2_data_hdr_t *hdr; /* data block header */ xfs_dir2_leaf_removename()
1342 xfs_dir2_db_t db; /* data block number */ xfs_dir2_leaf_removename()
1343 struct xfs_buf *dbp; /* data block buffer */ xfs_dir2_leaf_removename()
1347 xfs_dir2_db_t i; /* temporary data block # */ xfs_dir2_leaf_removename()
1404 * Scan the freespace in the data block again if necessary, xfs_dir2_leaf_removename()
1405 * log the data block header if necessary. xfs_dir2_leaf_removename()
1412 * If the longest freespace in the data block has changed, xfs_dir2_leaf_removename()
1421 * If the data block is now empty then get rid of the data block. xfs_dir2_leaf_removename()
1429 * allocation of a bmap btree block to do so. xfs_dir2_leaf_removename()
1431 * empty block in place. xfs_dir2_leaf_removename()
1440 * If this is the last data block then compact the xfs_dir2_leaf_removename()
1465 * If the data block was not the first one, drop it. xfs_dir2_leaf_removename()
1472 * See if we can convert to block form. xfs_dir2_leaf_removename()
1484 struct xfs_buf *dbp; /* data block buffer */ xfs_dir2_leaf_replace()
1485 xfs_dir2_data_entry_t *dep; /* data block entry */ xfs_dir2_leaf_replace()
1530 * Return index in the leaf block (lbp) which is either the first
1585 * Trim off a trailing data block. We know it's empty since the leaf
1592 xfs_dir2_db_t db) /* data block number */ xfs_dir2_leaf_trim_data()
1595 struct xfs_buf *dbp; /* data block buffer */ xfs_dir2_leaf_trim_data()
1605 * Read the offending data block. We need its buffer. xfs_dir2_leaf_trim_data()
1629 * Get rid of the data block. xfs_dir2_leaf_trim_data()
1669 * The root of the node form dir needs to already be a LEAFN block.
1679 struct xfs_buf *fbp; /* buffer for freespace block */ xfs_dir2_node_to_leaf()
1682 struct xfs_buf *lbp; /* buffer for leaf block */ xfs_dir2_node_to_leaf()
1727 * Now find the block just before the freespace block. xfs_dir2_node_to_leaf()
1733 * If it's not the single leaf block, give up. xfs_dir2_node_to_leaf()
1745 * Read the freespace block. xfs_dir2_node_to_leaf()
1777 * Set up the leaf tail from the freespace block. xfs_dir2_node_to_leaf()
1795 * Get rid of the freespace block. xfs_dir2_node_to_leaf()
1804 * isolated block. xfs_dir2_node_to_leaf()
1812 * down to a block form directory. xfs_dir2_node_to_leaf()
/linux-4.1.27/drivers/md/persistent-data/
H A Ddm-array.c35 * block location into the header (paranoia about ssds remapping areas by
92 * Returns a pointer to a value within an array block.
94 * index - The index into _this_ specific block.
108 * in an array block.
120 * Increment every value in an array block.
131 * Decrement every value in an array block.
142 * Each array block can hold this many values.
150 * Allocate a new array block. The caller will need to unlock block.
154 struct dm_block **block, struct array_block **ab) alloc_ablock()
158 r = dm_tm_new_block(info->btree_info.tm, &array_validator, block); alloc_ablock()
162 (*ab) = dm_block_data(*block); alloc_ablock()
171 * Pad an array block out with a particular value. Every instance will
195 * Remove some entries from the back of an array block. Every value
217 * Read locks a block, and coerces it to an array block. The caller must
218 * unlock 'block' when finished.
221 struct dm_block **block, struct array_block **ab) get_ablock()
225 r = dm_tm_read_lock(info->btree_info.tm, b, &array_validator, block); get_ablock()
229 *ab = dm_block_data(*block); get_ablock()
234 * Unlocks an array block.
236 static int unlock_ablock(struct dm_array_info *info, struct dm_block *block) unlock_ablock() argument
238 return dm_tm_unlock(info->btree_info.tm, block); unlock_ablock()
248 * Looks up an array block in the btree, and then read locks it.
254 unsigned index, struct dm_block **block, lookup_ablock()
265 return get_ablock(info, le64_to_cpu(block_le), block, ab); lookup_ablock()
269 * Insert an array block into the btree. The block is _not_ unlocked.
272 struct dm_block *block, dm_block_t *root) insert_ablock()
274 __le64 block_le = cpu_to_le64(dm_block_location(block)); insert_ablock()
281 * Looks up an array block in the btree. Then shadows it, and updates the
283 * for both the current root block, and the new one.
286 unsigned index, struct dm_block **block, shadow_ablock()
306 &array_validator, block, &inc); shadow_ablock()
310 *ab = dm_block_data(*block); shadow_ablock()
320 if (dm_block_location(*block) != b) { shadow_ablock()
323 * block, but it is still referenced by the btree. We shadow_ablock()
328 r = insert_ablock(info, index, *block, root); shadow_ablock()
335 * Allocate an new array block, and fill it with some values.
343 struct dm_block *block; insert_new_ablock() local
346 r = alloc_ablock(info, size_of_block, max_entries, &block, &ab); insert_new_ablock()
351 r = insert_ablock(info, block_index, block, root); insert_new_ablock()
352 unlock_ablock(info, block); insert_new_ablock()
387 * Metadata block size. Used to calculate the nr entries in an
388 * array block.
393 * Maximum nr entries in an array block.
405 * Number of entries in the final block. 0 iff only full blocks in
418 * in block are decremented as a side effect of the btree remove.
420 * begin_index - the index of the first array block to remove.
421 * end_index - the one-past-the-end value. ie. this block is not removed.
455 struct dm_block *block; shrink() local
473 * Trim the new tail block shrink()
477 resize->new_nr_full_blocks, &block, &ab); shrink()
482 unlock_ablock(resize->info, block); shrink()
494 struct dm_block *block; grow_extend_tail_block() local
498 resize->old_nr_full_blocks, &block, &ab); grow_extend_tail_block()
503 unlock_ablock(resize->info, block); grow_extend_tail_block()
577 struct dm_block *block; block_dec() local
586 DMERR_LIMIT("couldn't get reference count for block %llu", block_dec()
596 r = get_ablock(info, b, &block, &ab); block_dec()
598 DMERR_LIMIT("couldn't get array block %llu", block_dec()
604 unlock_ablock(info, block); block_dec()
694 struct dm_block *block; dm_array_get_value() local
702 r = lookup_ablock(info, root, index / max_entries, &block, &ab); dm_array_get_value()
713 unlock_ablock(info, block); dm_array_get_value()
722 struct dm_block *block; array_set_value() local
733 r = shadow_ablock(info, &root, index / max_entries, &block, &ab); array_set_value()
755 unlock_ablock(info, block); array_set_value()
785 struct dm_block *block; walk_ablock() local
789 r = get_ablock(wi->info, le64_to_cpu(block_le), &block, &ab); walk_ablock()
803 unlock_ablock(wi->info, block); walk_ablock()
152 alloc_ablock(struct dm_array_info *info, size_t size_of_block, uint32_t max_entries, struct dm_block **block, struct array_block **ab) alloc_ablock() argument
220 get_ablock(struct dm_array_info *info, dm_block_t b, struct dm_block **block, struct array_block **ab) get_ablock() argument
253 lookup_ablock(struct dm_array_info *info, dm_block_t root, unsigned index, struct dm_block **block, struct array_block **ab) lookup_ablock() argument
271 insert_ablock(struct dm_array_info *info, uint64_t index, struct dm_block *block, dm_block_t *root) insert_ablock() argument
285 shadow_ablock(struct dm_array_info *info, dm_block_t *root, unsigned index, struct dm_block **block, struct array_block **ab) shadow_ablock() argument
H A DMakefile5 dm-block-manager.o \
H A Ddm-persistent-data-internal.h10 #include "dm-block-manager.h"
H A Ddm-transaction-manager.h10 #include "dm-block-manager.h"
21 * Clients should not fiddle with the block manager directly.
31 * Methods that return void yet may block should not be called on a clone
54 * These methods are the only way to get hold of a writeable block.
63 * Zeroes the new block and returns with write lock held.
70 * dm_tm_shadow_block() allocates a new block and copies the data from @orig
71 * to it. It then decrements the reference count on original block. Use
72 * this to update the contents of a block in a data structure, don't
73 * confuse this with a clone - you shouldn't access the orig block after
79 * adjust reference counts for children. (Data in the block may refer to
90 * Read access. You can lock any block you want. If there's a write lock
91 * on it outstanding then it'll block.
100 * Functions for altering the reference count of a block directly.
H A Ddm-space-map-disk.h10 #include "dm-block-manager.h"
H A Ddm-block-manager.h27 * @name should be a unique identifier for the block manager, no longer
64 * block lock.
68 * dm_bm_lock() locks a block and returns through @result a pointer to
69 * memory that holds a copy of that block. If you have write-locked the
70 * block then any changes you make to memory pointed to by @result will be
82 * The *_try_lock variants return -EWOULDBLOCK if the block isn't
91 * overwrite the block completely. It saves a disk read.
/linux-4.1.27/drivers/mtd/nand/
H A Dnand_bbt.c5 * Bad block table support for the NAND driver
15 * When nand_scan_bbt is called, then it tries to find the bad block table
19 * Once a new bad block is discovered then the "factory" information is updated
26 * If the tables are not versioned, then we "or" the bad block information.
29 * good / bad blocks and the bad block tables are created.
34 * The auto generated bad block table is located in the last good blocks
43 * The table uses 2 bits per block
44 * 11b: block is good
45 * 00b: block is factory marked bad
46 * 01b, 10b: block is marked bad due to wear
48 * The memory bad block table uses the following scheme:
49 * 00b: block is good
50 * 01b: block is marked bad due to wear
51 * 10b: block is reserved (to protect the bbt area)
52 * 11b: block is factory marked bad
54 * Multichip devices like DOC store the bad block info per floor.
57 * - bbts start at a page boundary, if autolocated on a block boundary
58 * - the space necessary for a bbt in FLASH does not exceed a block boundary
84 static inline uint8_t bbt_get_entry(struct nand_chip *chip, int block) bbt_get_entry() argument
86 uint8_t entry = chip->bbt[block >> BBT_ENTRY_SHIFT]; bbt_get_entry()
87 entry >>= (block & BBT_ENTRY_MASK) * 2; bbt_get_entry()
91 static inline void bbt_mark_entry(struct nand_chip *chip, int block, bbt_mark_entry() argument
94 uint8_t msk = (mark & BBT_ENTRY_MASK) << ((block & BBT_ENTRY_MASK) * 2); bbt_mark_entry()
95 chip->bbt[block >> BBT_ENTRY_SHIFT] |= msk; bbt_mark_entry()
112 * Check for a pattern at the given place. Used to search bad block tables and
113 * good / bad block identifiers.
132 * Check for a pattern at the given place. Used to search bad block tables and
133 * good / bad block identifiers. Same as check_pattern, but no optional empty
164 * read_bbt - [GENERIC] Read the bad block table starting from page
170 * @offs: block number offset in the table
172 * Read the bad block table starting from page.
225 pr_info("nand_read_bbt: reserved block at 0x%012llx\n", read_bbt()
237 pr_info("nand_read_bbt: bad block at 0x%012llx\n", read_bbt()
257 * read_abs_bbt - [GENERIC] Read the bad block table starting at a given page
260 * @td: descriptor for the bad block table
264 * Read the bad block table for all chips starting at a given page. We assume
382 * read_abs_bbts - [GENERIC] Read the bad block table(s) for all chips starting at a given page
385 * @td: descriptor for the bad block table
386 * @md: descriptor for the bad block table mirror
388 * Read the bad block table(s) for all chips starting at a given page. We
401 pr_info("Bad block table at page %d, version 0x%02X\n", read_abs_bbts()
410 pr_info("Bad block table at page %d, version 0x%02X\n", read_abs_bbts()
415 /* Scan a given block partially */ scan_block_fast()
447 * create_bbt - [GENERIC] Create a bad block table by scanning the device
450 * @bd: descriptor for the good/bad block search pattern
454 * Create a bad block table by scanning the device for the given good/bad block
513 * search_bbt - [GENERIC] scan the device for a specific bad block table
516 * @td: descriptor for the bad block table
518 * Read the bad block table by searching for a given ident pattern. Search is
520 * downwards. The search starts always at the start of a block. If the option
522 * the bad block information of this chip. This is necessary to provide support
525 * The bbt ident pattern resides in the oob area of the first page in a block.
531 int startblock, block, dir; search_bbt() local
560 for (block = 0; block < td->maxblocks; block++) { search_bbt()
562 int actblock = startblock + dir * block; search_bbt()
581 pr_warn("Bad block table not found for chip %d\n", i); search_bbt()
583 pr_info("Bad block table found at page %d, version 0x%02X\n", search_bbt()
590 * search_read_bbts - [GENERIC] scan the device for bad block table(s)
593 * @td: descriptor for the bad block table
594 * @md: descriptor for the bad block table mirror
596 * Search and read the bad block table(s).
611 * write_bbt - [GENERIC] (Re)write the bad block table
614 * @td: descriptor for the bad block table
615 * @md: descriptor for the bad block table mirror
618 * (Re)write the bad block table.
642 /* Write bad block table per chip rather than per device? */ write_bbt()
670 * Automatic placement of the bad block table. Search direction write_bbt()
682 int block = startblock + dir * i; write_bbt() local
683 /* Check, if the block is bad */ write_bbt()
684 switch (bbt_get_entry(this, block)) { write_bbt()
689 page = block << write_bbt()
691 /* Check, if the block is used by the mirror table */ write_bbt()
695 pr_err("No space left to write bad block table\n"); write_bbt()
720 /* Must we save the block contents? */ write_bbt()
722 /* Make it block aligned */ write_bbt()
728 pr_info("nand_bbt: error reading block for writing the bad block table\n"); write_bbt()
731 pr_warn("nand_bbt: ECC error while reading block for writing bad block table\n"); write_bbt()
802 pr_info("Bad block table written to 0x%012llx, version 0x%02X\n", write_bbt()
811 pr_warn("nand_bbt: error while writing bad block table %d\n", res); write_bbt()
816 * nand_memory_bbt - [GENERIC] create a memory based bad block table
818 * @bd: descriptor for the good/bad block search pattern
834 * @bd: descriptor for the good/bad block search pattern
895 /* Create the bad block table by scanning the device? */ check_create()
941 /* Write the bad block table to the device? */ check_create()
948 /* Write the mirror bad block table to the device? */ check_create()
959 * mark_bbt_regions - [GENERIC] mark the bad block table regions
961 * @td: bad block table descriptor
963 * The bad block table regions are marked as "bad" to prevent accidental
969 int i, j, chips, block, nrblocks, update; mark_bbt_region() local
986 block = td->pages[i] >> (this->bbt_erase_shift - this->page_shift); mark_bbt_region()
987 oldval = bbt_get_entry(this, block); mark_bbt_region()
988 bbt_mark_entry(this, block, BBT_BLOCK_RESERVED); mark_bbt_region()
991 nand_update_bbt(mtd, (loff_t)block << mark_bbt_region()
997 block = ((i + 1) * nrblocks) - td->maxblocks; mark_bbt_region()
999 block = i * nrblocks; mark_bbt_region()
1001 oldval = bbt_get_entry(this, block); mark_bbt_region()
1002 bbt_mark_entry(this, block, BBT_BLOCK_RESERVED); mark_bbt_region()
1005 block++; mark_bbt_region()
1013 nand_update_bbt(mtd, (loff_t)(block - 1) << mark_bbt_region()
1019 * verify_bbt_descr - verify the bad block description
1023 * This functions performs a few sanity checks on the bad block description
1067 * nand_scan_bbt - [NAND Interface] scan, find, read and maybe create bad block table(s)
1069 * @bd: descriptor for the good/bad block search pattern
1071 * The function checks, if a bad block table(s) is/are already available. If
1073 * the bad block table(s) to the selected place.
1075 * The bad block table memory is allocated here. It must be freed by calling
1088 * Allocate memory (2bit per block) and clear the memory bad block nand_scan_bbt()
1097 * memory based bad block table. nand_scan_bbt()
1124 /* Search the bad block table using a pattern in oob */ nand_scan_bbt()
1140 * nand_update_bbt - update bad block table(s)
1142 * @offs: the offset of the newly marked block
1144 * The function updates the bad block table(s).
1178 /* Write the bad block table to the device? */ nand_update_bbt()
1184 /* Write the mirror bad block table to the device? */ nand_update_bbt()
1195 * Define some generic bad / good block scan pattern which are used
1258 pr_warn("Bad block pattern already allocated; not replacing\n"); nand_create_badblock_pattern()
1274 * nand_default_bbt - [NAND Interface] Select a default bad block table for the device
1277 * This function selects the default bad block table support for the device and
1285 /* Is a flash based bad block table requested? */ nand_default_bbt()
1312 * nand_isreserved_bbt - [NAND Interface] Check if a block is reserved
1319 int block; nand_isreserved_bbt() local
1321 block = (int)(offs >> this->bbt_erase_shift); nand_isreserved_bbt()
1322 return bbt_get_entry(this, block) == BBT_BLOCK_RESERVED; nand_isreserved_bbt()
1326 * nand_isbad_bbt - [NAND Interface] Check if a block is bad
1329 * @allowbbt: allow access to bad block table region
1334 int block, res; nand_isbad_bbt() local
1336 block = (int)(offs >> this->bbt_erase_shift); nand_isbad_bbt()
1337 res = bbt_get_entry(this, block); nand_isbad_bbt()
1339 pr_debug("nand_isbad_bbt(): bbt info for offs 0x%08x: (block %d) 0x%02x\n", nand_isbad_bbt()
1340 (unsigned int)offs, block, res); nand_isbad_bbt()
1354 * nand_markbad_bbt - [NAND Interface] Mark a block bad in the BBT
1356 * @offs: offset of the bad block
1361 int block, ret = 0; nand_markbad_bbt() local
1363 block = (int)(offs >> this->bbt_erase_shift); nand_markbad_bbt()
1365 /* Mark bad block in memory */ nand_markbad_bbt()
1366 bbt_mark_entry(this, block, BBT_BLOCK_WORN); nand_markbad_bbt()
1368 /* Update flash-based bad block table */ nand_markbad_bbt()
/linux-4.1.27/fs/ext2/
H A Dballoc.c9 * Enhanced block allocation by Stephen Tweedie (sct@redhat.com), 1993
27 * blocks groups. Each group contains 1 bitmap block for blocks, 1 bitmap
28 * block for inodes, N blocks for the inode table and data blocks.
31 * super block. Each descriptor contains the number of the bitmap block and
32 * the free blocks count in the block. The descriptors are loaded in memory
85 /* check whether block bitmap block number is set */ ext2_valid_block_bitmap()
89 /* bad block bitmap */ ext2_valid_block_bitmap()
92 /* check whether the inode bitmap block number is set */ ext2_valid_block_bitmap()
96 /* bad block bitmap */ ext2_valid_block_bitmap()
99 /* check whether the inode table block number is set */ ext2_valid_block_bitmap()
111 "Invalid block bitmap - " ext2_valid_block_bitmap()
112 "block_group = %d, block = %lu", ext2_valid_block_bitmap()
119 * bits for block/inode/inode tables are set in the bitmaps
137 "Cannot read block bitmap - " read_block_bitmap()
148 "Cannot read block bitmap - " read_block_bitmap()
189 * __rsv_window_dump() -- Dump the filesystem block allocation reservation map
194 * If verbose is turned on, it will print the whole block reservation
250 * @grp_goal: given goal block relative to the allocation block group
251 * @group: the current allocation block group
252 * @sb: filesystem super block
254 * Test if the given goal block (group relative) is within the file's
255 * own block reservation window range.
258 * grp_goal (given goal block) could be -1, which means no specific
259 * goal block. In this case, always return 1.
260 * If the goal block is within the reservation window, return 1;
284 * @goal: target allocation block
323 * ext2_rsv_window_add() -- Insert a window to the block reservation rb tree.
324 * @sb: super block
361 * @sb: super block
364 * Mark the block reservation window as not allocated, and unlink it
381 * returns 1 if the end block is EXT2_RESERVE_WINDOW_NOT_ALLOCATED.
385 /* a valid reservation end block could not be 0 */ rsv_is_empty()
398 * needs a new block. So, before every ext2_new_block(s) call, for
401 * Fail to do so will result in block reservation being turned off for that
406 * is open for write (needs block allocation).
426 * block reservation is off ext2_init_block_alloc_info()
443 * Discard(free) block reservation window on last file close, or truncate
449 * ext2_truncate(): when the block indirect map is about to change.
473 * @block: start physical block to free
476 void ext2_free_blocks (struct inode * inode, unsigned long block, ext2_free_blocks() argument
491 if (block < le32_to_cpu(es->s_first_data_block) || ext2_free_blocks()
492 block + count < block || ext2_free_blocks()
493 block + count > le32_to_cpu(es->s_blocks_count)) { ext2_free_blocks()
496 "block = %lu, count = %lu", block, count); ext2_free_blocks()
500 ext2_debug ("freeing block(s) %lu-%lu\n", block, block + count - 1); ext2_free_blocks()
504 block_group = (block - le32_to_cpu(es->s_first_data_block)) / ext2_free_blocks()
506 bit = (block - le32_to_cpu(es->s_first_data_block)) % ext2_free_blocks()
525 if (in_range (le32_to_cpu(desc->bg_block_bitmap), block, count) || ext2_free_blocks()
526 in_range (le32_to_cpu(desc->bg_inode_bitmap), block, count) || ext2_free_blocks()
527 in_range (block, le32_to_cpu(desc->bg_inode_table), ext2_free_blocks()
529 in_range (block + count - 1, le32_to_cpu(desc->bg_inode_table), ext2_free_blocks()
534 block, count); ext2_free_blocks()
542 "bit already cleared for block %lu", block + i); ext2_free_blocks()
556 block += count; ext2_free_blocks()
571 * @start: the starting block (group relative) of the search
572 * @bh: bufferhead contains the block group bitmap
573 * @maxblocks: the ending block (group relative) of the reservation
592 * @start: the starting block (group relative) to find next
593 * allocatable block in bitmap.
594 * @bh: bufferhead contains the block group bitmap
595 * @maxblocks: the ending block (group relative) for the search
597 * Find an allocatable block in a bitmap. We perform the "most
598 * appropriate allocation" algorithm of looking for a free block near
611 * block within the next XX blocks. find_next_usable_block()
644 * @group: given allocation block group
645 * @bitmap_bh: bufferhead holds the block bitmap
646 * @grp_goal: given target block within the group
655 * if there is a reservation window, only try to allocate block(s)
657 * Otherwise, the allocation range starts from the give goal block,
658 * ends at the block group's last block.
660 * If we failed to allocate the desired block then we may end up crossing to a
719 * The block was allocated by another thread, or it was ext2_try_to_allocate()
759 * @group_first_block: the first block we consider to start
763 * the maximum block number that our goal reservable space
764 * could start from. This is normally the last block in this
870 * there, we check the bitmap for the first free block after
871 * it. If there is no free block until the end of group, then the
873 * block is inside the expected reservable space, if so, we
875 * If the first free block is outside the reservable space, then
876 * start from the first free block, we search for next available
880 * It contains at least one free block, and it does not overlap with other
890 * no goal(goal = -1), we start from the first block
893 * @sb: the super block
895 * @bitmap_bh: the block group block bitmap
931 * Maybe we could shift the start block of the reservation alloc_new_reservation()
932 * window to the first block of next group. alloc_new_reservation()
957 * shift the search start to the window near the goal block alloc_new_reservation()
983 * to make sure there is at least a free block inside this region. alloc_new_reservation()
985 * Search the first free bit on the block bitmap. Search starts from alloc_new_reservation()
986 * the start block of the reservable space we just found. alloc_new_reservation()
995 * no free block left on the bitmap, no point alloc_new_reservation()
1007 * check if the first free block is within the alloc_new_reservation()
1015 * start from where the free block is, alloc_new_reservation()
1026 * @sb: super block
1068 * @group: given allocation block group
1069 * @bitmap_bh: bufferhead holds the block bitmap
1070 * @grp_goal: given target block within the group
1074 * This is the main function used to allocate a new block and its reservation
1077 * Each time when a new block allocation is need, first try to allocate from
1081 * reservation window for it starting from the goal first. Then do the block
1085 * again when somebody is looking for a free block (without
1105 * or last attempt to allocate a block with reservation turned on failed ext2_try_to_allocate_with_rsv()
1112 * grp_goal is a group relative block number (if there is a goal) ext2_try_to_allocate_with_rsv()
1114 * first block is a filesystem wide block number ext2_try_to_allocate_with_rsv()
1115 * first block is the block number of the first block in this group ext2_try_to_allocate_with_rsv()
1121 * Basically we will allocate a new block from inode's reservation ext2_try_to_allocate_with_rsv()
1126 * b) last attempt to allocate a block from existing reservation ext2_try_to_allocate_with_rsv()
1177 * @sbi: in-core super block structure.
1179 * Check if filesystem has at least 1 free block available for allocation.
1197 * ext2_new_blocks() -- core block(s) allocation function
1199 * @goal: given target block(filesystem wide)
1203 * ext2_new_blocks uses a goal block to assist allocation. If the goal is
1204 * free, or there is a free block within 32 blocks of the goal, that block
1205 * is allocated. Otherwise a forward search is made for a free block; within
1206 * each block group the search first looks for an entire free byte in the block
1217 ext2_grpblk_t grp_target_blk; /* blockgroup relative goal block */ ext2_new_blocks()
1218 ext2_grpblk_t grp_alloc_blk; /* blockgroup-relative allocated block*/ ext2_new_blocks()
1219 ext2_fsblk_t ret_block; /* filesyetem-wide allocated block */ ext2_new_blocks()
1238 * Check quota for allocation of this block. ext2_new_blocks()
1250 * Allocate a block from reservation only when ext2_new_blocks()
1270 * First, test whether the goal block is free. ext2_new_blocks()
1341 * try to allocate block(s) from this group, without a goal(-1). ext2_new_blocks()
1353 * just do block allocation as without reservations. ext2_new_blocks()
1367 ext2_debug("using block group %d(%d)\n", ext2_new_blocks()
1379 "Allocating block in system zone - " ext2_new_blocks()
1394 "block("E2FSBLK") >= blocks count(%d) - " ext2_new_blocks()
1420 * Undo the block allocation ext2_new_blocks()
H A Dinode.c15 * Goal-directed block allocation by Stephen Tweedie
130 * ext2_block_to_path - parse the block number into array of offsets
132 * @i_block: block number to be parsed
134 * @boundary: set this non-zero if the referred-to block is likely to be
135 * followed (on disk) by an indirect block.
139 * This function translates the block number into path in that tree -
141 * pointer to (n+1)th node in the nth one. If @block is out of range
151 * indirect block) is spelled differently, because otherwise on an
172 "warning: %s: block < 0", __func__); ext2_block_to_path()
193 "warning: %s: block is too big", __func__); ext2_block_to_path()
212 * the number of (i+1)-th block in the chain (as it is stored in memory,
216 * block for i>0 and NULL for i==0. In other words, it holds the block
221 * Function stops when it stumbles upon zero pointer (absent block)
223 * or when it gets an IO error reading an indirect block
273 * @ind: descriptor of indirect block.
275 * This function returns the preferred place for block allocation.
278 * + if there is a block to the left of our position - allocate near it.
279 * + if pointer will live in indirect block - allocate near that block.
282 * In the latter case we colour the starting block by the callers PID to
284 * in the same block group. The PID is used here so that functionally related
298 /* Try to find previous block */ ext2_find_near()
303 /* No such thing, so let's try location of indirect block */ ext2_find_near()
320 * @block: block we want
323 * Returns preferred place for a block (the goal).
326 static inline ext2_fsblk_t ext2_find_goal(struct inode *inode, long block, ext2_find_goal() argument
337 if (block_i && (block == block_i->last_alloc_logical_block + 1) ext2_find_goal()
346 * ext2_blks_to_allocate: Look up the block map and count the number
352 * @blocks_to_boundary: the offset in the indirect block
364 * Simple case, [t,d]Indirect block(s) has not allocated yet ext2_blks_to_allocate()
389 * @new_blocks: on return it will store the new block numbers for
390 * the indirect blocks(if needed) and the first direct block,
409 * the first direct block of this branch. That's the ext2_alloc_blocks()
432 /* save the new block number for the first direct block */ ext2_alloc_blocks()
495 * Get buffer_head for parent block, zero it out ext2_alloc_branch()
545 * @block: (logical) number of block we are adding
552 * chain to new block and return 0.
555 long block, Indirect *where, int num, int blks) ext2_splice_branch()
579 * update the most recently allocated logical & physical block ext2_splice_branch()
580 * in i_block_alloc_info, to assist find the proper goal block for next ext2_splice_branch()
584 block_i->last_alloc_logical_block = block + blks - 1; ext2_splice_branch()
591 /* had we spliced it onto indirect block? */ ext2_splice_branch()
606 * write on the parent block.
642 /* Simplest case - block found, no allocation needed */ ext2_get_blocks()
653 * Indirect block might be removed by ext2_get_blocks()
672 /* Next simple case - plain lookup or failed read of indirect block */ ext2_get_blocks()
678 * If the indirect block is missing while we are reading ext2_get_blocks()
683 * the request block has been allocated or not. ext2_get_blocks()
685 * Since we already block the truncate/other get_block ext2_get_blocks()
706 * Okay, we need to do block allocation. Lazily initialize the block ext2_get_blocks()
735 * block must be initialised before we put it in the tree ext2_get_blocks()
848 static sector_t ext2_bmap(struct address_space *mapping, sector_t block) ext2_bmap() argument
850 return generic_block_bmap(mapping,block,ext2_get_block); ext2_bmap()
932 * it is on the path to the first completely truncated data block, indeed).
939 * We atomically detach the top of branch from the tree, store the block
980 * OK, we've found the last block that must survive. The rest of our ext2_find_shared()
1005 * @p: array of block numbers
1044 * @p: array of block numbers
1071 "Read failure, inode=%ld, block=%ld", ext2_free_branches()
1107 * From here we block out all ext2_get_block() callers who want to __ext2_truncate_blocks()
1108 * modify the block allocation tree. __ext2_truncate_blocks()
1234 unsigned long block; ext2_get_inode() local
1248 * Figure out the offset within the block group inode table ext2_get_inode()
1251 block = le32_to_cpu(gdp->bg_inode_table) + ext2_get_inode()
1253 if (!(bh = sb_bread(sb, block))) ext2_get_inode()
1266 "unable to read inode block - inode=%lu, block=%lu", ext2_get_inode()
1267 (unsigned long) ino, block); ext2_get_inode()
1383 * even on big-endian machines: we do NOT byteswap the block numbers! ext2_iget()
554 ext2_splice_branch(struct inode *inode, long block, Indirect *where, int num, int blks) ext2_splice_branch() argument
/linux-4.1.27/fs/udf/
H A Dpartition.c29 uint32_t udf_get_pblock(struct super_block *sb, uint32_t block, udf_get_pblock() argument
35 udf_debug("block=%d, partition=%d, offset=%d: invalid partition\n", udf_get_pblock()
36 block, partition, offset); udf_get_pblock()
41 return map->s_partition_func(sb, block, partition, offset); udf_get_pblock()
43 return map->s_partition_root + block + offset; udf_get_pblock()
46 uint32_t udf_get_pblock_virt15(struct super_block *sb, uint32_t block, udf_get_pblock_virt15() argument
61 if (block > vdata->s_num_entries) { udf_get_pblock_virt15()
62 udf_debug("Trying to access block beyond end of VAT (%d max %d)\n", udf_get_pblock_virt15()
63 block, vdata->s_num_entries); udf_get_pblock_virt15()
69 vdata->s_start_offset))[block]); udf_get_pblock_virt15()
73 if (block >= index) { udf_get_pblock_virt15()
74 block -= index; udf_get_pblock_virt15()
75 newblock = 1 + (block / (sb->s_blocksize / sizeof(uint32_t))); udf_get_pblock_virt15()
76 index = block % (sb->s_blocksize / sizeof(uint32_t)); udf_get_pblock_virt15()
79 index = vdata->s_start_offset / sizeof(uint32_t) + block; udf_get_pblock_virt15()
87 sb, block, partition, loc, index); udf_get_pblock_virt15()
106 inline uint32_t udf_get_pblock_virt20(struct super_block *sb, uint32_t block, udf_get_pblock_virt20() argument
109 return udf_get_pblock_virt15(sb, block, partition, offset); udf_get_pblock_virt20()
112 uint32_t udf_get_pblock_spar15(struct super_block *sb, uint32_t block, udf_get_pblock_spar15() argument
124 packet = (block + offset) & ~(sdata->s_packet_len - 1); udf_get_pblock_spar15()
142 ((block + offset) & udf_get_pblock_spar15()
149 return map->s_partition_root + block + offset; udf_get_pblock_spar15()
280 static uint32_t udf_try_read_meta(struct inode *inode, uint32_t block, udf_try_read_meta() argument
291 if (inode_bmap(inode, block, &epos, &eloc, &elen, &ext_offset) != udf_try_read_meta()
305 uint32_t udf_get_pblock_meta25(struct super_block *sb, uint32_t block, udf_get_pblock_meta25() argument
322 retblk = udf_try_read_meta(inode, block, partition, offset); udf_get_pblock_meta25()
334 retblk = udf_try_read_meta(inode, block, partition, offset); udf_get_pblock_meta25()
H A Dmisc.c31 struct buffer_head *udf_tgetblk(struct super_block *sb, int block) udf_tgetblk() argument
34 return sb_getblk(sb, udf_fixed_to_variable(block)); udf_tgetblk()
36 return sb_getblk(sb, block); udf_tgetblk()
39 struct buffer_head *udf_tread(struct super_block *sb, int block) udf_tread() argument
42 return sb_bread(sb, udf_fixed_to_variable(block)); udf_tread()
44 return sb_bread(sb, block); udf_tread()
195 * Read the first block of a tagged descriptor.
201 struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block, udf_read_tagged() argument
208 /* Read the block */ udf_read_tagged()
209 if (block == 0xFFFFFFFF) udf_read_tagged()
212 bh = udf_tread(sb, block); udf_read_tagged()
214 udf_err(sb, "read failed, block=%u, location=%d\n", udf_read_tagged()
215 block, location); udf_read_tagged()
224 udf_debug("location mismatch block %u, tag %u != %u\n", udf_read_tagged()
225 block, le32_to_cpu(tag_p->tagLocation), location); udf_read_tagged()
232 udf_err(sb, "tag checksum failed, block %u: 0x%02x != 0x%02x\n", udf_read_tagged()
233 block, checksum, tag_p->tagChecksum); udf_read_tagged()
240 udf_err(sb, "tag version 0x%04x != 0x0002 || 0x0003, block %u\n", udf_read_tagged()
241 le16_to_cpu(tag_p->descVersion), block); udf_read_tagged()
252 udf_debug("Crc failure block %d: crc = %d, crclen = %d\n", block, udf_read_tagged()
H A Dballoc.c35 struct udf_bitmap *bitmap, unsigned int block, read_block_bitmap()
45 bh = udf_tread(sb, udf_get_lb_pblock(sb, &loc, block)); read_block_bitmap()
114 unsigned long block; udf_bitmap_free_blocks() local
132 block = bloc->logicalBlockNum + offset + udf_bitmap_free_blocks()
137 block_group = block >> (sb->s_blocksize_bits + 3); udf_bitmap_free_blocks()
138 bit = block % (sb->s_blocksize << 3); udf_bitmap_free_blocks()
162 block += count; udf_bitmap_free_blocks()
178 int bit, block, block_group, group_start; udf_bitmap_prealloc_blocks() local
193 block = first_block + (sizeof(struct spaceBitmapDesc) << 3); udf_bitmap_prealloc_blocks()
194 block_group = block >> (sb->s_blocksize_bits + 3); udf_bitmap_prealloc_blocks()
202 bit = block % (sb->s_blocksize << 3); udf_bitmap_prealloc_blocks()
210 block++; udf_bitmap_prealloc_blocks()
226 int newbit, bit = 0, block, block_group, group_start; udf_bitmap_new_block() local
240 block = goal + (sizeof(struct spaceBitmapDesc) << 3); udf_bitmap_new_block()
241 block_group = block >> (sb->s_blocksize_bits + 3); udf_bitmap_new_block()
252 bit = block % (sb->s_blocksize << 3); udf_bitmap_new_block()
329 udf_debug("bit already cleared for block %d\n", bit); udf_bitmap_new_block()
380 epos.block = oepos.block = iinfo->i_location; udf_table_free_blocks()
425 oepos.block = epos.block; udf_table_free_blocks()
438 * allocate a new block, and since we hold the super block udf_table_free_blocks()
442 * trying to allocate a new block close to the existing one, udf_table_free_blocks()
443 * we just steal a block from the extent we are trying to add. udf_table_free_blocks()
475 /* Steal a block from the extent being free'd */ udf_table_free_blocks()
476 epos.block.logicalBlockNum = eloc.logicalBlockNum; udf_table_free_blocks()
481 udf_get_lb_pblock(sb, &epos.block, 0)); udf_table_free_blocks()
488 cpu_to_le32(oepos.block.logicalBlockNum); udf_table_free_blocks()
518 3, 1, epos.block.logicalBlockNum, udf_table_free_blocks()
522 2, 1, epos.block.logicalBlockNum, udf_table_free_blocks()
532 cpu_to_le32(epos.block.logicalBlockNum); udf_table_free_blocks()
540 cpu_to_lelb(epos.block); udf_table_free_blocks()
551 /* It's possible that stealing the block emptied the extent */ udf_table_free_blocks()
600 epos.block = iinfo->i_location; udf_table_prealloc_blocks()
662 /* We search for the closest matching block to goal. If we find udf_table_new_block()
668 epos.block = iinfo->i_location; udf_table_new_block()
691 goal_epos.block = epos.block; udf_table_new_block()
796 int block; udf_new_block() local
799 block = udf_bitmap_new_block(sb, udf_new_block()
803 block = udf_table_new_block(sb, udf_new_block()
807 block = udf_bitmap_new_block(sb, udf_new_block()
811 block = udf_table_new_block(sb, udf_new_block()
818 if (inode && block) udf_new_block()
820 return block; udf_new_block()
34 read_block_bitmap(struct super_block *sb, struct udf_bitmap *bitmap, unsigned int block, unsigned long bitmap_nr) read_block_bitmap() argument
/linux-4.1.27/sound/soc/intel/atom/sst/
H A Dsst_pvt.c85 * @block: Driver block to wait on
88 * given block event
91 struct sst_block *block) sst_wait_interruptible()
96 block->condition)) { sst_wait_interruptible()
98 if (block->ret_code < 0) { sst_wait_interruptible()
100 "stream failed %d\n", block->ret_code); sst_wait_interruptible()
118 * @block: Driver block to wait on
121 * given block event
123 int sst_wait_timeout(struct intel_sst_drv *sst_drv_ctx, struct sst_block *block) sst_wait_timeout() argument
134 block->condition, block->msg_id, block->drv_id); sst_wait_timeout()
136 block->condition, sst_wait_timeout()
140 block->condition); sst_wait_timeout()
142 block->ret_code); sst_wait_timeout()
143 retval = -block->ret_code; sst_wait_timeout()
145 block->on = false; sst_wait_timeout()
148 block->condition, block->msg_id, sst_drv_ctx->sst_state); sst_wait_timeout()
187 * sst_create_block_and_ipc_msg - Creates IPC message and sst block
191 * @block: return block allocated
196 struct intel_sst_drv *sst_drv_ctx, struct sst_block **block, sst_create_block_and_ipc_msg()
204 *block = sst_create_block(sst_drv_ctx, msg_id, drv_id); sst_create_block_and_ipc_msg()
205 if (*block == NULL) { sst_create_block_and_ipc_msg()
236 struct sst_block *block; sst_prepare_and_post_msg() local
245 &msg, large, sst, &block, ipc_msg, pvt_id); sst_prepare_and_post_msg()
281 ret = sst_wait_timeout(sst, block); sst_prepare_and_post_msg()
284 } else if(block->data) { sst_prepare_and_post_msg()
287 *data = kzalloc(block->size, GFP_KERNEL); sst_prepare_and_post_msg()
292 memcpy(data, (void *) block->data, block->size); sst_prepare_and_post_msg()
297 sst_free_block(sst, block); sst_prepare_and_post_msg()
90 sst_wait_interruptible(struct intel_sst_drv *sst_drv_ctx, struct sst_block *block) sst_wait_interruptible() argument
195 sst_create_block_and_ipc_msg(struct ipc_post **arg, bool large, struct intel_sst_drv *sst_drv_ctx, struct sst_block **block, u32 msg_id, u32 drv_id) sst_create_block_and_ipc_msg() argument
H A Dsst_ipc.c62 * passed and search that for block threads.
63 * We will not find block in two cases
64 * a) when its small message and block in not there, so silently ignore
66 * b) when we are actually not able to find the block (bug perhaps)
75 struct sst_block *block = NULL; sst_wake_up_block() local
80 list_for_each_entry(block, &ctx->block_list, node) { sst_wake_up_block()
81 dev_dbg(ctx->dev, "Block ipc %d, drv_id %d\n", block->msg_id, sst_wake_up_block()
82 block->drv_id); sst_wake_up_block()
83 if (block->msg_id == ipc && block->drv_id == drv_id) { sst_wake_up_block()
84 dev_dbg(ctx->dev, "free up the block\n"); sst_wake_up_block()
85 block->ret_code = result; sst_wake_up_block()
86 block->data = data; sst_wake_up_block()
87 block->size = size; sst_wake_up_block()
88 block->condition = true; sst_wake_up_block()
103 struct sst_block *block = NULL, *__block; sst_free_block() local
107 list_for_each_entry_safe(block, __block, &ctx->block_list, node) { sst_free_block()
108 if (block == freed) { sst_free_block()
120 dev_err(ctx->dev, "block is already freed!!!\n"); sst_free_block()
H A Dsst_loader.c177 * Create the memcpy list as the number of block to be copied
183 struct fw_block_info *block; sst_parse_module_memcpy() local
193 block = (void *)module + sizeof(*module); sst_parse_module_memcpy()
196 if (block->size <= 0) { sst_parse_module_memcpy()
197 dev_err(sst_drv_ctx->dev, "block size invalid\n"); sst_parse_module_memcpy()
200 switch (block->type) { sst_parse_module_memcpy()
211 block = (void *)block + sizeof(*block) + block->size; sst_parse_module_memcpy()
215 block->type, count); sst_parse_module_memcpy()
220 ram_iomem + block->ram_offset, sst_parse_module_memcpy()
221 (void *)block + sizeof(*block), block->size, 1); sst_parse_module_memcpy()
225 block = (void *)block + sizeof(*block) + block->size; sst_parse_module_memcpy()
403 struct sst_block *block; sst_load_fw() local
419 block = sst_create_block(sst_drv_ctx, 0, FW_DWNL_ID); sst_load_fw()
420 if (block == NULL) sst_load_fw()
443 ret_val = sst_wait_timeout(sst_drv_ctx, block); sst_load_fw()
455 sst_free_block(sst_drv_ctx, block); sst_load_fw()
/linux-4.1.27/drivers/acpi/acpica/
H A Devgpeblk.c3 * Module Name: evgpeblk - GPE block creation and initialization.
64 * PARAMETERS: gpe_block - New GPE block
66 * GPE block
70 * DESCRIPTION: Install new GPE block with mutex support
96 /* Install the new block at the end of the list with lock */ acpi_ev_install_gpe_block()
123 * PARAMETERS: gpe_block - Existing GPE block
127 * DESCRIPTION: Remove a GPE block
143 /* Disable all GPEs in this block */ acpi_ev_delete_gpe_block()
157 /* Remove the block on this interrupt with lock */ acpi_ev_delete_gpe_block()
190 * PARAMETERS: gpe_block - New GPE block
194 * DESCRIPTION: Create the register_info and event_info blocks for this GPE block
211 /* Allocate the GPE register information block */ acpi_ev_create_gpe_info_blocks()
224 * Allocate the GPE event_info block. There are eight distinct GPEs acpi_ev_create_gpe_info_blocks()
237 /* Save the new Info arrays in the GPE block */ acpi_ev_create_gpe_info_blocks()
245 * sets in a given GPE hardware block, the status registers occupy the acpi_ev_create_gpe_info_blocks()
316 * PARAMETERS: gpe_device - Handle to the parent GPE block
318 * register_count - Number of GPE register pairs in the block
319 * gpe_block_base_number - Starting GPE number for the block
320 * interrupt_number - H/W interrupt for the block
321 * return_gpe_block - Where the new block descriptor is returned
325 * DESCRIPTION: Create and Install a block of GPE registers. All GPEs within
326 * the block are disabled at exit.
350 /* Allocate a new GPE block */ acpi_ev_create_gpe_block()
357 /* Initialize the new GPE block */ acpi_ev_create_gpe_block()
369 * Note: disables and clears all GPEs in the block acpi_ev_create_gpe_block()
377 /* Install the new block in the global lists */ acpi_ev_create_gpe_block()
389 /* Find all GPE methods (_Lxx or_Exx) for this block */ acpi_ev_create_gpe_block()
400 /* Return the new block */ acpi_ev_create_gpe_block()
430 * DESCRIPTION: Initialize and enable a GPE block. Enable GPEs that have
451 * Ignore a null GPE block (e.g., if no GPE block 1 exists), and acpi_ev_initialize_gpe_block()
460 * ACPI_GPE_CAN_WAKE flag unset. Any other GPEs within this block acpi_ev_initialize_gpe_block()
468 /* Get the info block for this particular GPE */ acpi_ev_initialize_gpe_block()
502 "Enabled %u GPEs in block %02X to %02X", acpi_ev_initialize_gpe_block()
H A Devgpeutil.c56 * PARAMETERS: gpe_walk_callback - Routine called for each GPE block
86 /* One callback per GPE block */ acpi_ev_walk_gpe_list()
118 * block device. NULL if the GPE is one of the FADT-defined GPEs.
128 /* Increment Index by the number of GPEs in this block */ acpi_ev_get_gpe_device()
134 * The GPE index is within this block, get the node. Leave the node acpi_ev_get_gpe_device()
152 * PARAMETERS: interrupt_number - Interrupt for a GPE block
153 * gpe_xrupt_block - Where the block is returned
157 * DESCRIPTION: Get or Create a GPE interrupt block. There is one interrupt
158 * block per unique interrupt level used for GPEs. Should be
235 * PARAMETERS: gpe_xrupt - A GPE interrupt info block
239 * DESCRIPTION: Remove and free a gpe_xrupt block. Remove an associated
267 /* Unlink the interrupt block with lock */ acpi_ev_delete_gpe_xrupt()
283 /* Free the block */ acpi_ev_delete_gpe_xrupt()
316 /* Examine each GPE Register within the block */ acpi_ev_delete_gpe_handlers()
332 /* Delete an installed handler block */ acpi_ev_delete_gpe_handlers()
/linux-4.1.27/fs/affs/
H A Daffs.h36 u32 ext; /* idx of the extended block */
37 u32 key; /* block number */
48 u32 i_blkcnt; /* block count */
49 u32 i_extcnt; /* extended block count */
55 u32 i_ext_last; /* last accessed extended block */
56 struct buffer_head *i_ext_bh; /* bh of last extended block */
59 u32 i_lastalloc; /* last allocated block */
71 * super-block data in memory
78 u32 bm_key; /* Disk block number */
86 u32 s_data_blksize; /* size of the data block w/o header */
87 u32 s_root_block; /* FFS root block number. */
93 struct buffer_head *s_root_bh; /* Cached root block. */
158 extern void affs_free_block(struct super_block *sb, u32 block);
221 affs_bread(struct super_block *sb, int block) affs_bread() argument
223 pr_debug("%s: %d\n", __func__, block); affs_bread()
224 if (block >= AFFS_SB(sb)->s_reserved && block < AFFS_SB(sb)->s_partition_size) affs_bread()
225 return sb_bread(sb, block); affs_bread()
229 affs_getblk(struct super_block *sb, int block) affs_getblk() argument
231 pr_debug("%s: %d\n", __func__, block); affs_getblk()
232 if (block >= AFFS_SB(sb)->s_reserved && block < AFFS_SB(sb)->s_partition_size) affs_getblk()
233 return sb_getblk(sb, block); affs_getblk()
237 affs_getzeroblk(struct super_block *sb, int block) affs_getzeroblk() argument
240 pr_debug("%s: %d\n", __func__, block); affs_getzeroblk()
241 if (block >= AFFS_SB(sb)->s_reserved && block < AFFS_SB(sb)->s_partition_size) { affs_getzeroblk()
242 bh = sb_getblk(sb, block); affs_getzeroblk()
252 affs_getemptyblk(struct super_block *sb, int block) affs_getemptyblk() argument
255 pr_debug("%s: %d\n", __func__, block); affs_getemptyblk()
256 if (block >= AFFS_SB(sb)->s_reserved && block < AFFS_SB(sb)->s_partition_size) { affs_getemptyblk()
257 bh = sb_getblk(sb, block); affs_getemptyblk()
H A Dbitmap.c7 * block allocation, deallocation, calculation of free space.
38 affs_free_block(struct super_block *sb, u32 block) affs_free_block() argument
46 pr_debug("%s(%u)\n", __func__, block); affs_free_block()
48 if (block > sbi->s_partition_size) affs_free_block()
51 blk = block - sbi->s_reserved; affs_free_block()
71 /* mark block free */ affs_free_block()
89 affs_warning(sb,"affs_free_block","Trying to free block %u which is already free", block); affs_free_block()
94 affs_error(sb,"affs_free_block","Cannot read bitmap block %u", bm->bm_key); affs_free_block()
101 affs_error(sb, "affs_free_block","Block %u outside partition", block); affs_free_block()
105 * Allocate a block in the given allocation zone.
139 // affs_warning(sb, "affs_balloc", "no last alloc block"); affs_alloc_block()
180 /* find an unused block in this bitmap block */ affs_alloc_block()
234 affs_error(sb,"affs_read_block","Cannot read bitmap block %u", bm->bm_key); affs_alloc_block()
293 pr_debug("read bitmap block %d: %d\n", blk, bm->bm_key); affs_init_bitmap()
296 /* Don't try read the extension if this is the last block, affs_init_bitmap()
342 /* recalculate bitmap count for last block */ affs_init_bitmap()
H A Dinode.c22 u32 block; affs_iget() local
35 block = inode->i_ino; affs_iget()
36 bh = affs_bread(sb, block); affs_iget()
38 affs_warning(sb, "read_inode", "Cannot read block %d", block); affs_iget()
44 AFFS_HEAD(bh)->ptype, block); affs_iget()
177 // possibly free block affs_write_inode()
181 affs_error(sb,"write_inode","Cannot read block %lu",inode->i_ino); affs_write_inode()
292 u32 block; affs_new_inode() local
298 if (!(block = affs_alloc_block(dir, dir->i_ino))) affs_new_inode()
301 bh = affs_getzeroblk(sb, block); affs_new_inode()
309 inode->i_ino = block; affs_new_inode()
332 affs_free_block(sb, block); affs_new_inode()
340 * Add an entry to a directory. Create the header block
350 u32 block = 0; affs_add_entry() local
366 block = affs_alloc_block(dir, dir->i_ino); affs_add_entry()
367 if (!block) affs_add_entry()
371 bh = affs_getzeroblk(sb, block); affs_add_entry()
390 AFFS_TAIL(sb, inode_bh)->link_chain = cpu_to_be32(block); affs_add_entry()
391 affs_adjust_checksum(inode_bh, block - be32_to_cpu(chain)); affs_add_entry()
412 if (block) affs_add_entry()
413 affs_free_block(sb, block); affs_add_entry()
/linux-4.1.27/drivers/misc/
H A Dsram.c64 struct sram_reserve *rblocks, *block; sram_probe() local
104 * We need an additional block to mark the end of the memory region sram_probe()
114 block = &rblocks[0]; for_each_available_child_of_node()
128 "reserved block %s outside the sram area\n", for_each_available_child_of_node()
134 block->start = child_res.start - res->start; for_each_available_child_of_node()
135 block->size = resource_size(&child_res); for_each_available_child_of_node()
136 list_add_tail(&block->list, &reserve_list); for_each_available_child_of_node()
138 dev_dbg(&pdev->dev, "found reserved block 0x%x-0x%x\n", for_each_available_child_of_node()
139 block->start, for_each_available_child_of_node()
140 block->start + block->size); for_each_available_child_of_node()
142 block++; for_each_available_child_of_node()
154 list_for_each_entry(block, &reserve_list, list) {
156 if (block->start < cur_start) {
158 "block at 0x%x starts after current offset 0x%lx\n",
159 block->start, cur_start);
164 /* current start is in a reserved block, so continue after it */
165 if (block->start == cur_start) {
166 cur_start = block->start + block->size;
172 * address and the following reserved block, or the
175 cur_size = block->start - cur_start;
185 /* next allocation after this reserved block */
186 cur_start = block->start + block->size;
H A Datmel_tclib.c36 * atmel_tc_alloc - allocate a specified TC block
37 * @block: which block to allocate
39 * Caller allocates a block. If it is available, a pointer to a
43 struct atmel_tc *atmel_tc_alloc(unsigned block) atmel_tc_alloc() argument
53 if ((tc->pdev->dev.of_node && tc->id == block) || atmel_tc_alloc()
54 (tc->pdev->id == block)) { atmel_tc_alloc()
67 * atmel_tc_free - release a specified TC block
68 * @tc: Timer/counter block that was returned by atmel_tc_alloc()
/linux-4.1.27/block/partitions/
H A Dmac.h14 __be32 start_block; /* absolute starting block # of partition */
18 __be32 data_start; /* rel block # of first data block */
36 /* Driver descriptor structure, in block 0 */
H A Dcmdline.c5 * Read block device partition table from the command line.
6 * Typically used for fixed block (eMMC) embedded devices.
8 * by absolute address of data on the block device.
13 * For further information, see "Documentation/block/cmdline-partition.txt"
H A Dsysv68.c20 * config block: second 256-bytes sector on disk
25 __be32 ios_slcblk; /* Slice table block number */
31 * combined volumeid and dkconfig block
45 __be32 blkoff; /* block offset of slice */
H A Damiga.c4 * Code extracted from drivers/block/genhd.c
35 int blksize = 1; /* Multiplier for disk block size */ amiga_partition()
45 pr_err("Dev %s: unable to read RDB block %d\n", amiga_partition()
62 pr_err("Trashed word at 0xd0 in block %d ignored in checksum calculation\n", amiga_partition()
67 pr_err("Dev %s: RDB in block %d has bad checksum\n", amiga_partition()
71 /* blksize is blocks per 512 byte standard block */ amiga_partition()
88 pr_err("Dev %s: unable to read partition block %d\n", amiga_partition()
H A Dultrix.c4 * Code extracted from drivers/block/genhd.c
22 u32 pi_blkoff; /* block offset for start */ ultrix_partition()
/linux-4.1.27/include/linux/mtd/
H A Dnand_ecc.h21 * Calculate 3 byte ECC code for eccsize byte block
27 * Calculate 3 byte ECC code for 256/512 byte block
32 * Detect and correct a 1 bit error for eccsize byte block
38 * Detect and correct a 1 bit error for 256/512 byte block
H A Dbbm.h35 * struct nand_bbt_descr - bad block table descriptor
48 * bad) block in the stored bbt
49 * @pattern: pattern to identify bad block table or factory marked good /
52 * Descriptor for the bad block table marker and the descriptor for the
55 * of the first block.
69 /* Options for the bad block table descriptors */
71 /* The number of bits used per block in the bbt on the device */
77 /* The bad block table is in the last good block of the device */
96 /* Read and write back block contents when writing bbt */
103 * Use a flash based bad block table. By default, OOB identifier is saved in
104 * OOB area. This option is passed to the default bad block table function.
108 * Do not store flash based bad block table marker in the OOB area; store it
113 * Do not write new bad block markers to OOB; useful, e.g., when ECC covers
136 * Bad block scanning errors
145 * @badblockpos: [INTERN] position of the bad block marker in the oob area
147 * @bbt: [INTERN] bad block table pointer
148 * @isbad_bbt: function to determine if a block is bad
149 * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for
150 * initial bad block scan
H A Dnftl.h29 #define BLOCK_NIL 0xffff /* last block of a chain */
30 #define BLOCK_FREE 0xfffe /* free block */
31 #define BLOCK_NOTEXPLORED 0xfffd /* non explored block, only used during mounting */
32 #define BLOCK_RESERVED 0xfffc /* bios block or bad block */
57 int NFTL_formatblock(struct NFTLrecord *s, int block);
/linux-4.1.27/net/mac80211/
H A Dmichael.c60 size_t block, blocks, left; michael_mic() local
69 for (block = 0; block < blocks; block++) michael_mic()
70 michael_block(&mctx, get_unaligned_le32(&data[block * 4])); michael_mic()
72 /* Partial block of 0..3 bytes and padding: 0x5a + 4..7 zeros to make michael_mic()
/linux-4.1.27/drivers/platform/x86/
H A Dwmi.c74 * If the GUID data block is marked as expensive, we must enable and
146 * @src: Memory block holding binary GUID (16 bytes)
147 * @dest: Memory block to hold byte swapped binary GUID (16 bytes)
170 * @dest: Memory block to hold binary GUID (16 bytes)
229 struct guid_block *block; find_guid() local
237 block = &wblock->gblock; find_guid()
239 if (memcmp(block->guid, guid_input, 16) == 0) { find_guid()
250 struct guid_block *block = NULL; wmi_method_enable() local
255 block = &wblock->gblock; wmi_method_enable()
258 snprintf(method, 5, "WE%02X", block->notify_id); wmi_method_enable()
283 struct guid_block *block = NULL; wmi_evaluate_method() local
294 block = &wblock->gblock; wmi_evaluate_method()
297 if (!(block->flags & ACPI_WMI_METHOD)) wmi_evaluate_method()
300 if (block->instance_count < instance) wmi_evaluate_method()
313 if (block->flags & ACPI_WMI_STRING) { wmi_evaluate_method()
322 strncat(method, block->object_id, 2); wmi_evaluate_method()
331 * wmi_query_block - Return contents of a WMI block
334 * &out: Empty buffer to return the contents of the data block to
336 * Return the contents of an ACPI-WMI data block to a buffer
341 struct guid_block *block = NULL; wmi_query_block() local
356 block = &wblock->gblock; wmi_query_block()
359 if (block->instance_count < instance) wmi_query_block()
362 /* Check GUID is a data block */ wmi_query_block()
363 if (block->flags & (ACPI_WMI_EVENT | ACPI_WMI_METHOD)) wmi_query_block()
375 if (block->flags & ACPI_WMI_EXPENSIVE) { wmi_query_block()
376 strncat(wc_method, block->object_id, 2); wmi_query_block()
389 strncat(method, block->object_id, 2); wmi_query_block()
397 if ((block->flags & ACPI_WMI_EXPENSIVE) && ACPI_SUCCESS(wc_status)) { wmi_query_block()
406 * wmi_set_block - Write to a WMI block
409 * &in: Buffer containing new values for the data block
411 * Write the contents of the input buffer to an ACPI-WMI data block
416 struct guid_block *block = NULL; wmi_set_block() local
429 block = &wblock->gblock; wmi_set_block()
432 if (block->instance_count < instance) wmi_set_block()
435 /* Check GUID is a data block */ wmi_set_block()
436 if (block->flags & (ACPI_WMI_EVENT | ACPI_WMI_METHOD)) wmi_set_block()
444 if (block->flags & ACPI_WMI_STRING) { wmi_set_block()
452 strncat(method, block->object_id, 2); wmi_set_block()
531 struct wmi_block *block; wmi_install_notify_handler() local
544 block = list_entry(p, struct wmi_block, list); wmi_install_notify_handler()
546 if (memcmp(block->gblock.guid, guid_input, 16) == 0) { wmi_install_notify_handler()
547 if (block->handler && wmi_install_notify_handler()
548 block->handler != wmi_notify_debug) wmi_install_notify_handler()
551 block->handler = handler; wmi_install_notify_handler()
552 block->handler_data = data; wmi_install_notify_handler()
554 wmi_status = wmi_method_enable(block, 1); wmi_install_notify_handler()
572 struct wmi_block *block; wmi_remove_notify_handler() local
585 block = list_entry(p, struct wmi_block, list); wmi_remove_notify_handler()
587 if (memcmp(block->gblock.guid, guid_input, 16) == 0) { wmi_remove_notify_handler()
588 if (!block->handler || wmi_remove_notify_handler()
589 block->handler == wmi_notify_debug) wmi_remove_notify_handler()
593 block->handler = wmi_notify_debug; wmi_remove_notify_handler()
596 wmi_status = wmi_method_enable(block, 0); wmi_remove_notify_handler()
597 block->handler = NULL; wmi_remove_notify_handler()
598 block->handler_data = NULL; wmi_remove_notify_handler()
877 struct guid_block *block; acpi_wmi_notify() local
884 block = &wblock->gblock; acpi_wmi_notify()
886 if ((block->flags & ACPI_WMI_EVENT) && acpi_wmi_notify()
887 (block->notify_id == event)) { acpi_wmi_notify()
/linux-4.1.27/drivers/net/wan/
H A Dhd64570.h107 #define BARL 0x00 /* Buffer Address L (chained block) */
108 #define BARH 0x01 /* Buffer Address H (chained block) */
109 #define BARB 0x02 /* Buffer Address B (chained block) */
111 #define DARL 0x00 /* RX Destination Addr L (single block) */
112 #define DARH 0x01 /* RX Destination Addr H (single block) */
113 #define DARB 0x02 /* RX Destination Addr B (single block) */
115 #define SARL 0x04 /* TX Source Address L (single block) */
116 #define SARH 0x05 /* TX Source Address H (single block) */
117 #define SARB 0x06 /* TX Source Address B (single block) */
119 #define CPB 0x06 /* Chain Pointer Base (chained block) */
121 #define CDAL 0x08 /* Current Descriptor Addr L (chained block) */
122 #define CDAH 0x09 /* Current Descriptor Addr H (chained block) */
123 #define EDAL 0x0A /* Error Descriptor Addr L (chained block) */
124 #define EDAH 0x0B /* Error Descriptor Addr H (chained block) */
125 #define BFLL 0x0C /* RX Receive Buffer Length L (chained block)*/
126 #define BFLH 0x0D /* RX Receive Buffer Length H (chained block)*/
174 #define DIR_EOME 0x40 /* Frame Transfer Completed (chained-block) */
175 #define DIR_BOFE 0x20 /* Buffer Overflow/Underflow (chained-block)*/
176 #define DIR_COFE 0x10 /* Counter Overflow (chained-block) */
180 #define DSR_EOM 0x40 /* Frame Transfer Completed (chained-block) */
181 #define DSR_BOF 0x20 /* Buffer Overflow/Underflow (chained-block)*/
182 #define DSR_COF 0x10 /* Counter Overflow (chained-block) */
/linux-4.1.27/drivers/edac/
H A Dedac_device_sysfs.c413 /* edac_dev -> instance -> block information */
420 * Set of low-level block attribute show functions
425 struct edac_device_block *block = to_block(kobj); block_ue_count_show() local
427 return sprintf(data, "%u\n", block->counters.ue_count); block_ue_count_show()
433 struct edac_device_block *block = to_block(kobj); block_ce_count_show() local
435 return sprintf(data, "%u\n", block->counters.ce_count); block_ce_count_show()
438 /* DEVICE block kobject release() function */ edac_device_ctrl_block_release()
441 struct edac_device_block *block; edac_device_ctrl_block_release() local
446 block = to_block(kobj); edac_device_ctrl_block_release()
448 /* map from 'block kobj' to 'block->instance->controller->main_kobj' edac_device_ctrl_block_release()
449 * now 'release' the block kobject edac_device_ctrl_block_release()
451 kobject_put(&block->instance->ctl->kobj); edac_device_ctrl_block_release()
455 /* Function to 'show' fields from the edac_dev 'block' structure */ edac_dev_block_show()
467 /* Function to 'store' fields into the edac_dev 'block' structure */ edac_dev_block_store()
481 /* edac_dev file operations for a 'block' */
497 /* list of edac_dev 'block' attributes */
504 /* The 'ktype' for each edac_dev 'block' */
511 /* block ctor/dtor code */
518 struct edac_device_block *block) edac_device_create_block()
525 edac_dbg(4, "Instance '%s' inst_p=%p block '%s' block_p=%p\n", edac_device_create_block()
526 instance->name, instance, block->name, block); edac_device_create_block()
527 edac_dbg(4, "block kobj=%p block kobj->parent=%p\n", edac_device_create_block()
528 &block->kobj, &block->kobj.parent); edac_device_create_block()
530 /* init this block's kobject */ edac_device_create_block()
531 memset(&block->kobj, 0, sizeof(struct kobject)); edac_device_create_block()
542 /* Add this block's kobject */ edac_device_create_block()
543 err = kobject_init_and_add(&block->kobj, &ktype_block_ctrl, edac_device_create_block()
545 "%s", block->name); edac_device_create_block()
547 edac_dbg(1, "Failed to register instance '%s'\n", block->name); edac_device_create_block()
553 /* If there are driver level block attributes, then added them edac_device_create_block()
554 * to the block kobject edac_device_create_block()
556 sysfs_attrib = block->block_attributes; edac_device_create_block()
557 if (sysfs_attrib && block->nr_attribs) { edac_device_create_block()
558 for (i = 0; i < block->nr_attribs; i++, sysfs_attrib++) { edac_device_create_block()
560 edac_dbg(4, "creating block attrib='%s' attrib->%p to kobj=%p\n", edac_device_create_block()
562 sysfs_attrib, &block->kobj); edac_device_create_block()
565 err = sysfs_create_file(&block->kobj, edac_device_create_block()
571 kobject_uevent(&block->kobj, KOBJ_ADD); edac_device_create_block()
577 kobject_put(&block->kobj); edac_device_create_block()
584 * edac_device_delete_block(edac_dev,block);
587 struct edac_device_block *block) edac_device_delete_block()
592 /* if this block has 'attributes' then we need to iterate over the list edac_device_delete_block()
593 * and 'remove' the attributes on this block edac_device_delete_block()
595 sysfs_attrib = block->block_attributes; edac_device_delete_block()
596 if (sysfs_attrib && block->nr_attribs) { edac_device_delete_block()
597 for (i = 0; i < block->nr_attribs; i++, sysfs_attrib++) { edac_device_delete_block()
600 sysfs_remove_file(&block->kobj, edac_device_delete_block()
605 /* unregister this block's kobject, SEE: edac_device_delete_block()
608 kobject_put(&block->kobj); edac_device_delete_block()
801 * created. 'instance' and 'block' kobjects should be registered
802 * along with any 'block' attributes from the low driver. In addition,
877 /* walk the instance/block kobject tree, deconstructing it */ edac_device_remove_sysfs()
516 edac_device_create_block(struct edac_device_ctl_info *edac_dev, struct edac_device_instance *instance, struct edac_device_block *block) edac_device_create_block() argument
586 edac_device_delete_block(struct edac_device_ctl_info *edac_dev, struct edac_device_block *block) edac_device_delete_block() argument
H A Dedac_device.c82 unsigned instance, block, attr; edac_device_alloc_ctl_info() local
90 * (instance,block,attrib) from the start of an allocated structure. edac_device_alloc_ctl_info()
91 * We want the alignment of each item (instance,block,attrib) edac_device_alloc_ctl_info()
104 * which will become the start of the block array edac_device_alloc_ctl_info()
174 /* Initialize every block in each instance */ edac_device_alloc_ctl_info()
175 for (block = 0; block < nr_blocks; block++) { edac_device_alloc_ctl_info()
176 blk = &blk_p[block]; edac_device_alloc_ctl_info()
179 "%s%d", edac_block_name, block+offset_value); edac_device_alloc_ctl_info()
181 edac_dbg(4, "instance=%d inst_p=%p block=#%d block_p=%p name='%s'\n", edac_device_alloc_ctl_info()
182 instance, inst, block, blk, blk->name); edac_device_alloc_ctl_info()
185 * then continue on to next block iteration edac_device_alloc_ctl_info()
190 /* setup the attribute array for this block */ edac_device_alloc_ctl_info()
192 attrib_p = &dev_attrib[block*nr_instances*nr_attrib]; edac_device_alloc_ctl_info()
199 * block with the data the caller passed in edac_device_alloc_ctl_info()
200 * Each block gets its own copy of pointers, edac_device_alloc_ctl_info()
213 attrib->block = blk; /* up link */ edac_device_alloc_ctl_info()
625 struct edac_device_block *block = NULL; edac_device_handle_ce() local
639 "INTERNAL ERROR: instance %d 'block' " edac_device_handle_ce()
647 block = instance->blocks + block_nr; edac_device_handle_ce()
648 block->counters.ce_count++; edac_device_handle_ce()
657 "CE: %s instance: %s block: %s '%s'\n", edac_device_handle_ce()
659 block ? block->name : "N/A", msg); edac_device_handle_ce()
671 struct edac_device_block *block = NULL; edac_device_handle_ue() local
685 "INTERNAL ERROR: instance %d 'block' " edac_device_handle_ue()
693 block = instance->blocks + block_nr; edac_device_handle_ue()
694 block->counters.ue_count++; edac_device_handle_ue()
703 "UE: %s instance: %s block: %s '%s'\n", edac_device_handle_ue()
705 block ? block->name : "N/A", msg); edac_device_handle_ue()
708 panic("EDAC %s: UE instance: %s block %s '%s'\n", edac_device_handle_ue()
710 block ? block->name : "N/A", msg); edac_device_handle_ue()
/linux-4.1.27/sound/soc/intel/haswell/
H A Dsst-haswell-dsp.c91 struct dma_block_info *block; hsw_parse_module() local
124 block = (void *)module + sizeof(*module); hsw_parse_module()
128 if (block->size <= 0) { hsw_parse_module()
130 "error: block %d size invalid\n", count); hsw_parse_module()
135 switch (block->type) { hsw_parse_module()
139 block->ram_offset + dsp->addr.iram_offset; hsw_parse_module()
145 mod->offset = block->ram_offset; hsw_parse_module()
149 dev_err(dsp->dev, "error: bad type 0x%x for block 0x%x\n", hsw_parse_module()
150 block->type, count); hsw_parse_module()
155 mod->size = block->size; hsw_parse_module()
156 mod->data = (void *)block + sizeof(*block); hsw_parse_module()
159 dev_dbg(dsp->dev, "module block %d type 0x%x " hsw_parse_module()
161 count, mod->type, block->size, ram, hsw_parse_module()
162 block->ram_offset); hsw_parse_module()
172 block = (void *)block + sizeof(*block) + block->size; hsw_parse_module()
368 can't be accessed, please enable each block before accessing. */ hsw_set_dsp_D0()
371 /* for D0, always enable the block(DSRAM[0]) used for FW dump */ hsw_set_dsp_D0()
497 static u32 hsw_block_get_bit(struct sst_mem_block *block) hsw_block_get_bit() argument
500 struct sst_dsp *sst = block->dsp; hsw_block_get_bit()
508 switch (block->type) { hsw_block_get_bit()
521 bit = 1 << (block->index + shift); hsw_block_get_bit()
526 /*dummy read a SRAM block.*/ sst_mem_block_dummy_read()
527 static void sst_mem_block_dummy_read(struct sst_mem_block *block) sst_mem_block_dummy_read() argument
531 struct sst_dsp *sst = block->dsp; sst_mem_block_dummy_read()
533 size = block->size > 4 ? 4 : block->size; sst_mem_block_dummy_read()
534 memcpy_fromio(tmp_buf, sst->addr.lpe + block->offset, size); sst_mem_block_dummy_read()
537 /* enable 32kB memory block - locks held by caller */ hsw_block_enable()
538 static int hsw_block_enable(struct sst_mem_block *block) hsw_block_enable() argument
540 struct sst_dsp *sst = block->dsp; hsw_block_enable()
543 if (block->users++ > 0) hsw_block_enable()
546 dev_dbg(block->dsp->dev, " enabled block %d:%d at offset 0x%x\n", hsw_block_enable()
547 block->type, block->index, block->offset); hsw_block_enable()
555 bit = hsw_block_get_bit(block); hsw_block_enable()
568 /*add a dummy read before the SRAM block is written, otherwise the writing may miss bytes sometimes.*/ hsw_block_enable()
569 sst_mem_block_dummy_read(block); hsw_block_enable()
573 /* disable 32kB memory block - locks held by caller */ hsw_block_disable()
574 static int hsw_block_disable(struct sst_mem_block *block) hsw_block_disable() argument
576 struct sst_dsp *sst = block->dsp; hsw_block_disable()
579 if (--block->users > 0) hsw_block_disable()
582 dev_dbg(block->dsp->dev, " disabled block %d:%d at offset 0x%x\n", hsw_block_disable()
583 block->type, block->index, block->offset); hsw_block_disable()
592 bit = hsw_block_get_bit(block); hsw_block_disable()
677 /* always enable the block(DSRAM[0]) used for FW dump */ hsw_init()
680 can't be accessed, please enable each block before accessing. */ hsw_init()
/linux-4.1.27/sound/pci/emu10k1/
H A Demu10k1_patch.c35 * allocate a sample block and copy data from userspace
90 /* try to allocate a memory block */ snd_emu10k1_sample_new()
94 sp->block = snd_emu10k1_synth_alloc(emu, blocksize); snd_emu10k1_sample_new()
95 if (sp->block == NULL) { snd_emu10k1_sample_new()
111 snd_emu10k1_synth_bzero(emu, sp->block, offset, size); snd_emu10k1_sample_new()
120 if (snd_emu10k1_synth_copy_from_user(emu, sp->block, offset, data, size)) { snd_emu10k1_sample_new()
121 snd_emu10k1_synth_free(emu, sp->block); snd_emu10k1_sample_new()
122 sp->block = NULL; snd_emu10k1_sample_new()
134 unsigned short *wblock = (unsigned short*)block; snd_emu10k1_sample_new()
145 block[offset + i] = block[offset - i -1]; snd_emu10k1_sample_new()
167 if (snd_emu10k1_synth_copy_from_user(emu, sp->block, offset, data, size)) { snd_emu10k1_sample_new()
168 snd_emu10k1_synth_free(emu, sp->block); snd_emu10k1_sample_new()
169 sp->block = NULL; snd_emu10k1_sample_new()
176 snd_emu10k1_synth_bzero(emu, sp->block, offset, blocksize - offset); snd_emu10k1_sample_new()
190 unsigned short *wblock = (unsigned short*)block; snd_emu10k1_sample_new()
195 block[i] ^= 0x80; snd_emu10k1_sample_new()
213 * free a sample block
225 if (sp->block) { snd_emu10k1_sample_free()
226 snd_emu10k1_synth_free(emu, sp->block); snd_emu10k1_sample_free()
227 sp->block = NULL; snd_emu10k1_sample_free()
/linux-4.1.27/fs/logfs/
H A Dreadwrite.c12 * seek_data find next data block
13 * valid check whether a block still belongs to a file
15 * delete delete a block (for directories and ifile)
52 * set, the actual block index (bix) and level can be derived from the page
55 * The lowest three bits of the block index are set to 0 after packing and
389 static void indirect_write_block(struct logfs_block *block) indirect_write_block() argument
395 page = block->page; indirect_write_block()
416 static void inode_write_block(struct logfs_block *block) inode_write_block() argument
421 inode = block->inode; inode_write_block()
462 struct logfs_block *block, write_alias_t *write_one_alias) inode_write_alias()
464 struct inode *inode = block->inode; inode_write_alias()
473 pos = fnb(block->alias_map, LOGFS_BLOCK_FACTOR, pos); inode_write_alias()
504 struct logfs_block *block, write_alias_t *write_one_alias) indirect_write_alias()
507 struct page *page = block->page; indirect_write_alias()
514 pos = fnb(block->alias_map, LOGFS_BLOCK_FACTOR, pos); indirect_write_alias()
532 struct logfs_block *block; logfs_write_obj_aliases_pagecache() local
535 list_for_each_entry(block, &super->s_object_alias, alias_list) { logfs_write_obj_aliases_pagecache()
536 err = block->ops->write_alias(sb, block, write_alias_journal); logfs_write_obj_aliases_pagecache()
543 void __free_block(struct super_block *sb, struct logfs_block *block) __free_block() argument
545 BUG_ON(!list_empty(&block->item_list)); __free_block()
546 list_del(&block->alias_list); __free_block()
547 mempool_free(block, logfs_super(sb)->s_block_pool); __free_block()
550 static void inode_free_block(struct super_block *sb, struct logfs_block *block) inode_free_block() argument
552 struct inode *inode = block->inode; inode_free_block()
555 __free_block(sb, block); inode_free_block()
559 struct logfs_block *block) indirect_free_block()
561 struct page *page = block->page; indirect_free_block()
568 __free_block(sb, block); indirect_free_block()
588 struct logfs_block *block; __alloc_block() local
590 block = mempool_alloc(super->s_block_pool, GFP_NOFS); __alloc_block()
591 memset(block, 0, sizeof(*block)); __alloc_block()
592 INIT_LIST_HEAD(&block->alias_list); __alloc_block()
593 INIT_LIST_HEAD(&block->item_list); __alloc_block()
594 block->sb = sb; __alloc_block()
595 block->ino = ino; __alloc_block()
596 block->bix = bix; __alloc_block()
597 block->level = level; __alloc_block()
598 return block; __alloc_block()
604 struct logfs_block *block; alloc_inode_block() local
609 block = __alloc_block(inode->i_sb, LOGFS_INO_MASTER, inode->i_ino, 0); alloc_inode_block()
610 block->inode = inode; alloc_inode_block()
611 li->li_block = block; alloc_inode_block()
612 block->ops = &inode_block_ops; alloc_inode_block()
615 void initialize_block_counters(struct page *page, struct logfs_block *block, initialize_block_counters() argument
621 block->partial = 0; initialize_block_counters()
622 block->full = 0; initialize_block_counters()
631 block->full = I0_BLOCKS; initialize_block_counters()
637 block->partial++; initialize_block_counters()
639 block->full++; initialize_block_counters()
646 struct logfs_block *block; alloc_data_block() local
654 block = __alloc_block(inode->i_sb, inode->i_ino, bix, level); alloc_data_block()
655 block->page = page; alloc_data_block()
659 set_page_private(page, (unsigned long) block); alloc_data_block()
661 block->ops = &indirect_block_ops; alloc_data_block()
667 struct logfs_block *block; alloc_indirect_block() local
675 block = logfs_block(page); alloc_indirect_block()
677 initialize_block_counters(page, block, array, page_is_empty); alloc_indirect_block()
683 struct logfs_block *block = logfs_block(page); block_set_pointer() local
687 BUG_ON(!block); block_set_pointer()
694 block->full += !!(ptr & LOGFS_FULLY_POPULATED) block_set_pointer()
696 block->partial += !!ptr - !!oldptr; block_set_pointer()
701 __be64 *block; block_get_pointer() local
704 block = kmap_atomic(page); block_get_pointer()
705 ptr = be64_to_cpu(block[index]); block_get_pointer()
706 kunmap_atomic(block); block_get_pointer()
720 u64 block; logfs_read_direct() local
722 block = li->li_data[index]; logfs_read_direct()
723 if (!block) logfs_read_direct()
726 return logfs_segment_read(inode, page, block, index, 0); logfs_read_direct()
880 * logfs_seek_hole - find next hole starting at a given block index
882 * @bix: block index to start searching
885 * block address next to eof is returned instead.
937 * logfs_seek_data - find next data block after a given block index
939 * @bix: block index to start searching
941 * Returns next data block. If the file doesn't contain any further data
942 * blocks, the last block in the file is returned instead.
1020 * logfs_is_valid_block - check whether this block is still valid
1023 * @ofs: block physical offset
1024 * @ino: block inode number
1025 * @bix: block index
1026 * @gc_level: block level
1028 * Returns 0 if the block is invalid, 1 if it is valid and 2 if it will
1104 struct logfs_block *block = logfs_block(page); get_page_reserve() local
1107 if (block && block->reserved_bytes) get_page_reserve()
1113 block = list_entry(super->s_writeback_list.next, get_page_reserve()
1115 block->ops->write_block(block); get_page_reserve()
1119 block = logfs_block(page); get_page_reserve()
1120 block->reserved_bytes += 6 * LOGFS_MAX_OBJECTSIZE; get_page_reserve()
1122 list_move_tail(&block->alias_list, &super->s_writeback_list); get_page_reserve()
1263 * every single write. It is attached to the indirect block, which is
1264 * marked dirty. When the indirect block is written, its shadows are
1265 * handed up to the next indirect block (or inode). Untimately they
1270 * the page's tree, in case it was an indirect block. If a page is
1278 struct logfs_block *block = logfs_block(page); fill_shadow_tree() local
1282 if (block->alias_map) fill_shadow_tree()
1284 block->alias_map, LOGFS_BLOCK_FACTOR); fill_shadow_tree()
1285 logfs_handle_transaction(inode, block->ta); fill_shadow_tree()
1286 block->ops->free_block(inode->i_sb, block); fill_shadow_tree()
1303 static void logfs_set_alias(struct super_block *sb, struct logfs_block *block, logfs_set_alias() argument
1308 if (block->inode && block->inode->i_ino == LOGFS_INO_MASTER) { logfs_set_alias()
1313 if (!test_bit(child_no, block->alias_map)) { logfs_set_alias()
1314 set_bit(child_no, block->alias_map); logfs_set_alias()
1317 list_move_tail(&block->alias_list, &super->s_object_alias); logfs_set_alias()
1400 struct logfs_block *block = logfs_block(page); ptr_change() local
1404 empty1 = block->partial == 0; ptr_change()
1410 full1 = block->full == LOGFS_BLOCK_FACTOR; ptr_change()
1503 struct logfs_block *block = logfs_inode(inode)->li_block; logfs_del_transaction() local
1505 if (block && block->ta) logfs_del_transaction()
1506 block->ta = NULL; logfs_del_transaction()
1865 * every single block resided in a different segment.
1907 struct logfs_block *block = logfs_block(page); move_page_to_inode() local
1909 if (!block) move_page_to_inode()
1913 block->ino, block->bix, block->level); move_page_to_inode()
1915 block->ops = &inode_block_ops; move_page_to_inode()
1916 block->inode = inode; move_page_to_inode()
1917 li->li_block = block; move_page_to_inode()
1919 block->page = NULL; move_page_to_inode()
1930 struct logfs_block *block = li->li_block; move_inode_to_page() local
1932 if (!block) move_inode_to_page()
1936 block->ino, block->bix, block->level); move_inode_to_page()
1938 block->ops = &indirect_block_ops; move_inode_to_page()
1939 block->page = page; move_inode_to_page()
1944 set_page_private(page, (unsigned long) block); move_inode_to_page()
1947 block->inode = NULL; move_inode_to_page()
2172 struct logfs_block *block = li->li_block; logfs_evict_inode() local
2191 if (!block) logfs_evict_inode()
2194 block->ops->free_block(inode->i_sb, block); logfs_evict_inode()
2203 void btree_write_block(struct logfs_block *block) btree_write_block() argument
2209 inode = logfs_safe_iget(block->sb, block->ino, &cookie); btree_write_block()
2210 page = logfs_get_write_page(inode, block->bix, block->level); btree_write_block()
2215 BUG_ON(logfs_block(page) != block); btree_write_block()
2230 * @bix: block index
461 inode_write_alias(struct super_block *sb, struct logfs_block *block, write_alias_t *write_one_alias) inode_write_alias() argument
503 indirect_write_alias(struct super_block *sb, struct logfs_block *block, write_alias_t *write_one_alias) indirect_write_alias() argument
558 indirect_free_block(struct super_block *sb, struct logfs_block *block) indirect_free_block() argument
H A Dsegment.c185 static int btree_write_alias(struct super_block *sb, struct logfs_block *block, btree_write_alias() argument
191 list_for_each_entry(item, &block->item_list, list) { btree_write_alias()
192 err = write_alias_journal(sb, block->ino, block->bix, btree_write_alias()
193 block->level, item->child_no, item->val); btree_write_alias()
210 struct logfs_block *block; logfs_load_object_aliases() local
235 block = alias_tree_lookup(sb, ino, bix, level); logfs_load_object_aliases()
236 if (!block) { logfs_load_object_aliases()
237 block = __alloc_block(sb, ino, bix, level); logfs_load_object_aliases()
238 block->ops = &btree_block_ops; logfs_load_object_aliases()
239 err = alias_tree_insert(sb, ino, bix, level, block); logfs_load_object_aliases()
242 if (test_and_set_bit(item->child_no, block->alias_map)) { logfs_load_object_aliases()
246 list_move_tail(&block->alias_list, &super->s_object_alias); logfs_load_object_aliases()
247 list_add(&item->list, &block->item_list); logfs_load_object_aliases()
255 struct logfs_block *block = _block; kill_alias() local
256 struct super_block *sb = block->sb; kill_alias()
260 while (!list_empty(&block->item_list)) { kill_alias()
261 item = list_entry(block->item_list.next, typeof(*item), list); kill_alias()
265 block->ops->free_block(sb, block); kill_alias()
358 * logfs_segment_write - write data block to object store
426 * of any data block somewhere behind this indirect block. So we need to
481 struct logfs_block *block; move_btree_to_page() local
487 block = btree_remove128(head, inode->i_ino, page->index); move_btree_to_page()
488 if (!block) move_btree_to_page()
492 block->ino, block->bix, block->level); move_btree_to_page()
493 list_for_each_entry_safe(item, next, &block->item_list, list) { move_btree_to_page()
498 block->page = page; move_btree_to_page()
503 set_page_private(page, (unsigned long) block); move_btree_to_page()
505 block->ops = &indirect_block_ops; move_btree_to_page()
506 initialize_block_counters(page, block, data, 0); move_btree_to_page()
522 struct logfs_block *block = logfs_block(page); move_page_to_btree() local
523 struct super_block *sb = block->sb; move_page_to_btree()
531 block->ops->free_block(sb, block); move_page_to_btree()
535 block->ino, block->bix, block->level); move_page_to_btree()
539 pos = fnb(block->alias_map, LOGFS_BLOCK_FACTOR, pos); move_page_to_btree()
551 list_add(&item->list, &block->item_list); move_page_to_btree()
553 block->page = NULL; move_page_to_btree()
560 block->ops = &btree_block_ops; move_page_to_btree()
561 err = alias_tree_insert(block->sb, block->ino, block->bix, block->level, move_page_to_btree()
562 block); move_page_to_btree()
647 * logfs_segment_read - read data block from object store
651 * @bix: block index
652 * @level: block level
/linux-4.1.27/drivers/net/wireless/ath/wil6210/
H A Dioctl.c50 wil_err(wil, "Requested block does not fit into memory: " wil_ioc_addr()
105 void *block; wil_ioc_memio_block() local
128 block = kmalloc(io.size, GFP_USER); wil_ioc_memio_block()
129 if (!block) wil_ioc_memio_block()
135 wil_memcpy_fromio_32(block, a, io.size); wil_ioc_memio_block()
136 wil_hex_dump_ioctl("Read ", block, io.size); wil_ioc_memio_block()
137 if (copy_to_user(io.block, block, io.size)) { wil_ioc_memio_block()
143 if (copy_from_user(block, io.block, io.size)) { wil_ioc_memio_block()
147 wil_memcpy_toio_32(a, block, io.size); wil_ioc_memio_block()
149 wil_hex_dump_ioctl("Write ", block, io.size); wil_ioc_memio_block()
158 kfree(block); wil_ioc_memio_block()
H A Dfw_inc.c206 const struct wil_fw_data_dwrite *block = d->data; fw_handle_direct_write() local
209 if (size % sizeof(*block)) { fw_handle_direct_write()
211 sizeof(*block), size); fw_handle_direct_write()
214 n = size / sizeof(*block); fw_handle_direct_write()
218 u32 m = le32_to_cpu(block[i].mask); fw_handle_direct_write()
219 u32 v = le32_to_cpu(block[i].value); fw_handle_direct_write()
222 FW_ADDR_CHECK(dst, block[i].addr, "address"); fw_handle_direct_write()
228 le32_to_cpu(block[i].addr), y, x, v, m); fw_handle_direct_write()
262 const struct wil_fw_data_gw *block = d->data; fw_handle_gateway_data() local
270 if (size < sizeof(*d) + sizeof(*block)) { fw_handle_gateway_data()
275 if ((size - sizeof(*d)) % sizeof(*block)) { fw_handle_gateway_data()
278 sizeof(*block), size - sizeof(*d)); fw_handle_gateway_data()
281 n = (size - sizeof(*d)) / sizeof(*block); fw_handle_gateway_data()
302 u32 a = le32_to_cpu(block[i].addr); fw_handle_gateway_data()
303 u32 v = le32_to_cpu(block[i].value); fw_handle_gateway_data()
321 const struct wil_fw_data_gw4 *block = d->data; fw_handle_gateway_data4() local
323 void __iomem *gwa_val[ARRAY_SIZE(block->value)]; fw_handle_gateway_data4()
329 if (size < sizeof(*d) + sizeof(*block)) { fw_handle_gateway_data4()
334 if ((size - sizeof(*d)) % sizeof(*block)) { fw_handle_gateway_data4()
337 sizeof(*block), size - sizeof(*d)); fw_handle_gateway_data4()
340 n = (size - sizeof(*d)) / sizeof(*block); fw_handle_gateway_data4()
348 for (k = 0; k < ARRAY_SIZE(block->value); k++) fw_handle_gateway_data4()
364 u32 a = le32_to_cpu(block[i].addr); fw_handle_gateway_data4()
365 u32 v[ARRAY_SIZE(block->value)]; fw_handle_gateway_data4()
367 for (k = 0; k < ARRAY_SIZE(block->value); k++) fw_handle_gateway_data4()
368 v[k] = le32_to_cpu(block[i].value[k]); fw_handle_gateway_data4()
374 for (k = 0; k < ARRAY_SIZE(block->value); k++) fw_handle_gateway_data4()
/linux-4.1.27/drivers/s390/char/
H A Dsclp_ocf.c48 /* Find the 0x9f00 block. */ sclp_ocf_handler()
53 /* Find the 0x9f22 block inside the 0x9f00 block. */ sclp_ocf_handler()
57 /* Find the 0x81 block inside the 0x9f22 block. */ sclp_ocf_handler()
61 /* Find the 0x01 block inside the 0x81 block. */ sclp_ocf_handler()
63 /* Find the 0x02 block inside the 0x81 block. */ sclp_ocf_handler()
/linux-4.1.27/fs/nilfs2/
H A Dmdt.c41 nilfs_mdt_insert_new_block(struct inode *inode, unsigned long block, nilfs_mdt_insert_new_block() argument
55 ret = nilfs_bmap_insert(ii->i_bmap, block, (unsigned long)bh); nilfs_mdt_insert_new_block()
74 static int nilfs_mdt_create_block(struct inode *inode, unsigned long block, nilfs_mdt_create_block() argument
88 bh = nilfs_grab_buffer(inode, inode->i_mapping, block, 0); nilfs_mdt_create_block()
101 err = nilfs_mdt_insert_new_block(inode, block, bh, init_block); nilfs_mdt_create_block()
173 static int nilfs_mdt_read_block(struct inode *inode, unsigned long block, nilfs_mdt_read_block() argument
181 err = nilfs_mdt_submit_block(inode, block, READ, &first_bh); nilfs_mdt_read_block()
189 blkoff = block + 1; nilfs_mdt_read_block()
221 * @blkoff: block offset
223 * @init_block: initializer used for newly allocated block
238 * %-ENOENT - the specified block does not exist (hole block)
266 * @start: start block offset (inclusive)
267 * @end: end block offset (inclusive)
268 * @blkoff: block offset
271 * nilfs_mdt_find_block() looks up an existing block in range of
272 * [@start, @end] and stores pointer to a buffer head of the block to
273 * @out_bh, and block offset to @blkoff, respectively. @out_bh and
283 * %-ENOENT - no block was found in the range
320 * @block: block offset
329 int nilfs_mdt_delete_block(struct inode *inode, unsigned long block) nilfs_mdt_delete_block() argument
334 err = nilfs_bmap_delete(ii->i_bmap, block); nilfs_mdt_delete_block()
337 nilfs_mdt_forget_block(inode, block); nilfs_mdt_delete_block()
345 * @block: block offset
357 int nilfs_mdt_forget_block(struct inode *inode, unsigned long block) nilfs_mdt_forget_block() argument
359 pgoff_t index = (pgoff_t)block >> nilfs_mdt_forget_block()
377 bh = nilfs_page_get_nth_block(page, block - first_block); nilfs_mdt_forget_block()
391 * nilfs_mdt_mark_block_dirty - mark a block on the meta data file dirty.
393 * @block: block offset
402 * %-ENOENT - the specified block does not exist (hole block)
404 int nilfs_mdt_mark_block_dirty(struct inode *inode, unsigned long block) nilfs_mdt_mark_block_dirty() argument
409 err = nilfs_mdt_read_block(inode, block, 0, &bh); nilfs_mdt_mark_block_dirty()
H A Ddat.c266 * @vblocknr: virtual block number
290 * nilfs_dat_freev - free virtual block numbers
292 * @vblocknrs: array of virtual block numbers
293 * @nitems: number of virtual block numbers
295 * Description: nilfs_dat_freev() frees the virtual block numbers specified by
305 * %-ENOENT - The virtual block number have not been allocated.
313 * nilfs_dat_move - change a block number
315 * @vblocknr: virtual block number
316 * @blocknr: block number
318 * Description: nilfs_dat_move() changes the block number associated with
340 * The given disk block number (blocknr) is not yet written to nilfs_dat_move()
344 * uncommitted block number, this makes a copy of the entry nilfs_dat_move()
379 * nilfs_dat_translate - translate a virtual block number to a block number
381 * @vblocknr: virtual block number
382 * @blocknrp: pointer to a block number
384 * Description: nilfs_dat_translate() maps the virtual block number @vblocknr
385 * to the corresponding block number.
387 * Return Value: On success, 0 is returned and the block number associated
395 * %-ENOENT - A block number associated with @vblocknr does not exist.
450 /* last virtual block number in this block */ nilfs_dat_get_vinfo()
474 * @sb: super block instance
/linux-4.1.27/include/uapi/linux/
H A Dminix_fs.h13 * minix filesystem (aka V2) with bigger inodes and 32-bit block
46 * long block numbers and a third indirect block (7+1+1+1
63 * minix super-block data on disk
79 * V3 minix super-block data on disk
/linux-4.1.27/include/trace/events/
H A Dblock.h2 #define TRACE_SYSTEM block
99 * block_rq_abort - abort block operation request
100 * @q: queue containing the block operation request
101 * @rq: block IO operation request
103 * Called immediately after pending block IO operation request @rq in
116 * block_rq_requeue - place block IO request back on a queue
118 * @rq: block IO operation request
120 * The block operation request @rq is being placed back into queue
132 * block_rq_complete - block IO operation completed by device driver
133 * @q: queue containing the block operation request
134 * @rq: block operations request
214 * block_rq_insert - insert block operation request into queue
216 * @rq: block IO operation request
218 * Called immediately before block operation request @rq is inserted
231 * block_rq_issue - issue pending block IO request operation to device driver
233 * @rq: block IO operation operation request
235 * Called when block operation request @rq from queue @q is sent to a
246 * block_bio_bounce - used bounce buffer when processing block operation
247 * @q: queue holding the block operation
248 * @bio: block operation
250 * A bounce buffer was used to handle the block operation @bio in @q.
286 * block_bio_complete - completed all work on the block operation
287 * @q: queue holding the block operation
288 * @bio: block operation completed
292 * block IO operation @bio.
351 * block_bio_backmerge - merging block operation to the end of an existing operation
354 * @bio: new block operation to merge
356 * Merging block request @bio to the end of an existing block request
367 * block_bio_frontmerge - merging block operation to the beginning of an existing operation
370 * @bio: new block operation to merge
372 * Merging block IO operation @bio to the beginning of an existing block
383 * block_bio_queue - putting new block IO operation in queue
385 * @bio: new block operation
387 * About to place the block IO operation @bio into queue @q.
447 * block_getrq - get a free request entry in queue for block IO operations
449 * @bio: pending block IO operation
453 * block IO operation @bio.
463 * block_sleeprq - waiting to get a free request entry in queue for block IO operation
465 * @bio: pending block IO operation
484 * Plug the request queue @q. Do not allow block operation requests
486 * the queue to improve throughput performance of the block device.
543 * @bio: block operation being split
589 * raw block device.
625 * block_rq_remap - map request for a block operation request
627 * @rq: block IO operation request
631 * The block operation request @rq in @q has been remapped. The block
/linux-4.1.27/sound/synth/
H A Dutil_mem.c47 INIT_LIST_HEAD(&hdr->block); snd_util_memhdr_new()
62 while ((p = hdr->block.next) != &hdr->block) { snd_util_memhdr_free()
70 * allocate a memory block (without mutex)
89 /* look for empty block */ __snd_util_mem_alloc()
91 list_for_each(p, &hdr->block) { __snd_util_mem_alloc()
106 * create a new memory block with the given size
107 * the block is linked next to prev
120 if (prev == &hdr->block) __snd_util_memblk_new()
135 * allocate a memory block (with mutex)
149 * remove the block from linked-list and free resource
162 * free a memory block (with mutex)
/linux-4.1.27/fs/ufs/
H A Dutil.h320 * Extract the bits for a block from a map inside ufs_buffer_head
470 #define ubh_isblockclear(ubh,begin,block) (!_ubh_isblockset_(uspi,ubh,begin,block))
472 #define ubh_isblockset(ubh,begin,block) _ubh_isblockset_(uspi,ubh,begin,block) _ubh_isblockset_()
474 struct ufs_buffer_head * ubh, unsigned begin, unsigned block) _ubh_isblockset_()
478 return (*ubh_get_addr (ubh, begin + block) == 0xff); _ubh_isblockset_()
480 return (*ubh_get_addr (ubh, begin + (block >> 1)) == (0x0f << ((block & 0x01) << 2))); _ubh_isblockset_()
482 return (*ubh_get_addr (ubh, begin + (block >> 2)) == (0x03 << ((block & 0x03) << 1))); _ubh_isblockset_()
484 return (*ubh_get_addr (ubh, begin + (block >> 3)) == (0x01 << (block & 0x07))); _ubh_isblockset_()
489 #define ubh_clrblock(ubh,begin,block) _ubh_clrblock_(uspi,ubh,begin,block) _ubh_clrblock_()
491 struct ufs_buffer_head * ubh, unsigned begin, unsigned block) _ubh_clrblock_()
495 *ubh_get_addr (ubh, begin + block) = 0x00; _ubh_clrblock_()
498 *ubh_get_addr (ubh, begin + (block >> 1)) &= ~(0x0f << ((block & 0x01) << 2)); _ubh_clrblock_()
501 *ubh_get_addr (ubh, begin + (block >> 2)) &= ~(0x03 << ((block & 0x03) << 1)); _ubh_clrblock_()
504 *ubh_get_addr (ubh, begin + (block >> 3)) &= ~(0x01 << ((block & 0x07))); _ubh_clrblock_()
509 #define ubh_setblock(ubh,begin,block) _ubh_setblock_(uspi,ubh,begin,block) _ubh_setblock_()
511 struct ufs_buffer_head * ubh, unsigned begin, unsigned block) _ubh_setblock_()
515 *ubh_get_addr(ubh, begin + block) = 0xff; _ubh_setblock_()
518 *ubh_get_addr(ubh, begin + (block >> 1)) |= (0x0f << ((block & 0x01) << 2)); _ubh_setblock_()
521 *ubh_get_addr(ubh, begin + (block >> 2)) |= (0x03 << ((block & 0x03) << 1)); _ubh_setblock_()
524 *ubh_get_addr(ubh, begin + (block >> 3)) |= (0x01 << ((block & 0x07))); _ubh_setblock_()
473 _ubh_isblockset_(struct ufs_sb_private_info * uspi, struct ufs_buffer_head * ubh, unsigned begin, unsigned block) _ubh_isblockset_() argument
490 _ubh_clrblock_(struct ufs_sb_private_info * uspi, struct ufs_buffer_head * ubh, unsigned begin, unsigned block) _ubh_clrblock_() argument
510 _ubh_setblock_(struct ufs_sb_private_info * uspi, struct ufs_buffer_head * ubh, unsigned begin, unsigned block) _ubh_setblock_() argument
H A Dufs_fs.h62 * A filesystem is described by its super-block, which in turn
63 * describes the cylinder groups. The super-block is critical
66 * super-block data does not change, so the copies need not be
70 * are given in the super block as:
71 * [fs->fs_sblkno] Super-block
72 * [fs->fs_cblkno] Cylinder group block
79 * reside in any one of four places. For tiny media where every block
204 * Turn file system block numbers into disk block addresses.
218 #define ufs_cgcmin(c) (ufs_cgstart(c) + uspi->s_cblkno) /* cg block */
224 * inode number to file system block offset.
226 * inode number to file system block address.
234 * Compute the cylinder and rotational position of a cyl block addr.
354 __fs32 fs_sblkno; /* addr of super-block in filesys */
355 __fs32 fs_cblkno; /* offset of cyl-block in filesys */
366 __fs32 fs_frag; /* number of frags in a block in fs */
369 __fs32 fs_rotdelay; /* num of ms for optimal next block */
380 __fs32 fs_fragshift; /* block to frag shift */
382 __fs32 fs_sbsize; /* actual size of super block */
383 __fs32 fs_csmask; /* csum block offset */
384 __fs32 fs_csshift; /* csum block number */
423 __s8 fs_fmod; /* super block modified flag */
434 __fs16 fs_opostbl[16][8]; /* old rotation block list head */
449 __fs64 fs_sparecon64[17];/*old rotation block list head */
490 __fs32 fs_postbloff; /* (__s16) rotation block list head */
515 * Cylinder group block for a file system.
518 * super block lock fs->fs_lock.
545 __fs32 cg_rotor; /* position of last used block */
549 __fs32 cg_btotoff; /* (__u32) block totals per cylinder */
550 __fs32 cg_boff; /* (short) free block positions */
552 __fs32 cg_freeoff; /* (u_char) free block map */
587 __fs32 cg_rotor; /* position of last used block */
591 __fs32 cg_btot[32]; /* block totals per cylinder */
595 __u8 cg_free[1]; /* free block map */
669 __fs32 ui_extsize; /* 92: External attributes block. */
670 __fs64 ui_extb[UFS_NXADDR];/* 96: External attributes block. */
713 __u32 c_rotor; /* position of last used block */
716 __u32 c_btotoff; /* (__u32) block totals per cylinder */
717 __u32 c_boff; /* (short) free block positions */
719 __u32 c_freeoff; /* (u_char) free block map */
728 struct ufs_buffer_head s_ubh; /* buffer containing super block */
731 __u32 s_cblkno; /* offset of cg-block in filesys */
743 __u32 s_fpb; /* fragments per block */
749 __u32 s_fpbshift; /* fragments per block shift */
751 __u32 s_sbsize; /* actual size of super block */
752 __u32 s_csmask; /* csum block offset */
753 __u32 s_csshift; /* csum block number */
774 __s32 s_postbloff; /* (__s16) rotation block list head */
777 __u32 s_fpbmask; /* fragments per block mask */
778 __u32 s_apb; /* address per block */
779 __u32 s_2apb; /* address per block^2 */
780 __u32 s_3apb; /* address per block^3 */
781 __u32 s_apbmask; /* address per block mask */
782 __u32 s_apbshift; /* address per block shift */
783 __u32 s_2apbshift; /* address per block shift * 2 */
784 __u32 s_3apbshift; /* address per block shift * 3 */
786 __u32 s_nspb; /* number of sector per block */
/linux-4.1.27/fs/xfs/
H A Dxfs_rtalloc.c42 * bitmap block combination.
43 * Keeps track of a current summary block, so we don't keep reading
51 xfs_rtblock_t bbno, /* bitmap block number */ xfs_rtget_summary()
52 xfs_buf_t **rbpp, /* in/out: summary block buffer */ xfs_rtget_summary()
53 xfs_fsblock_t *rsb, /* in/out: summary block number */ xfs_rtget_summary()
54 xfs_suminfo_t *sum) /* out: summary info for this block */ xfs_rtget_summary()
61 * by low and high, for the bitmap block bbno.
69 xfs_rtblock_t bbno, /* bitmap block number */ xfs_rtany_summary()
70 xfs_buf_t **rbpp, /* in/out: summary block buffer */ xfs_rtany_summary()
71 xfs_fsblock_t *rsb, /* in/out: summary block number */ xfs_rtany_summary()
115 xfs_rtblock_t bbno; /* bitmap block number */ xfs_rtcopy_summary()
120 xfs_fsblock_t sumbno; /* summary block number */ xfs_rtcopy_summary()
154 xfs_rtblock_t start, /* start block to allocate */ xfs_rtallocate_range()
156 xfs_buf_t **rbpp, /* in/out: summary block buffer */ xfs_rtallocate_range()
157 xfs_fsblock_t *rsb) /* in/out: summary block number */ xfs_rtallocate_range()
161 xfs_rtblock_t postblock = 0; /* first block allocated > end */ xfs_rtallocate_range()
162 xfs_rtblock_t preblock = 0; /* first block allocated < start */ xfs_rtallocate_range()
175 * Find the next allocated block (end of free extent). xfs_rtallocate_range()
225 * bitmap block bbno. If we don't get maxlen then use prod to trim
226 * the length, if given. Returns error; returns starting block in *rtblock.
233 xfs_rtblock_t bbno, /* bitmap block number */ xfs_rtallocate_extent_block()
237 xfs_rtblock_t *nextp, /* out: next block to try */ xfs_rtallocate_extent_block()
238 xfs_buf_t **rbpp, /* in/out: summary block buffer */ xfs_rtallocate_extent_block()
239 xfs_fsblock_t *rsb, /* in/out: summary block number */ xfs_rtallocate_extent_block()
241 xfs_rtblock_t *rtblock) /* out: start block allocated */ xfs_rtallocate_extent_block()
252 * Loop over all the extents starting in this bitmap block, xfs_rtallocate_extent_block()
329 * Allocation failed. Set *nextp to the next block to try. xfs_rtallocate_extent_block()
337 * Allocate an extent of length minlen<=len<=maxlen, starting at block
339 * Returns error; returns starting block in *rtblock.
346 xfs_rtblock_t bno, /* starting block number to allocate */ xfs_rtallocate_extent_exact()
350 xfs_buf_t **rbpp, /* in/out: summary block buffer */ xfs_rtallocate_extent_exact()
351 xfs_fsblock_t *rsb, /* in/out: summary block number */ xfs_rtallocate_extent_exact()
353 xfs_rtblock_t *rtblock) /* out: start block allocated */ xfs_rtallocate_extent_exact()
358 xfs_rtblock_t next; /* next block to try (dummy) */ xfs_rtallocate_extent_exact()
425 xfs_rtblock_t bno, /* starting block number to allocate */ xfs_rtallocate_extent_near()
429 xfs_buf_t **rbpp, /* in/out: summary block buffer */ xfs_rtallocate_extent_near()
430 xfs_fsblock_t *rsb, /* in/out: summary block number */ xfs_rtallocate_extent_near()
432 xfs_rtblock_t *rtblock) /* out: start block allocated */ xfs_rtallocate_extent_near()
435 xfs_rtblock_t bbno; /* bitmap block number */ xfs_rtallocate_extent_near()
437 int i; /* bitmap block offset (loop control) */ xfs_rtallocate_extent_near()
440 xfs_rtblock_t n; /* next block to try */ xfs_rtallocate_extent_near()
441 xfs_rtblock_t r; /* result block */ xfs_rtallocate_extent_near()
445 * If the block number given is off the end, silently set it to xfs_rtallocate_extent_near()
446 * the last block. xfs_rtallocate_extent_near()
470 * Loop over all bitmap blocks (bbno + i is current block). xfs_rtallocate_extent_near()
475 * starting in this bitmap block. xfs_rtallocate_extent_near()
493 * this block. xfs_rtallocate_extent_near()
517 * bitmap block and is long enough. xfs_rtallocate_extent_near()
522 * this bitmap block. xfs_rtallocate_extent_near()
534 * earlier block. If there is an xfs_rtallocate_extent_near()
559 * Try to allocate from the summary block xfs_rtallocate_extent_near()
591 * blocks to go, go there. The 0 case moves to block 1. xfs_rtallocate_extent_near()
623 xfs_buf_t **rbpp, /* in/out: summary block buffer */ xfs_rtallocate_extent_size()
624 xfs_fsblock_t *rsb, /* in/out: summary block number */ xfs_rtallocate_extent_size()
626 xfs_rtblock_t *rtblock) /* out: start block allocated */ xfs_rtallocate_extent_size()
629 int i; /* bitmap block number */ xfs_rtallocate_extent_size()
631 xfs_rtblock_t n; /* next block to be tried */ xfs_rtallocate_extent_size()
632 xfs_rtblock_t r; /* result block number */ xfs_rtallocate_extent_size()
651 * Get the summary for this level/block. xfs_rtallocate_extent_size()
659 * Nothing there, on to the next block. xfs_rtallocate_extent_size()
679 * If the "next block to try" returned from the xfs_rtallocate_extent_size()
680 * allocator is beyond the next bitmap block, xfs_rtallocate_extent_size()
681 * skip to that bitmap block. xfs_rtallocate_extent_size()
706 * starting in that block. xfs_rtallocate_extent_size()
710 * Get the summary information for this level/block. xfs_rtallocate_extent_size()
742 * If the "next block to try" returned from the xfs_rtallocate_extent_size()
743 * allocator is beyond the next bitmap block, xfs_rtallocate_extent_size()
744 * skip to that bitmap block. xfs_rtallocate_extent_size()
767 xfs_fileoff_t bno; /* block number in file */ xfs_growfs_rt_alloc()
770 xfs_daddr_t d; /* disk block address */ xfs_growfs_rt_alloc()
772 xfs_fsblock_t firstblock; /* first block allocated in xaction */ xfs_growfs_rt_alloc()
774 xfs_fsblock_t fsbno; /* filesystem block for bno */ xfs_growfs_rt_alloc()
775 xfs_bmbt_irec_t map; /* block map output */ xfs_growfs_rt_alloc()
776 int nmap; /* number of block maps */ xfs_growfs_rt_alloc()
826 * Do this one block per transaction, to keep it simple. xfs_growfs_rt_alloc()
834 * Reserve log for one block zeroing. xfs_growfs_rt_alloc()
846 * Get a buffer for the block. xfs_growfs_rt_alloc()
889 xfs_rtblock_t bmbno; /* bitmap block number */ xfs_growfs_rt()
904 xfs_fsblock_t sumbno; /* summary block number */ xfs_growfs_rt()
919 * Read in the last block of the device, make sure it exists. xfs_growfs_rt()
947 * Get the old block counts for bitmap and summary inodes. xfs_growfs_rt()
967 * We will do everything one bitmap block at a time. xfs_growfs_rt()
968 * Skip the current block if it is exactly full. xfs_growfs_rt()
1031 * Do this when the real size (not block-aligned) changes. xfs_growfs_rt()
1095 * result block number.
1100 xfs_rtblock_t bno, /* starting block number to allocate */ xfs_rtallocate_extent()
1107 xfs_rtblock_t *rtblock) /* out: start block allocated */ xfs_rtallocate_extent()
1111 xfs_rtblock_t r; /* result allocated block */ xfs_rtallocate_extent()
1112 xfs_fsblock_t sb; /* summary file block number */ xfs_rtallocate_extent()
1113 xfs_buf_t *sumbp; /* summary file block buffer */ xfs_rtallocate_extent()
1136 * Allocate by size, or near another block, or exactly at some block. xfs_rtallocate_extent()
1181 struct xfs_buf *bp; /* buffer for last block of subvolume */ xfs_rtmount_init()
1183 xfs_daddr_t d; /* address of last block of subvolume */ xfs_rtmount_init()
1273 xfs_rtblock_t b; /* result block */ xfs_rtpick_extent()
/linux-4.1.27/drivers/gpu/drm/omapdrm/
H A Domap_dmm_tiler.h38 struct list_head alloc_node; /* node for global block list */
43 /* bits representing the same slot in DMM-TILER hw-block */
47 /* bits reserved to describe coordinates in DMM-TILER hw-block */
91 int tiler_pin(struct tiler_block *block, struct page **pages,
93 int tiler_unpin(struct tiler_block *block);
99 int tiler_release(struct tiler_block *block);
102 dma_addr_t tiler_ssptr(struct tiler_block *block);
103 dma_addr_t tiler_tsptr(struct tiler_block *block, uint32_t orient,
H A Domap_dmm_tiler.c337 int tiler_pin(struct tiler_block *block, struct page **pages, tiler_pin() argument
342 ret = fill(&block->area, pages, npages, roll, wait); tiler_pin()
345 tiler_unpin(block); tiler_pin()
350 int tiler_unpin(struct tiler_block *block) tiler_unpin() argument
352 return fill(&block->area, NULL, 0, 0, false); tiler_unpin()
361 struct tiler_block *block = kzalloc(sizeof(*block), GFP_KERNEL); tiler_reserve_2d() local
377 block->fmt = fmt; tiler_reserve_2d()
379 ret = tcm_reserve_2d(containers[fmt], w, h, align, &block->area); tiler_reserve_2d()
381 kfree(block); tiler_reserve_2d()
387 list_add(&block->alloc_node, &omap_dmm->alloc_head); tiler_reserve_2d()
390 return block; tiler_reserve_2d()
395 struct tiler_block *block = kzalloc(sizeof(*block), GFP_KERNEL); tiler_reserve_1d() local
399 if (!block) tiler_reserve_1d()
402 block->fmt = TILFMT_PAGE; tiler_reserve_1d()
405 &block->area)) { tiler_reserve_1d()
406 kfree(block); tiler_reserve_1d()
411 list_add(&block->alloc_node, &omap_dmm->alloc_head); tiler_reserve_1d()
414 return block; tiler_reserve_1d()
418 int tiler_release(struct tiler_block *block) tiler_release() argument
420 int ret = tcm_free(&block->area); tiler_release()
423 if (block->area.tcm) tiler_release()
424 dev_err(omap_dmm->dev, "failed to release block\n"); tiler_release()
427 list_del(&block->alloc_node); tiler_release()
430 kfree(block); tiler_release()
490 dma_addr_t tiler_ssptr(struct tiler_block *block) tiler_ssptr() argument
492 BUG_ON(!validfmt(block->fmt)); tiler_ssptr()
494 return TILVIEW_8BIT + tiler_get_address(block->fmt, 0, tiler_ssptr()
495 block->area.p0.x * geom[block->fmt].slot_w, tiler_ssptr()
496 block->area.p0.y * geom[block->fmt].slot_h); tiler_ssptr()
499 dma_addr_t tiler_tsptr(struct tiler_block *block, uint32_t orient, tiler_tsptr() argument
502 struct tcm_pt *p = &block->area.p0; tiler_tsptr()
503 BUG_ON(!validfmt(block->fmt)); tiler_tsptr()
505 return tiler_get_address(block->fmt, orient, tiler_tsptr()
506 (p->x * geom[block->fmt].slot_w) + x, tiler_tsptr()
507 (p->y * geom[block->fmt].slot_h) + y); tiler_tsptr()
551 struct tiler_block *block, *_block; omap_dmm_remove() local
558 list_for_each_entry_safe(block, _block, &omap_dmm->alloc_head, omap_dmm_remove()
560 list_del(&block->alloc_node); omap_dmm_remove()
561 kfree(block); omap_dmm_remove()
873 struct tiler_block *block; tiler_map_show() local
911 list_for_each_entry(block, &omap_dmm->alloc_head, alloc_node) { tiler_map_show()
912 if (block->area.tcm == omap_dmm->tcm[lut_idx]) { tiler_map_show()
913 if (block->fmt != TILFMT_PAGE) { tiler_map_show()
914 fill_map(map, xdiv, ydiv, &block->area, tiler_map_show()
921 &block->area); tiler_map_show()
924 ydiv, &block->area.p0) == ' '; tiler_map_show()
926 &block->area.p1) == ' '; tiler_map_show()
928 tcm_for_each_slice(a, block->area, p) tiler_map_show()
932 &block->area.p0, tiler_map_show()
935 &block->area.p1, tiler_map_show()
938 &block->area); tiler_map_show()
/linux-4.1.27/fs/reiserfs/
H A Dbitmap.c4 /* Reiserfs block (de)allocator, bitmap-based. */
18 /* different reiserfs block allocator options */
42 reiserfs_info(s, "block allocator option \"%s\" is set", #optname); \
49 b_blocknr_t block, get_bit_address()
54 * It is in the bitmap block number equal to the block get_bit_address()
55 * number divided by the number of bits in a block. get_bit_address()
57 *bmap_nr = block >> (s->s_blocksize_bits + 3); get_bit_address()
58 /* Within that bitmap block it is located at bit offset *offset. */ get_bit_address()
59 *offset = block & ((s->s_blocksize << 3) - 1); get_bit_address()
62 int is_reusable(struct super_block *s, b_blocknr_t block, int bit_value) is_reusable() argument
67 if (block == 0 || block >= SB_BLOCK_COUNT(s)) { is_reusable()
69 "block number is out of range %lu (%u)", is_reusable()
70 block, SB_BLOCK_COUNT(s)); is_reusable()
74 get_bit_address(s, block, &bmap, &offset); is_reusable()
83 if (block >= bmap1 && is_reusable()
84 block <= bmap1 + bmap_count) { is_reusable()
85 reiserfs_error(s, "vs-4019", "bitmap block %lu(%u) " is_reusable()
87 block, bmap_count); is_reusable()
92 reiserfs_error(s, "vs-4020", "bitmap block %lu(%u) " is_reusable()
94 block, bmap_count); is_reusable()
100 reiserfs_error(s, "vs-4030", "bitmap for requested block " is_reusable()
101 "is out of range: block=%lu, bitmap_nr=%u", is_reusable()
102 block, bmap); is_reusable()
106 if (bit_value == 0 && block == SB_ROOT_BLOCK(s)) { is_reusable()
107 reiserfs_error(s, "vs-4050", "this is root block (%u), " is_reusable()
116 * Searches in journal structures for a given block number (bmap, off).
117 * If block is found in reiserfs journal it suggests next free block
141 * lengths in one bitmap block
180 * search for a zero bit fails or the rest of bitmap block scan_bitmap_block()
251 * Search again in current block scan_bitmap_block()
261 /* free block count calculation */ scan_bitmap_block()
296 * hashes the id and then returns > 0 if the block group for the
305 * If we don't have cached information on this bitmap block, we're block_group_used()
417 struct inode *inode, b_blocknr_t block, _reiserfs_free_block()
432 get_bit_address(s, block, &nr, &offset); _reiserfs_free_block()
435 reiserfs_error(s, "vs-4075", "block %lu is out of range", _reiserfs_free_block()
436 block); _reiserfs_free_block()
446 /* clear bit for the given block in bit map */ _reiserfs_free_block()
449 "block %lu: bit already cleared", block); _reiserfs_free_block()
456 /* update super block */ _reiserfs_free_block()
468 struct inode *inode, b_blocknr_t block, reiserfs_free_block()
474 RFALSE(!s, "vs-4061: trying to free block on nonexistent device"); reiserfs_free_block()
475 if (!is_reusable(s, block, 1)) reiserfs_free_block()
478 if (block > sb_block_count(REISERFS_SB(s)->s_rs)) { reiserfs_free_block()
480 "Trying to free block outside file system " reiserfs_free_block()
482 block, sb_block_count(REISERFS_SB(s)->s_rs)); reiserfs_free_block()
486 journal_mark_freed(th, s, block); reiserfs_free_block()
487 _reiserfs_free_block(th, inode, block, for_unformatted); reiserfs_free_block()
492 struct inode *inode, b_blocknr_t block) reiserfs_free_prealloc_block()
496 "vs-4060: trying to free block on nonexistent device"); reiserfs_free_prealloc_block()
497 if (!is_reusable(th->t_super, block, 1)) reiserfs_free_prealloc_block()
499 _reiserfs_free_block(th, inode, block, 1); reiserfs_free_prealloc_block()
565 /* block allocator related options are parsed here */ reiserfs_parse_alloc_options()
788 * Relocation based on dirid, hashing them into a given bitmap block
806 /* give a portion of the block group to metadata */ dirid_groups()
814 * Relocation based on oid, hashing them into a given bitmap block
944 return hint->block == this_blocknr_allocation_would_make_it_a_large_file()
1064 * Mimic old block allocator behaviour, that is if VFS allowed for determine_search_start()
1067 * block, we start searching from it, assuming that HDD dataflow determine_search_start()
1155 !hint->formatted_node, hint->block); allocate_without_wrapping_disk()
1353 * We have all the block numbers we need from the reiserfs_allocate_blocknrs()
1393 reiserfs_error(sb, "reiserfs-2025", "bitmap block %lu is " reiserfs_cache_bitmap_metadata()
1410 b_blocknr_t block = (sb->s_blocksize << 3) * bitmap; reiserfs_read_bitmap_block() local
1420 block = REISERFS_SB(sb)->s_sbh->b_blocknr + 1 + bitmap; reiserfs_read_bitmap_block()
1422 block = (REISERFS_DISK_OFFSET_IN_BYTES >> sb->s_blocksize_bits) + 1; reiserfs_read_bitmap_block()
1424 bh = sb_bread(sb, block); reiserfs_read_bitmap_block()
1426 reiserfs_warning(sb, "sh-2029: %s: bitmap block (#%u) " reiserfs_read_bitmap_block()
1427 "reading failed", __func__, block); reiserfs_read_bitmap_block()
48 get_bit_address(struct super_block *s, b_blocknr_t block, unsigned int *bmap_nr, unsigned int *offset) get_bit_address() argument
416 _reiserfs_free_block(struct reiserfs_transaction_handle *th, struct inode *inode, b_blocknr_t block, int for_unformatted) _reiserfs_free_block() argument
467 reiserfs_free_block(struct reiserfs_transaction_handle *th, struct inode *inode, b_blocknr_t block, int for_unformatted) reiserfs_free_block() argument
491 reiserfs_free_prealloc_block(struct reiserfs_transaction_handle *th, struct inode *inode, b_blocknr_t block) reiserfs_free_prealloc_block() argument
/linux-4.1.27/include/linux/platform_data/
H A Dgpio-ts5500.h16 * struct ts5500_dio_platform_data - TS-5500 pin block configuration
18 * @strap: The only pin connected to an interrupt in a block is input-only.
/linux-4.1.27/fs/isofs/
H A Dnamei.c41 unsigned long block, f_pos, offset, block_saved, offset_saved; isofs_find_entry() local
50 block = 0; isofs_find_entry()
58 bh = isofs_bread(dir, block); isofs_find_entry()
70 block = f_pos >> bufbits; isofs_find_entry()
85 block++; isofs_find_entry()
89 bh = isofs_bread(dir, block); isofs_find_entry()
102 " in block %lu of inode %lu\n", block, isofs_find_entry()
154 unsigned long uninitialized_var(block); isofs_lookup()
164 &block, &offset, isofs_lookup()
169 inode = found ? isofs_iget(dir->i_sb, block, offset) : NULL; isofs_lookup()
H A Dexport.c20 unsigned long block, isofs_export_iget()
26 if (block == 0) isofs_export_iget()
28 inode = isofs_iget(sb, block, offset); isofs_export_iget()
40 * simply need to find its ".." entry, normalize its block and offset,
73 * the ".." entry is located in the same block. */ isofs_export_get_parent()
76 /* Get the block in question. */ isofs_export_get_parent()
153 u32 block; member in struct:isofs_fid
169 return isofs_export_iget(sb, ifid->block, ifid->offset, isofs_fh_to_dentry()
19 isofs_export_iget(struct super_block *sb, unsigned long block, unsigned long offset, __u32 generation) isofs_export_iget() argument
/linux-4.1.27/arch/s390/include/asm/
H A Dpci_clp.h35 /* request or response block header length */
38 /* Number of function handles fitting in response block */
52 u32 fmt : 4; /* cmd request block format */
62 u32 fmt : 4; /* cmd request block format */
76 u32 fmt : 4; /* cmd request block format */
87 u32 fmt : 4; /* cmd request block format */
111 u32 fmt : 4; /* cmd request block format */
123 u32 fmt : 4; /* cmd request block format */
144 u32 fmt : 4; /* cmd request block format */
157 u32 fmt : 4; /* cmd request block format */
165 /* Combined request/response block structures used by clp insn */
H A Delf.h58 block offset. */
60 block offset. */
62 block offset. */
68 negated static TLS block offset. */
70 negated static TLS block offset. */
72 negated static TLS block offset. */
74 static TLS block. */
76 static TLS block. */
78 block. */
80 block. */
82 #define R_390_TLS_DTPOFF 55 /* Offset in TLS block. */
84 block. */
89 block offset. */
/linux-4.1.27/drivers/mfd/
H A Dpm8921-core.c109 static int pm8xxx_irq_block_handler(struct pm_irq_chip *chip, int block) pm8xxx_irq_block_handler() argument
114 ret = pm8xxx_read_block_irq(chip, block, &bits); pm8xxx_irq_block_handler()
116 pr_err("Failed reading %d block ret=%d", block, ret); pm8xxx_irq_block_handler()
120 pr_err("block bit set in master but no irqs: %d", block); pm8xxx_irq_block_handler()
127 pmirq = block * 8 + i; pm8xxx_irq_block_handler()
153 block_number = master * 8 + i; /* block # */ pm8xxx_irq_master_handler()
189 u8 block, config; pm8xxx_irq_mask_ack() local
191 block = pmirq / 8; pm8xxx_irq_mask_ack()
194 pm8xxx_config_irq(chip, block, config); pm8xxx_irq_mask_ack()
201 u8 block, config; pm8xxx_irq_unmask() local
203 block = pmirq / 8; pm8xxx_irq_unmask()
206 pm8xxx_config_irq(chip, block, config); pm8xxx_irq_unmask()
214 u8 block, config; pm8xxx_irq_set_type() local
216 block = pmirq / 8; pm8xxx_irq_set_type()
236 return pm8xxx_config_irq(chip, block, config); pm8xxx_irq_set_type()
/linux-4.1.27/sound/soc/intel/baytrail/
H A Dsst-baytrail-dsp.c68 struct dma_block_info *block; sst_byt_parse_module() local
81 block = (void *)module + sizeof(*module); sst_byt_parse_module()
85 if (block->size <= 0) { sst_byt_parse_module()
86 dev_err(dsp->dev, "block %d size invalid\n", count); sst_byt_parse_module()
90 switch (block->type) { sst_byt_parse_module()
92 mod->offset = block->ram_offset + sst_byt_parse_module()
97 mod->offset = block->ram_offset + sst_byt_parse_module()
102 mod->offset = block->ram_offset + sst_byt_parse_module()
108 block->type, count); sst_byt_parse_module()
112 mod->size = block->size; sst_byt_parse_module()
113 mod->data = (void *)block + sizeof(*block); sst_byt_parse_module()
117 block = (void *)block + sizeof(*block) + block->size; sst_byt_parse_module()
212 * save the physical address of extended firmware block in the first sst_byt_boot()
/linux-4.1.27/drivers/i2c/
H A Di2c-stub.c74 u8 block[I2C_SMBUS_BLOCK_MAX]; member in struct:smbus_block_data
223 * block transfers stub_xfer()
225 if (data->block[0] > 256 - command) /* Avoid overrun */ stub_xfer()
226 data->block[0] = 256 - command; stub_xfer()
227 len = data->block[0]; stub_xfer()
231 chip->words[command + i] |= data->block[1 + i]; stub_xfer()
234 "i2c block data - addr 0x%02x, wrote %d bytes at 0x%02x.\n", stub_xfer()
238 data->block[1 + i] = stub_xfer()
242 "i2c block data - addr 0x%02x, read %d bytes at 0x%02x.\n", stub_xfer()
252 * banks and SMBus block transfers stub_xfer()
256 len = data->block[0]; stub_xfer()
269 /* Largest write sets read block length */ stub_xfer()
273 b->block[i] = data->block[i + 1]; stub_xfer()
275 chip->words[command] = (b->block[0] << 8) | b->len; stub_xfer()
277 "smbus block data - addr 0x%02x, wrote %d bytes at 0x%02x.\n", stub_xfer()
282 "SMBus block read command without prior block write not supported\n"); stub_xfer()
287 data->block[0] = len; stub_xfer()
289 data->block[i + 1] = b->block[i]; stub_xfer()
291 "smbus block data - addr 0x%02x, read %d bytes at 0x%02x.\n", stub_xfer()
/linux-4.1.27/scripts/mod/
H A Dsumversion.c42 uint32_t block[MD4_BLOCK_WORDS]; member in struct:md4_ctx
156 le32_to_cpu_array(ctx->block, sizeof(ctx->block) / sizeof(uint32_t)); md4_transform_helper()
157 md4_transform(ctx->hash, ctx->block); md4_transform_helper()
172 const uint32_t avail = sizeof(mctx->block) - (mctx->byte_count & 0x3f); md4_update()
177 memcpy((char *)mctx->block + (sizeof(mctx->block) - avail), md4_update()
182 memcpy((char *)mctx->block + (sizeof(mctx->block) - avail), md4_update()
189 while (len >= sizeof(mctx->block)) { md4_update()
190 memcpy(mctx->block, data, sizeof(mctx->block)); md4_update()
192 data += sizeof(mctx->block); md4_update()
193 len -= sizeof(mctx->block); md4_update()
196 memcpy(mctx->block, data, len); md4_update()
202 char *p = (char *)mctx->block + offset; md4_final_ascii()
209 p = (char *)mctx->block; md4_final_ascii()
214 mctx->block[14] = mctx->byte_count << 3; md4_final_ascii()
215 mctx->block[15] = mctx->byte_count >> 29; md4_final_ascii()
216 le32_to_cpu_array(mctx->block, (sizeof(mctx->block) - md4_final_ascii()
218 md4_transform(mctx->hash, mctx->block); md4_final_ascii()
/linux-4.1.27/arch/powerpc/lib/
H A Drheap.c47 rh_block_t *block, *blk; grow() local
57 block = kmalloc(sizeof(rh_block_t) * max_blocks, GFP_ATOMIC); grow()
58 if (block == NULL) grow()
63 /* copy old block area */ grow()
64 memcpy(block, info->block, grow()
67 delta = (char *)block - (char *)info->block; grow()
70 blks = (unsigned long)info->block; grow()
71 blke = (unsigned long)(info->block + info->max_blocks); grow()
73 for (i = 0, blk = block; i < info->max_blocks; i++, blk++) grow()
82 kfree(info->block); grow()
85 info->block = block; grow()
91 blk = block + info->max_blocks - new_blocks; grow()
100 * causes a grow in the block area then all pointers kept to the block
115 /* Next 16 sized block */ assure_empty()
213 /* Grow the before block */ attach_free_block()
219 /* Grow the after block backwards */ attach_free_block()
226 /* Grow the before block, and release the after block */ attach_free_block()
237 /* Find the block immediately before the given one (if any) */ attach_taken_block()
268 info->block = NULL; rh_create()
288 kfree(info->block); rh_destroy()
296 * Initialize in place a remote heap info block. This is needed to support
301 rh_block_t * block) rh_init()
313 info->block = block; rh_init()
323 for (i = 0, blk = block; i < max_blocks; i++, blk++) rh_init()
369 /* Detatch given address range, splits free block if needed. */ rh_detach_region()
397 /* The range must lie entirely inside one free block */ rh_detach_region()
438 /* Allocate a block of memory at the specified alignment. The value returned
480 /* Create block for fragment in the beginning */ rh_alloc_align()
513 /* Allocate a block of memory at the default alignment. The value returned is
523 /* Allocate a block of memory at the given offset, rounded up to the default
554 /* The range must lie entirely inside one free block */ rh_alloc_fixed()
609 * The return value is the size of the deallocated block, or a negative number
618 /* Linear search for block */ rh_free()
633 /* Get size of freed block */ rh_free()
662 /* Linear search for block */ rh_get_stats()
685 /* Linear search for block */ rh_set_owner()
300 rh_init(rh_info_t * info, unsigned int alignment, int max_blocks, rh_block_t * block) rh_init() argument
/linux-4.1.27/arch/s390/include/uapi/asm/
H A Dzcrypt.h89 * The request (or reply) parameter block is organized thus:
91 * VUD block
92 * key block
102 unsigned int rpl_msgbl; /* reply message block length */
103 unsigned int rpld_parml; /* replied parameter block len */
104 unsigned int rpl_datal; /* reply data block len */
105 unsigned int rpld_datal; /* replied data block len */
106 unsigned int req_extbl; /* request extension block len */
108 unsigned int rpld_extbl; /* replied extension block len */
110 unsigned char * req_parmb; /* request parm block 'address' */
112 unsigned char * req_datab; /* request data block 'address' */
114 unsigned char * rpl_parmb; /* reply parm block 'address' */
116 unsigned char * rpl_datab; /* reply data block 'address' */
118 unsigned char * req_extb; /* request extension block 'addr'*/
120 unsigned char * rpl_extb; /* reply extension block 'address'*/
159 * struct ep11_cprb - EP11 connectivity programming request block
197 * struct ep11_urb - EP11 user request block
203 * @req: Addr to request block
205 * @resp: Addr to response block
234 * block
242 * block
/linux-4.1.27/fs/ext4/
H A Dext4_extents.h64 * covers all valid ext4 block sizes. Therefore, this tail structure can be
65 * crammed into the end of the block without having to rebalance the tree.
76 __le32 ee_block; /* first logical block extent covers */
78 __le16 ee_start_hi; /* high 16 bits of physical block */
79 __le32 ee_start_lo; /* low 32 bits of physical block */
87 __le32 ei_block; /* index covers logical blocks from 'block' */
88 __le32 ei_leaf_lo; /* pointer to the physical block of the next *
90 __le16 ei_leaf_hi; /* high 16 bits of physical block */
95 * Each block (leaves and indexes), even inode-stored has header.
218 * combine low and high parts of physical block number into ext4_fsblk_t
222 ext4_fsblk_t block; ext4_ext_pblock() local
224 block = le32_to_cpu(ex->ee_start_lo); ext4_ext_pblock()
225 block |= ((ext4_fsblk_t) le16_to_cpu(ex->ee_start_hi) << 31) << 1; ext4_ext_pblock()
226 return block; ext4_ext_pblock()
231 * combine low and high parts of a leaf physical block number into ext4_fsblk_t
235 ext4_fsblk_t block; ext4_idx_pblock() local
237 block = le32_to_cpu(ix->ei_leaf_lo); ext4_idx_pblock()
238 block |= ((ext4_fsblk_t) le16_to_cpu(ix->ei_leaf_hi) << 31) << 1; ext4_idx_pblock()
239 return block; ext4_idx_pblock()
244 * stores a large physical block number into an extent struct,
257 * stores a large physical block number into an index struct,
H A Dballoc.c9 * Enhanced block allocation by Stephen Tweedie (sct@redhat.com), 1993
32 * Calculate block group number for a given block number
35 ext4_fsblk_t block) ext4_get_group_number()
40 group = (block - ext4_get_group_number()
44 ext4_get_group_no_and_offset(sb, block, &group, NULL); ext4_get_group_number()
49 * Calculate the block group number and offset into the block/cluster
50 * allocation bitmap, given a block number
69 * Check whether the 'block' lives within the 'block_group'. Returns 1 if so
73 ext4_fsblk_t block, ext4_block_in_group()
78 actual_group = ext4_get_group_number(sb, block); ext4_block_in_group()
96 * block group descriptors, and reserved block group ext4_num_overhead_clusters()
102 * to check to see if the block is in the block group. If it ext4_num_overhead_clusters()
106 * that block. Otherwise, we will have to track the cluster ext4_num_overhead_clusters()
177 /* Initializes an uninitialized block bitmap */ ext4_init_block_bitmap()
219 /* Set bits for block and inode bitmaps, and inode table */ ext4_init_block_bitmap()
238 * of the block bitmap to 1 ext4_init_block_bitmap()
247 /* Return the number of free blocks in a block group. It is used when
248 * the block bitmap is uninitialized, so we can't just count the bits
260 * blocks groups. Each group contains 1 bitmap block for blocks, 1 bitmap
261 * block for inodes, N blocks for the inode table and data blocks.
264 * super block. Each descriptor contains the number of the bitmap block and
265 * the free blocks count in the block. The descriptors are loaded in memory
271 * @sb: super block
272 * @block_group: given block group
273 * @bh: pointer to the buffer head to store the block
311 * Return the block number which was discovered to be invalid, or 0 if
312 * the block bitmap is valid.
326 /* with FLEX_BG, the inode/block bitmaps and itable ext4_valid_block_bitmap()
329 * or it has to also read the block group where the bitmaps ext4_valid_block_bitmap()
336 /* check whether block bitmap block number is set */ ext4_valid_block_bitmap()
340 /* bad block bitmap */ ext4_valid_block_bitmap()
343 /* check whether the inode bitmap block number is set */ ext4_valid_block_bitmap()
347 /* bad block bitmap */ ext4_valid_block_bitmap()
350 /* check whether the inode table block number is set */ ext4_valid_block_bitmap()
379 ext4_error(sb, "bg %u: block %llu: invalid block bitmap", ext4_validate_block_bitmap()
390 ext4_error(sb, "bg %u: bad block bitmap checksum", block_group); ext4_validate_block_bitmap()
403 * @sb: super block
404 * @block_group: given block group
407 * bits for block/inode/inode tables are set in the bitmaps
424 ext4_error(sb, "Cannot get buffer for block bitmap - " ext4_read_block_bitmap_nowait()
491 ext4_error(sb, "Cannot read block bitmap - " ext4_wait_block_bitmap()
497 /* Panic or remount fs read-only if block bitmap is invalid */ ext4_wait_block_bitmap()
520 * @sbi: in-core super block structure.
587 * @sb: super block
610 * ext4_new_meta_blocks() -- allocate block for meta data (indexing) blocks
614 * @goal: given target block(filesystem wide)
618 * Return 1st allocated block number on success, *count stores total account
653 * Adds up the number of free clusters from each block group.
810 * the beginning of a block group, including the reserved gdt blocks.
834 * ext4_inode_to_goal_block - return a hint for block allocation
835 * @inode: inode for block allocation
853 * block groups per flexgroup, reserve the first block ext4_inode_to_goal_block()
855 * files will start at the second block group. This ext4_inode_to_goal_block()
34 ext4_get_group_number(struct super_block *sb, ext4_fsblk_t block) ext4_get_group_number() argument
72 ext4_block_in_group(struct super_block *sb, ext4_fsblk_t block, ext4_group_t block_group) ext4_block_in_group() argument
H A Dextents_status.h60 ext4_lblk_t es_lblk; /* first logical block extent covers */
61 ext4_lblk_t es_len; /* length of extent in block */
62 ext4_fsblk_t es_pblk; /* first physical block */
151 ext4_fsblk_t block; ext4_es_store_pblock() local
153 block = (pb & ~ES_MASK) | (es->es_pblk & ES_MASK); ext4_es_store_pblock()
154 es->es_pblk = block; ext4_es_store_pblock()
H A Dindirect.c19 * Goal-directed block allocation by Stephen Tweedie
42 * ext4_block_to_path - parse the block number into array of offsets
44 * @i_block: block number to be parsed
46 * @boundary: set this non-zero if the referred-to block is likely to be
47 * followed (on disk) by an indirect block.
52 * This function translates the block number into path in that tree -
54 * pointer to (n+1)th node in the nth one. If @block is out of range
64 * indirect block) is spelled differently, because otherwise on an
103 ext4_warning(inode->i_sb, "block %lu > max in inode %lu", ext4_block_to_path()
123 * the number of (i+1)-th block in the chain (as it is stored in memory,
127 * block for i>0 and NULL for i==0. In other words, it holds the block
132 * Function stops when it stumbles upon zero pointer (absent block)
134 * or when it gets an IO error reading an indirect block
168 /* validate block references */ ext4_get_branch()
191 * @ind: descriptor of indirect block.
193 * This function returns the preferred place for block allocation.
196 * + if there is a block to the left of our position - allocate near it.
197 * + if pointer will live in indirect block - allocate near that block.
201 * In the latter case we colour the starting block by the callers PID to
203 * in the same block group. The PID is used here so that functionally related
214 /* Try to find previous block */ ext4_find_near()
220 /* No such thing, so let's try location of indirect block */ ext4_find_near()
234 * @block: block we want
237 * Normally this function find the preferred place for block allocation,
239 * Because this is only used for non-extent files, we limit the block nr
242 static ext4_fsblk_t ext4_find_goal(struct inode *inode, ext4_lblk_t block, ext4_find_goal() argument
248 * XXX need to get goal block from mballoc's data structures ext4_find_goal()
257 * ext4_blks_to_allocate - Look up the block map and count the number
263 * @blocks_to_boundary: the offset in the indirect block
274 * Simple case, [t,d]Indirect block(s) has not allocated yet ext4_blks_to_allocate()
384 * buffer at branch[0].bh is indirect block / inode already ext4_alloc_branch()
400 * @block: (logical) number of block we are adding
409 * chain to new block and return 0.
420 * If we're splicing into a [td]indirect block (as opposed to the ext4_splice_branch()
421 * inode) then we need to get write access to the [td]indirect block ext4_splice_branch()
445 /* had we spliced it onto indirect block? */ ext4_splice_branch()
448 * If we spliced it onto an indirect block, we haven't ext4_splice_branch()
450 * onto an indirect block at the very end of the file (the ext4_splice_branch()
462 * OK, we spliced it into the inode itself on a direct block. ext4_splice_branch()
473 * need to revoke the block, which is why we don't ext4_splice_branch()
496 * write on the parent block.
539 /* Simplest case - block found, no allocation needed */ ext4_ind_map_blocks()
557 /* Next simple case - plain lookup or failed read of indirect block */ ext4_ind_map_blocks()
562 * Okay, we need to do block allocation. ext4_ind_map_blocks()
571 /* Set up for the direct block allocation */ ext4_ind_map_blocks()
763 * to allocate a new block at @lblocks for non extent file based file
796 * 2 dindirect blocks, and 1 tindirect block ext4_ind_trans_blocks()
851 * data block, indeed). We have to free the top of that path along
859 * block number of its root in *@top, pointers to buffer_heads of
897 * OK, we've found the last block that must survive. The rest of our ext4_find_shared()
922 * Zero a number of block pointers in either an inode or an indirect block.
924 * indirect block for further modification.
929 * Return 0 on success, 1 on invalid block range
992 * @first: array of block numbers
1004 * block pointers.
1010 ext4_fsblk_t block_to_free = 0; /* Starting block # of a run */ ext4_free_data()
1015 ext4_fsblk_t nr; /* Current block # */ ext4_free_data()
1017 for current block */ ext4_free_data()
1020 if (this_bh) { /* For indirect block */ ext4_free_data()
1065 * block pointed to itself, it would have been detached when ext4_free_data()
1066 * the block was cleared. Check for this instead of OOPSing. ext4_free_data()
1072 "circular indirect block detected at " ext4_free_data()
1073 "block %llu", ext4_free_data()
1083 * @first: array of block numbers
1114 "block %lu (level %d)", ext4_free_branches()
1132 /* This zaps the entire block. Bottom up. */ ext4_free_branches()
1144 * We want the freeing of this indirect block to be ext4_free_branches()
1146 * bitmap block which owns it. So make some room in ext4_free_branches()
1153 * will merely complain about releasing a free block, ext4_free_branches()
1170 * indirect block if it gets reallocated as a ext4_free_branches()
1171 * data block. This must happen in the same ext4_free_branches()
1181 * The block which we have just freed is ext4_free_branches()
1182 * pointed to by an indirect block: journal it ext4_free_branches()
1241 * equal to the indirect block limit. ext4_ind_truncate()
1263 /* Shared branch grows from an indirect block */ ext4_ind_truncate()
1309 * @start: First block to remove
1310 * @end: One block after the last block to remove (exclusive)
1342 /* We're punching only within direct block range */ ext4_ind_remove_space()
1349 * free partial block at start, and partial block at end of ext4_ind_remove_space()
1356 * Start is at the direct block level, free ext4_ind_remove_space()
1373 /* Shared branch grows from an indirect block */ ext4_ind_remove_space()
1458 /* Shared branch grows from an indirect block */ ext4_ind_remove_space()
1485 * We've converged on the same block. Clear the range, ext4_ind_remove_space()
1504 * block. ext4_ind_remove_space()
/linux-4.1.27/drivers/ipack/devices/
H A Dscc2698.h30 u8 junk[8]; /* other crap for block control */
37 u8 junk[8]; /* other crap for block control */
44 * The scc2698 contain 4 block.
45 * Each block containt two channel a and b.
55 u8 d4, ipcr; /* Input port change register of block */
56 u8 d5, isr; /* Interrupt status register of block */
57 u8 d6, ctur; /* Counter timer upper register of block */
58 u8 d7, ctlr; /* Counter timer lower register of block */
64 u8 dd, ip; /* Input port register of block */
65 u8 de, ctg; /* Start counter timer of block */
66 u8 df, cts; /* Stop counter timer of block */
73 u8 d4, acr; /* Auxiliary control register of block */
74 u8 d5, imr; /* Interrupt mask register of block */
75 u8 d6, ctu; /* Counter timer upper register of block */
76 u8 d7, ctl; /* Counter timer lower register of block */
82 u8 dd, opcr; /* Output port configuration register of block */
/linux-4.1.27/drivers/isdn/hardware/eicon/
H A Ddfifo.h45 byte[1] -> length of data in block
49 #define DIVA_DFIFO_WRAP 0x80 /* This is the last block in fifo */
50 #define DIVA_DFIFO_READY 0x40 /* This block is ready for processing */
51 #define DIVA_DFIFO_LAST 0x20 /* This block is last in message */
/linux-4.1.27/drivers/s390/cio/
H A Dorb.h15 * Command-mode operation request block
31 u32 i2k:1; /* IDAW 2/4kB block size control */
40 * Transport-mode operation request block
63 * eadm operation request block
/linux-4.1.27/drivers/base/regmap/
H A Dregcache-lzo.c174 /* alloc the working space for the compressed block */ regcache_lzo_init()
242 /* index of the compressed lzo block */ regcache_lzo_read()
244 /* register index within the decompressed block */ regcache_lzo_read()
246 /* size of the compressed block */ regcache_lzo_read()
251 /* save the pointer and length of the compressed block */ regcache_lzo_read()
255 /* prepare the source to be the compressed block */ regcache_lzo_read()
259 /* decompress the block */ regcache_lzo_read()
266 /* restore the pointer and length of the compressed block */ regcache_lzo_read()
281 /* index of the compressed lzo block */ regcache_lzo_write()
283 /* register index within the decompressed block */ regcache_lzo_write()
285 /* size of the compressed block */ regcache_lzo_write()
290 /* save the pointer and length of the compressed block */ regcache_lzo_write()
294 /* prepare the source to be the compressed block */ regcache_lzo_write()
298 /* decompress the block */ regcache_lzo_write()
311 /* prepare the source to be the decompressed block */ regcache_lzo_write()
315 /* compress the block */ regcache_lzo_write()
/linux-4.1.27/arch/cris/boot/rescue/
H A Dtestrescue.S2 * Simple testcode to download by the rescue block.
/linux-4.1.27/arch/m68k/include/asm/
H A Dpci.h8 * address space. The networking and block device layers use
/linux-4.1.27/include/linux/amba/
H A Dmmci.h11 * (also known as PL180) block.
12 * @ocr_mask: available voltages on the 4 pins from the block, this
19 * block. May also control external power based on the power_mode.
20 * @status: if no GPIO read function was given to the block in
/linux-4.1.27/drivers/gpu/drm/udl/
H A Dudl_connector.c24 u8 *block; udl_get_edid() local
28 block = kmalloc(EDID_LENGTH, GFP_KERNEL); udl_get_edid()
29 if (block == NULL) udl_get_edid()
45 block[i] = rbuf[1]; udl_get_edid()
49 return block; udl_get_edid()
52 kfree(block); udl_get_edid()
70 * We only read the main block, but if the monitor reports extension udl_get_modes()
/linux-4.1.27/fs/hfs/
H A Dextent.c21 static void hfs_ext_build_key(hfs_btree_key *key, u32 cnid, u16 block, u8 type) hfs_ext_build_key() argument
26 key->ext.FABN = cpu_to_be16(block); hfs_ext_build_key()
37 * and the allocation block number field is the least significant
72 * Find a block within an extent record
82 return be16_to_cpu(ext->block) + off; hfs_ext_find_block()
107 return be16_to_cpu(ext->block) + be16_to_cpu(ext->count); hfs_ext_lastblock()
147 u32 cnid, u32 block, u8 type) __hfs_ext_read_extent()
151 hfs_ext_build_key(fd->search_key, cnid, block, type); __hfs_ext_read_extent()
165 static inline int __hfs_ext_cache_extent(struct hfs_find_data *fd, struct inode *inode, u32 block) __hfs_ext_cache_extent() argument
176 block, HFS_IS_RSRC(inode) ? HFS_FK_RSRC : HFS_FK_DATA); __hfs_ext_cache_extent()
187 static int hfs_ext_read_extent(struct inode *inode, u16 block) hfs_ext_read_extent() argument
192 if (block >= HFS_I(inode)->cached_start && hfs_ext_read_extent()
193 block < HFS_I(inode)->cached_start + HFS_I(inode)->cached_blocks) hfs_ext_read_extent()
198 res = __hfs_ext_cache_extent(&fd, inode, block); hfs_ext_read_extent()
211 be16_to_cpu(extent[i].block), hfs_dump_extent()
226 start = be16_to_cpu(extent->block); hfs_add_extent()
231 extent->block = cpu_to_be16(alloc_block); hfs_add_extent()
263 start = be16_to_cpu(extent->block); hfs_free_extents()
266 extent->block = 0; hfs_free_extents()
332 int hfs_get_block(struct inode *inode, sector_t block, hfs_get_block() argument
340 /* Convert inode block to disk allocation block */ hfs_get_block()
341 ablock = (u32)block / HFS_SB(sb)->fs_div; hfs_get_block()
343 if (block >= HFS_I(inode)->fs_blocks) { hfs_get_block()
344 if (block > HFS_I(inode)->fs_blocks || !create) hfs_get_block()
373 (u32)block % HFS_SB(sb)->fs_div); hfs_get_block()
413 HFS_I(inode)->first_extents[0].block = cpu_to_be16(start); hfs_extend_file()
459 HFS_I(inode)->cached_extents[0].block = cpu_to_be16(start); hfs_extend_file()
146 __hfs_ext_read_extent(struct hfs_find_data *fd, struct hfs_extent *extent, u32 cnid, u32 block, u8 type) __hfs_ext_read_extent() argument
H A Dpart_tbl.c17 * For each partition on the media there is a physical block (512-byte
18 * block) containing one of these structures. These blocks are
19 * contiguous starting at block 1.
25 __be32 pmPyPartStart; /* physical block start of partition */
26 __be32 pmPartBlkCnt; /* physical block count of partition */
/linux-4.1.27/arch/powerpc/crypto/
H A Dmd5-glue.c60 memcpy((char *)sctx->block + offset, src, len); ppc_md5_update()
65 memcpy((char *)sctx->block + offset, src, avail); ppc_md5_update()
66 ppc_md5_transform(sctx->hash, (const u8 *)sctx->block, 1); ppc_md5_update()
77 memcpy((char *)sctx->block, src, len); ppc_md5_update()
85 const u8 *src = (const u8 *)sctx->block; ppc_md5_final()
88 __le64 *pbits = (__le64 *)((char *)sctx->block + 56); ppc_md5_final()
96 p = (char *)sctx->block; ppc_md5_final()
/linux-4.1.27/include/sound/
H A Dutil_mem.h26 * memory block
29 unsigned int size; /* size of this block */
30 unsigned int offset; /* zero-offset of this block */
41 struct list_head block; /* block linked-list header */ member in struct:snd_util_memhdr
/linux-4.1.27/arch/arm/mach-omap2/
H A Dmsdi.c2 * MSDI IP block reset
37 * MSDI_CON_OFFSET: offset in bytes of the MSDI IP block's CON register
38 * from the IP block's base address
51 * omap_msdi_reset - reset the MSDI IP block
54 * The MSDI IP block on OMAP2420 has to have both the POW and CLKD
/linux-4.1.27/arch/x86/kernel/cpu/mcheck/
H A Dmce_amd.c123 "for bank %d, block %d (MSR%08X=0x%x%08x)\n", b->cpu, lvt_off_valid()
124 b->bank, b->block, b->address, hi, lo); lvt_off_valid()
130 "for bank %d, block %d (MSR%08X=0x%x%08x)\n", lvt_off_valid()
131 b->cpu, apic, b->bank, b->block, b->address, hi, lo); lvt_off_valid()
214 unsigned int bank, block; mce_amd_feature_init() local
218 for (block = 0; block < NR_BLOCKS; ++block) { mce_amd_feature_init()
219 if (block == 0) mce_amd_feature_init()
221 else if (block == 1) { mce_amd_feature_init()
240 if (!block) mce_amd_feature_init()
246 b.block = block; mce_amd_feature_init()
280 unsigned int bank, block; amd_threshold_interrupt() local
287 for (block = 0; block < NR_BLOCKS; ++block) { amd_threshold_interrupt()
288 if (block == 0) { amd_threshold_interrupt()
290 } else if (block == 1) { amd_threshold_interrupt()
303 if (block) amd_threshold_interrupt()
468 unsigned int block, u32 address) allocate_threshold_blocks()
474 if ((bank >= mca_cfg.banks) || (block >= NR_BLOCKS)) allocate_threshold_blocks()
481 if (block) allocate_threshold_blocks()
495 b->block = block; allocate_threshold_blocks()
525 if (!block) { allocate_threshold_blocks()
534 err = allocate_threshold_blocks(cpu, bank, ++block, address); allocate_threshold_blocks()
467 allocate_threshold_blocks(unsigned int cpu, unsigned int bank, unsigned int block, u32 address) allocate_threshold_blocks() argument
/linux-4.1.27/fs/hfsplus/
H A Dpart_tbl.c21 #define HFS_DD_BLK 0 /* Driver Descriptor block */
22 #define HFS_PMAP_BLK 1 /* First block of partition map */
29 #define HFS_SUPER_MAGIC 0x4244 /* "BD": HFS MDB (super block) */
30 #define HFS_MFS_SUPER_MAGIC 0xD2D7 /* MFS MDB (super block) */
35 * For each partition on the media there is a physical block (512-byte
36 * block) containing one of these structures. These blocks are
37 * contiguous starting at block 1.
43 __be32 pmPyPartStart; /* physical block start of partition */
44 __be32 pmPartBlkCnt; /* physical block count of partition */
/linux-4.1.27/arch/arm64/kernel/
H A Dsetup.c239 u64 features, block; setup_processor() local
269 block = (features >> 4) & 0xf; setup_processor()
270 if (!(block & 0x8)) { setup_processor()
271 switch (block) { setup_processor()
282 block = (features >> 8) & 0xf; setup_processor()
283 if (block && !(block & 0x8)) setup_processor()
286 block = (features >> 12) & 0xf; setup_processor()
287 if (block && !(block & 0x8)) setup_processor()
290 block = (features >> 16) & 0xf; setup_processor()
291 if (block && !(block & 0x8)) setup_processor()
300 block = (features >> 4) & 0xf; setup_processor()
301 if (!(block & 0x8)) { setup_processor()
302 switch (block) { setup_processor()
313 block = (features >> 8) & 0xf; setup_processor()
314 if (block && !(block & 0x8)) setup_processor()
317 block = (features >> 12) & 0xf; setup_processor()
318 if (block && !(block & 0x8)) setup_processor()
321 block = (features >> 16) & 0xf; setup_processor()
322 if (block && !(block & 0x8)) setup_processor()
/linux-4.1.27/fs/ocfs2/
H A Docfs2_fs.h137 * s_tunefs_flags on the super block describes precisely which
171 /* Discontigous block groups */
209 /* The byte offset of the first backup block will be 1G.
231 #define OCFS2_SUPER_BLOCK_FL (0x00000020) /* Super block */
248 #define OCFS2_INLINE_DATA_FL (0x0001) /* Data stored in inode block */
543 * On disk extent block (indirect block) for OCFS2
552 block group */
553 __le32 h_fs_generation; /* Must match super block */
555 /*20*/ __le64 h_suballoc_loc; /* Suballocator block group this
558 discontiguous block group */
563 /* Actual on-disk size is one block */
574 * Actual on-disk size is one block. OCFS2_MAX_SLOTS is 255,
575 * 255 * sizeof(__le16) == 512B, within the 512B block minimum blocksize.
708 block group */
724 block */
735 /*88*/ __le64 i_dx_root; /* Pointer to dir index root block */
737 __le64 i_suballoc_loc; /* Suballocator block group this
740 discontiguous block group */
774 /* Actual on-disk size is one block */
792 * Per-block record for the unindexed directory btree. This is carefully
808 * in this block. (unused) */
811 __le64 db_free_next; /* Next block in list (unused) */
830 * block in cluster */
831 __le64 dx_dirent_blk; /* Physical block in unindexed
849 * A directory indexing block. Each indexed directory has one of these,
852 * This block stores an indexed btree root, and a set of free space
859 * block belongs to. */
861 * block group */
862 __le32 dr_fs_generation; /* Must match super block */
865 * extent block */
877 * unindexed block list. */
878 __le64 dr_suballoc_loc; /* Suballocator block group
882 block group */
888 struct ocfs2_dx_entry_list dr_entries; /* In-root-block list of
896 * The header of a leaf block in the indexed tree.
902 __le32 dl_fs_generation;/* Must match super block */
909 * Largest bitmap for a block (suballocator) group in bytes. This limit
911 * bitmaps run to the end of the block.
942 * The extents of a discontigous block group are
946 * bg_list->l_next_free_rec. Only block groups
948 * We've never made a block group with more than
951 * bg_size of a discontiguous block group will
958 /* Actual on-disk size is one block */
984 __le16 rf_suballoc_slot; /* Slot suballocator this block
987 block group */
990 __le64 rf_parent; /* Parent block, only valid if
994 __le64 rf_last_eb_blk; /* Pointer to last extent block */
1003 __le64 rf_suballoc_loc; /* Suballocator block group this
1004 refcount block belongs to. Only
1006 discontiguous block group */
1016 /* Actual on-disk size is one block */
1026 * Note that it can be stored in inode, one block or one xattr bucket.
1031 local xattr storage(inode, xattr block or
1061 buckets. A block uses
1076 __le64 xr_last_eb_blk; /* Pointer to last extent block */
1089 __le64 xt_last_eb_blk; /* Pointer to last extent block */
1104 * On disk structure for xattr block.
1109 block belongs to. */
1111 block group */
1112 __le32 xb_fs_generation; /* Must match super block */
1115 /*20*/ __le16 xb_flags; /* Indicates whether this block contains
1119 __le64 xb_suballoc_loc; /* Suballocator block group this
1120 xattr block belongs to. Only
1122 discontiguous block group */
1125 block contains xattr */
1127 block cotains xattr
1174 /* Each block of each quota file has a certain fixed number of bytes reserved
1195 /*10*/ __le32 dqi_free_blk; /* First free block in quota file */
1196 __le32 dqi_free_entry; /* First block with free dquot entry in quota
1263 * The quota trailer lives at the end of each quota block.
1407 * The cluster allocator uses the entire block. Suballocators have ocfs2_group_bitmap_size()
1555 * The cluster allocator uses the entire block. Suballocators have ocfs2_group_bitmap_size()
/linux-4.1.27/fs/qnx4/
H A Dnamei.c59 unsigned long block, offset, blkofs; qnx4_find_entry() local
64 block = offset = blkofs = 0; qnx4_find_entry()
67 block = qnx4_block_map(dir, blkofs); qnx4_find_entry()
68 if (block) qnx4_find_entry()
69 bh = sb_bread(dir->i_sb, block); qnx4_find_entry()
77 *ino = block * QNX4_INODES_PER_BLOCK + qnx4_find_entry()
H A Dinode.c62 // logical block is before EOF qnx4_get_block()
86 u32 block = try_extent(&qnx4_inode->di_first_xtnt, &offset); qnx4_block_map() local
88 if (block) { qnx4_block_map()
96 // read next xtnt block. qnx4_block_map()
99 QNX4DEBUG((KERN_ERR "qnx4: I/O error reading xtnt block [%ld])\n", i_xblk - 1)); qnx4_block_map()
104 QNX4DEBUG((KERN_ERR "qnx4: block at %ld is not a valid xtnt\n", qnx4_inode->i_xblk)); qnx4_block_map()
108 block = try_extent(&xblk->xblk_xtnts[ix], &offset); qnx4_block_map()
109 if (block) { qnx4_block_map()
124 QNX4DEBUG((KERN_INFO "qnx4: mapping block %ld of inode %ld = %ld\n",iblock,inode->i_ino,block)); qnx4_block_map()
125 return block; qnx4_block_map()
164 bh = sb_bread(sb, rd + j); /* root dir, first block */ qnx4_checkroot()
251 static sector_t qnx4_bmap(struct address_space *mapping, sector_t block) qnx4_bmap() argument
253 return generic_block_bmap(mapping,block,qnx4_get_block); qnx4_bmap()
264 int block; qnx4_iget() local
285 block = ino / QNX4_INODES_PER_BLOCK; qnx4_iget()
287 if (!(bh = sb_bread(sb, block))) { qnx4_iget()
/linux-4.1.27/fs/gfs2/
H A Drgrp.c53 * to keep track of block allocation. Each block is represented by two
84 * @new_state: the new state of the block
127 * Returns: The two bit block state of the requested bit
177 * rs_cmp - multi-block reservation range compare
178 * @blk: absolute file system block number of the new reservation
182 * returns: 1 if the block range is beyond the reach of the reservation
183 * -1 if the block range is before the start of the reservation
184 * 0 if the block range overlaps with the reservation
199 * a block in a given allocation state.
202 * @goal: start search at this block's bit-pair (within @buffer)
203 * @state: GFS2_BLKST_XXX the state of the block we're looking for.
205 * Scope of @goal and returned block number is only within this bitmap buffer,
207 * beginning of a bitmap block buffer, skipping any header structures, but
213 * of the block in case the end is no aligned to a natural boundary.
215 * Return: the block number (bitmap buffer scope) that was found
249 * gfs2_rbm_from_block - Set the rbm based upon rgd and block number
251 * @block: The block number (filesystem relative)
254 * resource group and a filesystem relative block number. The
261 static int gfs2_rbm_from_block(struct gfs2_rbm *rbm, u64 block) gfs2_rbm_from_block() argument
263 u64 rblock = block - rbm->rgd->rd_data0; gfs2_rbm_from_block()
267 if (block >= rbm->rgd->rd_data0 + rbm->rgd->rd_data) gfs2_rbm_from_block()
272 /* Check if the block is within the first block */ gfs2_rbm_from_block()
289 * viable block offset.
314 * @len: Decremented for each block found (terminate on zero)
316 * Returns: true if a non-free block is encountered
343 * Starting at the block specified by the rbm, see how many free blocks
346 * on a block by block basis in case of unaligned blocks. Also this
361 u64 block; gfs2_free_extlen() local
385 block = gfs2_rbm_to_block(&rbm); gfs2_free_extlen()
386 if (gfs2_rbm_from_block(&rbm, block + chunk_size)) { gfs2_free_extlen()
409 * @state: the state of the block we're looking for
487 static inline int rgrp_contains_block(struct gfs2_rgrpd *rgd, u64 block) rgrp_contains_block() argument
491 return first <= block && block < last; rgrp_contains_block()
495 * gfs2_blk2rgrpd - Find resource group for a given data/meta block number
497 * @blk: The data block number
631 * __rs_deltree - remove a multi-block reservation from the rgd tree
664 * gfs2_rs_deltree - remove a multi-block reservation from the rgd tree
681 * gfs2_rs_delete - delete a multi-block reservation
759 * Calculates bitmap descriptors, one for each block that contains bitmap data
785 /* small rgrp; bitmap stored completely in header block */ compute_bitstructs()
792 /* header block */ compute_bitstructs()
799 /* last block */ compute_bitstructs()
1435 * rs_insert - insert a new multi-block reservation into the rgrp's rb_tree
1505 /* Find bitmap block that contains bits for goal block */ rg_mblk_search()
1527 * gfs2_next_unreserved_block - Return next block that is not reserved
1529 * @block: The starting block
1533 * If the block does not appear in any reservation, then return the
1534 * block number unchanged. If it does appear in the reservation, then
1536 * first block number which is not reserved.
1539 static u64 gfs2_next_unreserved_block(struct gfs2_rgrpd *rgd, u64 block, gfs2_next_unreserved_block() argument
1551 rc = rs_cmp(block, length, rs); gfs2_next_unreserved_block()
1561 while ((rs_cmp(block, length, rs) == 0) && (ip->i_res != rs)) { gfs2_next_unreserved_block()
1562 block = gfs2_rbm_to_block(&rs->rs_rbm) + rs->rs_free; gfs2_next_unreserved_block()
1571 return block; gfs2_next_unreserved_block()
1575 * gfs2_reservation_check_and_update - Check for reservations during block alloc
1582 * a reservation covering this block. If not then this function is a
1585 * non-reserved block.
1595 u64 block = gfs2_rbm_to_block(rbm); gfs2_reservation_check_and_update() local
1614 nblock = gfs2_next_unreserved_block(rbm->rgd, block, extlen, ip); gfs2_reservation_check_and_update()
1615 if (nblock == block) { gfs2_reservation_check_and_update()
1624 nblock = block + extlen; gfs2_reservation_check_and_update()
1636 * @minext: Pointer to the requested extent length (NULL for a single block)
1647 * has come up short on a free block search.
1649 * Returns: 0 on success, -ENOSPC if there is no block of the requested state
1757 * @last_unlinked: block address of the last dinode we unlinked
1758 * @skip: block address we should explicitly not unlink
1766 u64 block; try_rgrp_unlink() local
1784 block = gfs2_rbm_to_block(&rbm); try_rgrp_unlink()
1785 if (gfs2_rbm_from_block(&rbm, block + 1)) try_rgrp_unlink()
1787 if (*last_unlinked != NO_BLOCK && block <= *last_unlinked) try_rgrp_unlink()
1789 if (block == skip) try_rgrp_unlink()
1791 *last_unlinked = block; try_rgrp_unlink()
1793 error = gfs2_glock_get(sdp, block, &gfs2_inode_glops, CREATE, &gl); try_rgrp_unlink()
1886 * @rs: The block reservation with the rgrp to test
2100 * gfs2_get_block_type - Check a block in a RG is of given type
2101 * @rgd: the resource group holding the block
2102 * @block: the block number
2104 * Returns: The block type (GFS2_BLKST_*)
2107 static unsigned char gfs2_get_block_type(struct gfs2_rgrpd *rgd, u64 block) gfs2_get_block_type() argument
2112 ret = gfs2_rbm_from_block(&rbm, block); gfs2_get_block_type()
2122 * @dinode: TRUE if the first block we allocate is for a dinode
2126 * Set the found bits to @new_state to change block's allocation state.
2133 u64 block; gfs2_alloc_extent() local
2137 block = gfs2_rbm_to_block(rbm); gfs2_alloc_extent()
2140 block++; gfs2_alloc_extent()
2142 ret = gfs2_rbm_from_block(&pos, block); gfs2_alloc_extent()
2148 block++; gfs2_alloc_extent()
2153 * rgblk_free - Change alloc state of given block(s)
2156 * @blen: the length of the block run (all must lie within ONE RG!)
2157 * @new_state: GFS2_BLKST_XXX the after-allocation block state
2159 * Returns: Resource group containing the block(s)
2171 fs_err(sdp, "block = %llu\n", (unsigned long long)bstart); rgblk_free()
2250 u64 block; gfs2_adjust_reservation() local
2256 block = gfs2_rbm_to_block(rbm); gfs2_adjust_reservation()
2257 ret = gfs2_rbm_from_block(&rs->rs_rbm, block + len); gfs2_adjust_reservation()
2264 /* We used up our block reservation, so we should gfs2_adjust_reservation()
2275 * gfs2_set_alloc_start - Set starting point for block allocation
2282 * inode's goal block or the last allocation point in the rgrp.
2305 * @ip: the inode to allocate the block for
2306 * @bn: Used to return the starting block number
2308 * @dinode: 1 if we're allocating a dinode block, else 0
2321 u64 block; /* block, within the file system scope */ gfs2_alloc_blocks() local
2343 block = gfs2_rbm_to_block(&rbm); gfs2_alloc_blocks()
2344 rbm.rgd->rd_last_alloc = block - rbm.rgd->rd_data0; gfs2_alloc_blocks()
2352 ip->i_goal = block + ndata - 1; gfs2_alloc_blocks()
2382 gfs2_trans_add_unrevoke(sdp, block, *nblocks); gfs2_alloc_blocks()
2387 trace_gfs2_block_alloc(ip, rbm.rgd, block, *nblocks, gfs2_alloc_blocks()
2389 *bn = block; gfs2_alloc_blocks()
2398 * __gfs2_free_blocks - free a contiguous run of block(s)
2400 * @bstart: first block of a run of contiguous blocks
2401 * @blen: the length of the block run
2427 * gfs2_free_meta - free a contiguous run of data block(s)
2429 * @bstart: first block of a run of contiguous blocks
2430 * @blen: the length of the block run
2493 * gfs2_check_blk_type - Check the type of a block
2495 * @no_addr: The block number to check
2496 * @type: The block type we are looking for
2498 * Returns: 0 if the block type matches the expected type
2529 * @block: the block
2531 * Figure out what RG a block belongs to and add that RG to the list
2538 u64 block) gfs2_rlist_add()
2549 if (ip->i_rgd && rgrp_contains_block(ip->i_rgd, block)) gfs2_rlist_add()
2552 rgd = gfs2_blk2rgrpd(sdp, block, 1); gfs2_rlist_add()
2554 fs_err(sdp, "rlist_add: no rgrp for block %llu\n", (unsigned long long)block); gfs2_rlist_add()
2537 gfs2_rlist_add(struct gfs2_inode *ip, struct gfs2_rgrp_list *rlist, u64 block) gfs2_rlist_add() argument
/linux-4.1.27/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/
H A Dnv50.c82 u32 block, target; nv50_vm_map() local
101 block = 1 << (i + 3); nv50_vm_map()
102 if (cnt >= block && !(pte & (block - 1))) nv50_vm_map()
107 phys += block << (vma->node->type - 3); nv50_vm_map()
108 cnt -= block; nv50_vm_map()
112 delta += block << (vma->node->type - 3); nv50_vm_map()
115 while (block) { nv50_vm_map()
119 block -= 8; nv50_vm_map()
198 u32 block = (1 << (mmu->pgt_bits + 12)); nv50_vm_create() local
199 if (block > length) nv50_vm_create()
200 block = length; nv50_vm_create()
202 return nvkm_vm_create(mmu, offset, length, mm_offset, block, pvm); nv50_vm_create()
/linux-4.1.27/init/
H A Ddo_mounts_rd.c36 int __initdata rd_image_start; /* starting block # of image */
90 * Read block 0 to test for compressed kernel identify_ramdisk_image()
97 printk(KERN_NOTICE "RAMDISK: %s image found at block %d\n", identify_ramdisk_image()
107 /* romfs is at block zero too */ identify_ramdisk_image()
111 "RAMDISK: romfs filesystem found at block %d\n", identify_ramdisk_image()
119 "RAMDISK: cramfs filesystem found at block %d\n", identify_ramdisk_image()
125 /* squashfs is at block zero too */ identify_ramdisk_image()
128 "RAMDISK: squashfs filesystem found at block %d\n", identify_ramdisk_image()
143 "RAMDISK: cramfs filesystem found at block %d\n", identify_ramdisk_image()
150 * Read block 1 to test for minix and ext2 superblock identify_ramdisk_image()
159 "RAMDISK: Minix filesystem found at block %d\n", identify_ramdisk_image()
169 "RAMDISK: ext2 filesystem found at block %d\n", identify_ramdisk_image()
219 * So any ramdisk block size that is a multiple of 1KiB should rd_load_image()
/linux-4.1.27/fs/ntfs/
H A Dcompress.c44 /* Compression sub-block constants. */
50 * The maximum compression block size is by definition 16 * the cluster
133 * ntfs_decompress - decompress a compression block into an array of pages
141 * @cb_start: compression block to decompress (IN)
142 * @cb_size: size of compression block @cb_start in bytes (IN)
149 * This decompresses the compression block @cb_start into the array of
156 * @cb_start is a pointer to the compression block which needs decompressing
161 * completed during the decompression of the compression block (@cb_start).
167 * the compression block @cb_start as it is a per-CPU buffer.
176 * Pointers into the compressed data, i.e. the compression block (cb), ntfs_decompress()
187 u8 *dp_sb_start; /* Start of current sub-block in dp. */ ntfs_decompress()
190 u16 do_sb_start; /* @dest_ofs when starting this sub-block. */ ntfs_decompress()
207 ntfs_debug("Beginning sub-block at offset = 0x%zx in the cb.", ntfs_decompress()
210 * Have we reached the end of the compression block or the end of the ntfs_decompress()
212 * position in the compression block is one byte before its end so the ntfs_decompress()
251 /* Setup offsets for the current sub-block destination. */ ntfs_decompress()
263 /* Setup the current sub-block source pointers and validate range. */ ntfs_decompress()
273 /* No page present. Skip decompression of this sub-block. */ ntfs_decompress()
276 /* Advance destination position to next sub-block. */ ntfs_decompress()
286 /* Now, we are ready to process the current sub-block (sb). */ ntfs_decompress()
288 ntfs_debug("Found uncompressed sub-block."); ntfs_decompress()
298 /* Copy the block and advance the source position. */ ntfs_decompress()
302 /* Advance destination position to next sub-block. */ ntfs_decompress()
316 ntfs_debug("Found compressed sub-block."); ntfs_decompress()
323 /* Forward to the first tag in the sub-block. */ ntfs_decompress()
327 /* Check if the decompressed sub-block was not full-length. */ ntfs_decompress()
331 ntfs_debug("Filling incomplete sub-block with " ntfs_decompress()
337 /* We have finished the current sub-block. */ ntfs_decompress()
448 * ntfs_read_compressed_block - read a compressed block into the page cache
449 * @page: locked page in the compression block(s) we need to read
454 * 1. Determine which compression block(s) @page is in.
455 * 2. Get hold of all pages corresponding to this/these compression block(s).
456 * 3. Read the (first) compression block.
459 * block or return success if no more compression blocks left.
521 int block, max_block, cb_max_page, bhs_size, nr_bhs, err = 0; ntfs_read_compressed_block() local
601 * Now read the first compression block. ntfs_read_compressed_block()
650 block = lcn << vol->cluster_size_bits >> block_size_bits; ntfs_read_compressed_block()
652 max_block = block + (vol->cluster_size >> block_size_bits); ntfs_read_compressed_block()
654 ntfs_debug("block = 0x%x.", block); ntfs_read_compressed_block()
655 if (unlikely(!(bhs[nr_bhs] = sb_getblk(sb, block)))) ntfs_read_compressed_block()
658 } while (++block < max_block); ntfs_read_compressed_block()
735 ntfs_debug("Successfully read the compression block."); ntfs_read_compressed_block()
742 /* Catch end of file inside a compression block. */ ntfs_read_compressed_block()
748 ntfs_debug("Found sparse compression block."); ntfs_read_compressed_block()
800 ntfs_debug("Found uncompressed compression block."); ntfs_read_compressed_block()
865 ntfs_debug("Found compressed compression block."); ntfs_read_compressed_block()
877 "this compression block.", ntfs_read_compressed_block()
942 "compression block."); ntfs_read_compressed_block()
948 "compression block."); ntfs_read_compressed_block()
953 ntfs_error(vol->sb, "getblk() failed. Cannot read compression block."); ntfs_read_compressed_block()
/linux-4.1.27/drivers/media/platform/vivid/
H A Dvivid-rds-gen.c51 * All remaining groups use a filler group 15B block that just repeats
66 data[0].block = V4L2_RDS_BLOCK_A | (V4L2_RDS_BLOCK_A << 3); vivid_rds_generate()
69 data[1].block = V4L2_RDS_BLOCK_B | (V4L2_RDS_BLOCK_B << 3); vivid_rds_generate()
70 data[3].block = V4L2_RDS_BLOCK_D | (V4L2_RDS_BLOCK_D << 3); vivid_rds_generate()
81 data[2].block = V4L2_RDS_BLOCK_C_ALT | (V4L2_RDS_BLOCK_C_ALT << 3); vivid_rds_generate()
91 data[2].block = V4L2_RDS_BLOCK_C | (V4L2_RDS_BLOCK_C << 3); vivid_rds_generate()
117 data[2].block = V4L2_RDS_BLOCK_C | (V4L2_RDS_BLOCK_C << 3); vivid_rds_generate()
127 data[2].block = V4L2_RDS_BLOCK_C_ALT | (V4L2_RDS_BLOCK_C_ALT << 3); vivid_rds_generate()
/linux-4.1.27/drivers/scsi/
H A Dst_options.h34 /* The "guess" for the block size for devices that don't support MODE
38 /* The minimum tape driver buffer size in kilobytes in fixed block mode.
49 /* The size of the first scatter/gather segments (determines the maximum block
63 /* If ST_BUFFER_WRITES is non-zero, writes in fixed block mode are
73 /* If ST_READ_AHEAD is non-zero, blocks are read ahead in fixed block
88 /* If ST_SCSI2LOGICAL is nonzero, the logical block addresses are used for
97 /* If ST_SILI is non-zero, the SILI bit is set when reading in variable block
98 mode and the block size is determined using the residual returned by the HBA. */
/linux-4.1.27/fs/jbd2/
H A Drecovery.c58 * When reading from the journal, we are going through the block device
85 * a time to the block device IO layer. */ do_readahead()
93 printk(KERN_ERR "JBD2: bad block at offset %u\n", do_readahead()
129 * Read a block from the journal
149 printk(KERN_ERR "JBD2: bad block at offset %u\n", jread()
167 printk(KERN_ERR "JBD2: Failed to read block at offset %u\n", jread()
198 * Count the number of in-use tags in a journal descriptor block.
344 unsigned long long block = be32_to_cpu(tag->t_blocknr); read_tag_block() local
346 block |= (u64)be32_to_cpu(tag->t_blocknr_high) << 32; read_tag_block()
347 return block; read_tag_block()
352 * descriptor block.
362 /* Calculate checksum of the descriptor block. */ calc_chksums()
370 printk(KERN_ERR "JBD2: IO error %d recovering block " calc_chksums()
439 * block offsets): query the superblock. do_one_pass()
454 * making sure that each transaction has a commit block in the do_one_pass()
480 * either the next descriptor block or the final commit do_one_pass()
483 jbd_debug(3, "JBD2: checking block %ld\n", next_log_block); do_one_pass()
493 * If it is a descriptor block, check that it has the do_one_pass()
514 /* OK, we have a valid descriptor block which matches do_one_pass()
528 "recovering block %lu in log\n", do_one_pass()
535 /* If it is a valid descriptor block, replay it do_one_pass()
559 /* A descriptor block: we can now write all of do_one_pass()
580 "block %ld in log\n", do_one_pass()
589 /* If the block has been do_one_pass()
600 /* Look for block corruption */ do_one_pass()
608 "block %llu in log\n", do_one_pass()
678 * Commit block found Commit block not found do_one_pass()
685 * before commit block do_one_pass()
692 /* Found an expected commit block: if checksums do_one_pass()
767 * just skip over this block. */ do_one_pass()
791 * known end of the log or we found an unexpected block in the do_one_pass()
/linux-4.1.27/arch/powerpc/include/asm/
H A Dvdso_datapage.h81 __u32 dcache_block_size; /* L1 d-cache block size */
82 __u32 icache_block_size; /* L1 i-cache block size */
83 __u32 dcache_log_block_size; /* L1 d-cache log block size */
84 __u32 icache_log_block_size; /* L1 i-cache log block size */
111 __u32 dcache_block_size; /* L1 d-cache block size */
112 __u32 icache_block_size; /* L1 i-cache block size */
113 __u32 dcache_log_block_size; /* L1 d-cache log block size */
114 __u32 icache_log_block_size; /* L1 i-cache log block size */
/linux-4.1.27/arch/x86/include/asm/
H A Dxor_64.h16 /* We force the use of the SSE xor block because it can write around L2.

Completed in 3844 milliseconds

1234567891011>>