Home
last modified time | relevance | path

Searched refs:alloc (Results 1 – 25 of 503) sorted by relevance

12345678910>>...21

/kernel/linux/linux-5.10/drivers/infiniband/hw/cxgb4/
Did_table.c44 u32 c4iw_id_alloc(struct c4iw_id_table *alloc) in c4iw_id_alloc() argument
49 spin_lock_irqsave(&alloc->lock, flags); in c4iw_id_alloc()
51 obj = find_next_zero_bit(alloc->table, alloc->max, alloc->last); in c4iw_id_alloc()
52 if (obj >= alloc->max) in c4iw_id_alloc()
53 obj = find_first_zero_bit(alloc->table, alloc->max); in c4iw_id_alloc()
55 if (obj < alloc->max) { in c4iw_id_alloc()
56 if (alloc->flags & C4IW_ID_TABLE_F_RANDOM) in c4iw_id_alloc()
57 alloc->last += prandom_u32() % RANDOM_SKIP; in c4iw_id_alloc()
59 alloc->last = obj + 1; in c4iw_id_alloc()
60 if (alloc->last >= alloc->max) in c4iw_id_alloc()
[all …]
/kernel/linux/linux-5.10/drivers/android/
Dbinder_alloc.c60 static size_t binder_alloc_buffer_size(struct binder_alloc *alloc, in binder_alloc_buffer_size() argument
63 if (list_is_last(&buffer->entry, &alloc->buffers)) in binder_alloc_buffer_size()
64 return alloc->buffer + alloc->buffer_size - buffer->user_data; in binder_alloc_buffer_size()
68 static void binder_insert_free_buffer(struct binder_alloc *alloc, in binder_insert_free_buffer() argument
71 struct rb_node **p = &alloc->free_buffers.rb_node; in binder_insert_free_buffer()
79 new_buffer_size = binder_alloc_buffer_size(alloc, new_buffer); in binder_insert_free_buffer()
83 alloc->pid, new_buffer_size, new_buffer); in binder_insert_free_buffer()
90 buffer_size = binder_alloc_buffer_size(alloc, buffer); in binder_insert_free_buffer()
98 rb_insert_color(&new_buffer->rb_node, &alloc->free_buffers); in binder_insert_free_buffer()
102 struct binder_alloc *alloc, struct binder_buffer *new_buffer) in binder_insert_allocated_buffer_locked() argument
[all …]
Dbinder_alloc_selftest.c92 static bool check_buffer_pages_allocated(struct binder_alloc *alloc, in check_buffer_pages_allocated() argument
103 page_index = (page_addr - alloc->buffer) / PAGE_SIZE; in check_buffer_pages_allocated()
104 if (!alloc->pages[page_index].page_ptr || in check_buffer_pages_allocated()
105 !list_empty(&alloc->pages[page_index].lru)) { in check_buffer_pages_allocated()
107 alloc->pages[page_index].page_ptr ? in check_buffer_pages_allocated()
115 static void binder_selftest_alloc_buf(struct binder_alloc *alloc, in binder_selftest_alloc_buf() argument
122 buffers[i] = binder_alloc_new_buf(alloc, sizes[i], 0, 0, 0, 0); in binder_selftest_alloc_buf()
124 !check_buffer_pages_allocated(alloc, buffers[i], in binder_selftest_alloc_buf()
132 static void binder_selftest_free_buf(struct binder_alloc *alloc, in binder_selftest_free_buf() argument
139 binder_alloc_free_buf(alloc, buffers[seq[i]]); in binder_selftest_free_buf()
[all …]
Dbinder_alloc.h69 struct binder_alloc *alloc; member
113 void binder_selftest_alloc(struct binder_alloc *alloc);
115 static inline void binder_selftest_alloc(struct binder_alloc *alloc) {} in binder_selftest_alloc() argument
120 extern struct binder_buffer *binder_alloc_new_buf(struct binder_alloc *alloc,
126 extern void binder_alloc_init(struct binder_alloc *alloc);
129 extern void binder_alloc_vma_close(struct binder_alloc *alloc);
131 binder_alloc_prepare_to_free(struct binder_alloc *alloc,
133 extern void binder_alloc_free_buf(struct binder_alloc *alloc,
135 extern int binder_alloc_mmap_handler(struct binder_alloc *alloc,
137 extern void binder_alloc_deferred_release(struct binder_alloc *alloc);
[all …]
Dbinder_trace.h286 TP_PROTO(struct binder_alloc *alloc, bool allocate,
288 TP_ARGS(alloc, allocate, start, end),
296 __entry->proc = alloc->pid;
298 __entry->offset = start - alloc->buffer;
307 TP_PROTO(const struct binder_alloc *alloc, size_t page_index),
308 TP_ARGS(alloc, page_index),
314 __entry->proc = alloc->pid;
322 TP_PROTO(const struct binder_alloc *alloc, size_t page_index),
323 TP_ARGS(alloc, page_index));
326 TP_PROTO(const struct binder_alloc *alloc, size_t page_index),
[all …]
/kernel/linux/linux-5.10/sound/isa/gus/
Dgus_mem.c18 void snd_gf1_mem_lock(struct snd_gf1_mem * alloc, int xup) in snd_gf1_mem_lock() argument
21 mutex_lock(&alloc->memory_mutex); in snd_gf1_mem_lock()
23 mutex_unlock(&alloc->memory_mutex); in snd_gf1_mem_lock()
27 static struct snd_gf1_mem_block *snd_gf1_mem_xalloc(struct snd_gf1_mem * alloc, in snd_gf1_mem_xalloc() argument
36 pblock = alloc->first; in snd_gf1_mem_xalloc()
42 if (pblock == alloc->first) in snd_gf1_mem_xalloc()
43 alloc->first = nblock; in snd_gf1_mem_xalloc()
46 mutex_unlock(&alloc->memory_mutex); in snd_gf1_mem_xalloc()
52 if (alloc->last == NULL) { in snd_gf1_mem_xalloc()
54 alloc->first = alloc->last = nblock; in snd_gf1_mem_xalloc()
[all …]
/kernel/linux/linux-5.10/drivers/infiniband/hw/mthca/
Dmthca_allocator.c40 u32 mthca_alloc(struct mthca_alloc *alloc) in mthca_alloc() argument
45 spin_lock_irqsave(&alloc->lock, flags); in mthca_alloc()
47 obj = find_next_zero_bit(alloc->table, alloc->max, alloc->last); in mthca_alloc()
48 if (obj >= alloc->max) { in mthca_alloc()
49 alloc->top = (alloc->top + alloc->max) & alloc->mask; in mthca_alloc()
50 obj = find_first_zero_bit(alloc->table, alloc->max); in mthca_alloc()
53 if (obj < alloc->max) { in mthca_alloc()
54 set_bit(obj, alloc->table); in mthca_alloc()
55 obj |= alloc->top; in mthca_alloc()
59 spin_unlock_irqrestore(&alloc->lock, flags); in mthca_alloc()
[all …]
Dmthca_uar.c40 uar->index = mthca_alloc(&dev->uar_table.alloc); in mthca_uar_alloc()
51 mthca_free(&dev->uar_table.alloc, uar->index); in mthca_uar_free()
58 ret = mthca_alloc_init(&dev->uar_table.alloc, in mthca_init_uar_table()
67 mthca_alloc_cleanup(&dev->uar_table.alloc); in mthca_init_uar_table()
77 mthca_alloc_cleanup(&dev->uar_table.alloc); in mthca_cleanup_uar_table()
Dmthca_pd.c46 pd->pd_num = mthca_alloc(&dev->pd_table.alloc); in mthca_pd_alloc()
56 mthca_free(&dev->pd_table.alloc, pd->pd_num); in mthca_pd_alloc()
66 mthca_free(&dev->pd_table.alloc, pd->pd_num); in mthca_pd_free()
71 return mthca_alloc_init(&dev->pd_table.alloc, in mthca_init_pd_table()
80 mthca_alloc_cleanup(&dev->pd_table.alloc); in mthca_cleanup_pd_table()
/kernel/linux/linux-5.10/fs/ocfs2/
Dlocalalloc.c37 static u32 ocfs2_local_alloc_count_bits(struct ocfs2_dinode *alloc);
40 struct ocfs2_dinode *alloc,
44 static void ocfs2_clear_local_alloc(struct ocfs2_dinode *alloc);
48 struct ocfs2_dinode *alloc,
273 struct ocfs2_dinode *alloc = NULL; in ocfs2_load_local_alloc() local
307 alloc = (struct ocfs2_dinode *) alloc_bh->b_data; in ocfs2_load_local_alloc()
308 la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_load_local_alloc()
310 if (!(le32_to_cpu(alloc->i_flags) & in ocfs2_load_local_alloc()
327 num_used = ocfs2_local_alloc_count_bits(alloc); in ocfs2_load_local_alloc()
332 || alloc->id1.bitmap1.i_used in ocfs2_load_local_alloc()
[all …]
/kernel/linux/linux-5.10/fs/xfs/libxfs/
Dxfs_alloc_btree.c130 len = rec->alloc.ar_blockcount; in xfs_allocbt_update_lastrec()
133 if (be32_to_cpu(rec->alloc.ar_blockcount) <= in xfs_allocbt_update_lastrec()
136 len = rec->alloc.ar_blockcount; in xfs_allocbt_update_lastrec()
186 key->alloc.ar_startblock = rec->alloc.ar_startblock; in xfs_allocbt_init_key_from_rec()
187 key->alloc.ar_blockcount = rec->alloc.ar_blockcount; in xfs_allocbt_init_key_from_rec()
197 x = be32_to_cpu(rec->alloc.ar_startblock); in xfs_bnobt_init_high_key_from_rec()
198 x += be32_to_cpu(rec->alloc.ar_blockcount) - 1; in xfs_bnobt_init_high_key_from_rec()
199 key->alloc.ar_startblock = cpu_to_be32(x); in xfs_bnobt_init_high_key_from_rec()
200 key->alloc.ar_blockcount = 0; in xfs_bnobt_init_high_key_from_rec()
208 key->alloc.ar_blockcount = rec->alloc.ar_blockcount; in xfs_cntbt_init_high_key_from_rec()
[all …]
/kernel/linux/linux-5.10/tools/perf/util/
Dstrbuf.c22 sb->alloc = sb->len = 0; in strbuf_init()
31 if (sb->alloc) { in strbuf_release()
39 char *res = sb->alloc ? sb->buf : NULL; in strbuf_detach()
51 if (nr < sb->alloc) in strbuf_grow()
57 if (alloc_nr(sb->alloc) > nr) in strbuf_grow()
58 nr = alloc_nr(sb->alloc); in strbuf_grow()
64 buf = realloc(sb->alloc ? sb->buf : NULL, nr * sizeof(*buf)); in strbuf_grow()
69 sb->alloc = nr; in strbuf_grow()
106 len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap); in strbuf_addv()
117 len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap_saved); in strbuf_addv()
[all …]
Dstrbuf.h51 size_t alloc; member
65 return sb->alloc ? sb->alloc - sb->len - 1 : 0; in strbuf_avail()
71 if (!sb->alloc) { in strbuf_setlen()
76 assert(len < sb->alloc); in strbuf_setlen()
Dhelp-unknown-cmd.c37 if (nr > cmds->alloc) { in add_cmd_list()
39 if (alloc_nr(cmds->alloc) < nr) in add_cmd_list()
40 cmds->alloc = nr; in add_cmd_list()
42 cmds->alloc = alloc_nr(cmds->alloc); in add_cmd_list()
43 tmp = realloc(cmds->names, cmds->alloc * sizeof(*cmds->names)); in add_cmd_list()
/kernel/linux/linux-5.10/tools/lib/subcmd/
Dsubcmd-util.h39 #define ALLOC_GROW(x, nr, alloc) \ argument
41 if ((nr) > alloc) { \
42 if (alloc_nr(alloc) < (nr)) \
43 alloc = (nr); \
45 alloc = alloc_nr(alloc); \
46 x = xrealloc((x), alloc * sizeof(*(x))); \
/kernel/linux/linux-5.10/net/core/
Dpage_pool.c134 pool->alloc.cache[pool->alloc.count++] = page; in page_pool_refill_alloc_cache()
145 } while (pool->alloc.count < PP_ALLOC_CACHE_REFILL); in page_pool_refill_alloc_cache()
148 if (likely(pool->alloc.count > 0)) in page_pool_refill_alloc_cache()
149 page = pool->alloc.cache[--pool->alloc.count]; in page_pool_refill_alloc_cache()
161 if (likely(pool->alloc.count)) { in __page_pool_get_cached()
163 page = pool->alloc.cache[--pool->alloc.count]; in __page_pool_get_cached()
345 if (unlikely(pool->alloc.count == PP_ALLOC_CACHE_SIZE)) in page_pool_recycle_in_cache()
349 pool->alloc.cache[pool->alloc.count++] = page; in page_pool_recycle_in_cache()
452 while (pool->alloc.count) { in page_pool_empty_alloc_cache_once()
453 page = pool->alloc.cache[--pool->alloc.count]; in page_pool_empty_alloc_cache_once()
[all …]
/kernel/linux/linux-5.10/arch/xtensa/variants/dc233c/include/variant/
Dtie-asm.h77 .macro xchal_ncp_store ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0
85 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~(\alloc)) == 0
97 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
115 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
141 .macro xchal_ncp_load ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0
149 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~(\alloc)) == 0
161 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
179 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
/kernel/linux/linux-5.10/arch/xtensa/variants/csp/include/variant/
Dtie-asm.h76 .macro xchal_ncp_store ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0
84 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~(\alloc)) == 0
96 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
116 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
142 .macro xchal_ncp_load ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0
150 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~(\alloc)) == 0
162 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
182 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
/kernel/linux/linux-5.10/arch/s390/mm/
Dpgalloc.c392 unsigned long end, int alloc) in base_page_walk() argument
396 if (!alloc) in base_page_walk()
408 unsigned long end, int alloc) in base_segment_walk() argument
418 if (!alloc) in base_segment_walk()
426 rc = base_page_walk(table, addr, next, alloc); in base_segment_walk()
429 if (!alloc) in base_segment_walk()
437 unsigned long end, int alloc) in base_region3_walk() argument
447 if (!alloc) in base_region3_walk()
455 rc = base_segment_walk(table, addr, next, alloc); in base_region3_walk()
458 if (!alloc) in base_region3_walk()
[all …]
/kernel/linux/linux-5.10/fs/nfs/
Dnfs3acl.c256 struct posix_acl *orig = acl, *dfacl = NULL, *alloc; in nfs3_set_acl() local
262 alloc = get_acl(inode, ACL_TYPE_DEFAULT); in nfs3_set_acl()
263 if (IS_ERR(alloc)) in nfs3_set_acl()
265 dfacl = alloc; in nfs3_set_acl()
269 alloc = get_acl(inode, ACL_TYPE_ACCESS); in nfs3_set_acl()
270 if (IS_ERR(alloc)) in nfs3_set_acl()
273 acl = alloc; in nfs3_set_acl()
279 alloc = posix_acl_from_mode(inode->i_mode, GFP_KERNEL); in nfs3_set_acl()
280 if (IS_ERR(alloc)) in nfs3_set_acl()
282 acl = alloc; in nfs3_set_acl()
[all …]
/kernel/linux/linux-5.10/drivers/char/agp/
Dcompat_ioctl.c155 struct agp_allocate32 alloc; in compat_agpioc_allocate_wrap() local
158 if (copy_from_user(&alloc, arg, sizeof(alloc))) in compat_agpioc_allocate_wrap()
161 memory = agp_allocate_memory_wrap(alloc.pg_count, alloc.type); in compat_agpioc_allocate_wrap()
166 alloc.key = memory->key; in compat_agpioc_allocate_wrap()
167 alloc.physical = memory->physical; in compat_agpioc_allocate_wrap()
169 if (copy_to_user(arg, &alloc, sizeof(alloc))) { in compat_agpioc_allocate_wrap()
/kernel/linux/linux-5.10/arch/xtensa/variants/de212/include/variant/
Dtie-asm.h76 .macro xchal_ncp_store ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0
86 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
104 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
130 .macro xchal_ncp_load ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0
140 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
158 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
/kernel/linux/linux-5.10/mm/
Dmempool.c84 if (pool->alloc == mempool_alloc_slab || pool->alloc == mempool_kmalloc) { in poison_element()
86 } else if (pool->alloc == mempool_alloc_pages) { in poison_element()
106 if (pool->alloc == mempool_alloc_slab || pool->alloc == mempool_kmalloc) in kasan_poison_element()
108 else if (pool->alloc == mempool_alloc_pages) in kasan_poison_element()
114 if (pool->alloc == mempool_alloc_slab || pool->alloc == mempool_kmalloc) in kasan_unpoison_element()
116 else if (pool->alloc == mempool_alloc_pages) in kasan_unpoison_element()
185 pool->alloc = alloc_fn; in mempool_init_node()
200 element = pool->alloc(gfp_mask, pool->pool_data); in mempool_init_node()
340 element = pool->alloc(GFP_KERNEL, pool->pool_data); in mempool_resize()
391 element = pool->alloc(gfp_temp, pool->pool_data); in mempool_alloc()
/kernel/linux/linux-5.10/scripts/coccinelle/api/
Dkfree_mismatch.cocci17 @alloc@
64 position a != alloc.kok;
78 position a != alloc.kok;
93 position a != alloc.vok;
106 position a != alloc.vok;
141 expression alloc.E;
150 expression alloc.E;
213 ka << alloc.kok;
214 va << alloc.vok;
222 ka << alloc.kok;
[all …]
/kernel/linux/linux-5.10/arch/xtensa/variants/test_kc705_be/include/variant/
Dtie-asm.h76 .macro xchal_ncp_store ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0
84 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~(\alloc)) == 0
96 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
116 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
142 .macro xchal_ncp_load ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0
150 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~(\alloc)) == 0
162 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
182 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
201 .macro xchal_cp1_store ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0
233 .elseif ((XTHAL_SAS_TIE | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
[all …]

12345678910>>...21