{
struct scsi_host_sg_pool *sgp;
struct scatterlist *sgl;
+ int pf_flags;
BUG_ON(!SCpnt->use_sg);
sgp = scsi_sg_pools + SCpnt->sglist_len;
+ pf_flags = current->flags;
current->flags |= PF_NOWARN;
sgl = mempool_alloc(sgp->pool, gfp_mask);
- current->flags &= ~PF_NOWARN;
+ current->flags = pf_flags;
if (sgl) {
memset(sgl, 0, sgp->size);
return sgl;
{
struct bio *bio;
struct bio_vec *bvl = NULL;
+ int pf_flags = current->flags;
current->flags |= PF_NOWARN;
bio = mempool_alloc(bio_pool, gfp_mask);
mempool_free(bio, bio_pool);
bio = NULL;
out:
- current->flags &= ~PF_NOWARN;
+ current->flags = pf_flags;
return bio;
}
head = NULL;
offset = PAGE_SIZE;
while ((offset -= size) >= 0) {
+ int pf_flags = current->flags;
+
current->flags |= PF_NOWARN;
bh = alloc_buffer_head();
- current->flags &= ~PF_NOWARN;
+ current->flags = pf_flags;
if (!bh)
goto no_grow;
int curr_nr;
DECLARE_WAITQUEUE(wait, current);
int gfp_nowait = gfp_mask & ~(__GFP_WAIT | __GFP_IO);
+ int pf_flags = current->flags;
repeat_alloc:
current->flags |= PF_NOWARN;
element = pool->alloc(gfp_nowait, pool->pool_data);
- current->flags &= ~PF_NOWARN;
+ current->flags = pf_flags;
if (likely(element != NULL))
return element;
int add_to_swap(struct page * page)
{
swp_entry_t entry;
- int flags;
+ int pf_flags;
if (!PageLocked(page))
BUG();
* just not all of them.
*/
- flags = current->flags;
+ pf_flags = current->flags;
current->flags &= ~PF_MEMALLOC;
current->flags |= PF_NOWARN;
ClearPageUptodate(page); /* why? */
*/
switch (add_to_swap_cache(page, entry)) {
case 0: /* Success */
- current->flags = flags;
+ current->flags = pf_flags;
SetPageUptodate(page);
set_page_dirty(page);
swap_free(entry);
return 1;
case -ENOMEM: /* radix-tree allocation */
- current->flags = flags;
+ current->flags = pf_flags;
swap_free(entry);
return 0;
default: /* ENOENT: raced */
break;
}
/* Raced with "speculative" read_swap_cache_async */
- current->flags = flags;
+ current->flags = pf_flags;
swap_free(entry);
}
}