Lines Matching refs:isw
466 struct inode_switch_wbs_context *isw = in inode_switch_wbs_work_fn() local
468 struct backing_dev_info *bdi = inode_to_bdi(isw->inodes[0]); in inode_switch_wbs_work_fn()
469 struct bdi_writeback *old_wb = isw->inodes[0]->i_wb; in inode_switch_wbs_work_fn()
470 struct bdi_writeback *new_wb = isw->new_wb; in inode_switch_wbs_work_fn()
498 for (inodep = isw->inodes; *inodep; inodep++) { in inode_switch_wbs_work_fn()
514 for (inodep = isw->inodes; *inodep; inodep++) in inode_switch_wbs_work_fn()
517 kfree(isw); in inode_switch_wbs_work_fn()
562 struct inode_switch_wbs_context *isw; in inode_switch_wbs() local
572 isw = kzalloc(struct_size(isw, inodes, 2), GFP_ATOMIC); in inode_switch_wbs()
573 if (!isw) in inode_switch_wbs()
587 isw->new_wb = wb_get_create(bdi, memcg_css, GFP_ATOMIC); in inode_switch_wbs()
589 if (!isw->new_wb) in inode_switch_wbs()
592 if (!inode_prepare_wbs_switch(inode, isw->new_wb)) in inode_switch_wbs()
595 isw->inodes[0] = inode; in inode_switch_wbs()
603 INIT_RCU_WORK(&isw->work, inode_switch_wbs_work_fn); in inode_switch_wbs()
604 queue_rcu_work(isw_wq, &isw->work); in inode_switch_wbs()
609 if (isw->new_wb) in inode_switch_wbs()
610 wb_put(isw->new_wb); in inode_switch_wbs()
611 kfree(isw); in inode_switch_wbs()
614 static bool isw_prepare_wbs_switch(struct inode_switch_wbs_context *isw, in isw_prepare_wbs_switch() argument
620 if (!inode_prepare_wbs_switch(inode, isw->new_wb)) in isw_prepare_wbs_switch()
623 isw->inodes[*nr] = inode; in isw_prepare_wbs_switch()
643 struct inode_switch_wbs_context *isw; in cleanup_offline_cgwb() local
647 isw = kzalloc(struct_size(isw, inodes, WB_MAX_INODES_PER_ISW), in cleanup_offline_cgwb()
649 if (!isw) in cleanup_offline_cgwb()
656 isw->new_wb = wb_get_create(wb->bdi, memcg_css, GFP_KERNEL); in cleanup_offline_cgwb()
657 if (isw->new_wb) in cleanup_offline_cgwb()
660 if (unlikely(!isw->new_wb)) in cleanup_offline_cgwb()
661 isw->new_wb = &wb->bdi->wb; /* wb_get() is noop for bdi's wb */ in cleanup_offline_cgwb()
673 restart = isw_prepare_wbs_switch(isw, &wb->b_attached, &nr); in cleanup_offline_cgwb()
675 restart = isw_prepare_wbs_switch(isw, &wb->b_dirty_time, &nr); in cleanup_offline_cgwb()
681 wb_put(isw->new_wb); in cleanup_offline_cgwb()
682 kfree(isw); in cleanup_offline_cgwb()
692 INIT_RCU_WORK(&isw->work, inode_switch_wbs_work_fn); in cleanup_offline_cgwb()
693 queue_rcu_work(isw_wq, &isw->work); in cleanup_offline_cgwb()