Lines Matching full:pcb
22 __acquires(pcb->lock) in erofs_get_pcpubuf()
24 struct erofs_pcpubuf *pcb = &get_cpu_var(erofs_pcb); in erofs_get_pcpubuf() local
26 raw_spin_lock(&pcb->lock); in erofs_get_pcpubuf()
28 if (requiredpages > pcb->nrpages) { in erofs_get_pcpubuf()
29 raw_spin_unlock(&pcb->lock); in erofs_get_pcpubuf()
31 /* (for sparse checker) pretend pcb->lock is still taken */ in erofs_get_pcpubuf()
32 __acquire(pcb->lock); in erofs_get_pcpubuf()
35 return pcb->ptr; in erofs_get_pcpubuf()
38 void erofs_put_pcpubuf(void *ptr) __releases(pcb->lock) in erofs_put_pcpubuf()
40 struct erofs_pcpubuf *pcb = &per_cpu(erofs_pcb, smp_processor_id()); in erofs_put_pcpubuf() local
42 DBG_BUGON(pcb->ptr != ptr); in erofs_put_pcpubuf()
43 raw_spin_unlock(&pcb->lock); in erofs_put_pcpubuf()
63 struct erofs_pcpubuf *pcb = &per_cpu(erofs_pcb, cpu); in erofs_pcpubuf_growsize() local
87 raw_spin_lock(&pcb->lock); in erofs_pcpubuf_growsize()
88 old_ptr = pcb->ptr; in erofs_pcpubuf_growsize()
89 pcb->ptr = ptr; in erofs_pcpubuf_growsize()
90 oldpages = pcb->pages; in erofs_pcpubuf_growsize()
91 pcb->pages = pages; in erofs_pcpubuf_growsize()
92 i = pcb->nrpages; in erofs_pcpubuf_growsize()
93 pcb->nrpages = nrpages; in erofs_pcpubuf_growsize()
94 raw_spin_unlock(&pcb->lock); in erofs_pcpubuf_growsize()
122 struct erofs_pcpubuf *pcb = &per_cpu(erofs_pcb, cpu); in erofs_pcpubuf_init() local
124 raw_spin_lock_init(&pcb->lock); in erofs_pcpubuf_init()
133 struct erofs_pcpubuf *pcb = &per_cpu(erofs_pcb, cpu); in erofs_pcpubuf_exit() local
135 if (pcb->ptr) { in erofs_pcpubuf_exit()
136 vunmap(pcb->ptr); in erofs_pcpubuf_exit()
137 pcb->ptr = NULL; in erofs_pcpubuf_exit()
139 if (!pcb->pages) in erofs_pcpubuf_exit()
142 for (i = 0; i < pcb->nrpages; ++i) in erofs_pcpubuf_exit()
143 if (pcb->pages[i]) in erofs_pcpubuf_exit()
144 put_page(pcb->pages[i]); in erofs_pcpubuf_exit()
145 kfree(pcb->pages); in erofs_pcpubuf_exit()
146 pcb->pages = NULL; in erofs_pcpubuf_exit()