Lines Matching refs:schp

187 static int sg_build_indirect(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size);
196 static void sg_remove_scat(Sg_scatter_hold * schp);
1749 sg_build_sgat(Sg_scatter_hold * schp, const Sg_fd * sfp, int tablesize) in sg_build_sgat() argument
1754 schp->pages = kzalloc(sg_bufflen, gfp_flags); in sg_build_sgat()
1755 if (!schp->pages) in sg_build_sgat()
1757 schp->sglist_len = sg_bufflen; in sg_build_sgat()
1762 sg_build_indirect(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size) in sg_build_indirect() argument
1779 mx_sc_elems = sg_build_sgat(schp, sfp, sg_tablesize); in sg_build_indirect()
1808 schp->pages[k] = alloc_pages(gfp_mask, order); in sg_build_indirect()
1809 if (!schp->pages[k]) in sg_build_indirect()
1823 schp->page_order = order; in sg_build_indirect()
1824 schp->k_use_sg = k; in sg_build_indirect()
1828 schp->bufflen = blk_size; in sg_build_indirect()
1834 __free_pages(schp->pages[i], order); in sg_build_indirect()
1843 sg_remove_scat(Sg_scatter_hold * schp) in sg_remove_scat() argument
1845 SCSI_LOG_TIMEOUT(4, printk("sg_remove_scat: k_use_sg=%d\n", schp->k_use_sg)); in sg_remove_scat()
1846 if (schp->pages && schp->sglist_len > 0) { in sg_remove_scat()
1847 if (!schp->dio_in_use) { in sg_remove_scat()
1850 for (k = 0; k < schp->k_use_sg && schp->pages[k]; k++) { in sg_remove_scat()
1853 k, schp->pages[k])); in sg_remove_scat()
1854 __free_pages(schp->pages[k], schp->page_order); in sg_remove_scat()
1857 kfree(schp->pages); in sg_remove_scat()
1860 memset(schp, 0, sizeof (*schp)); in sg_remove_scat()
1866 Sg_scatter_hold *schp = &srp->data; in sg_read_oxfer() local
1874 num = 1 << (PAGE_SHIFT + schp->page_order); in sg_read_oxfer()
1875 for (k = 0; k < schp->k_use_sg && schp->pages[k]; k++) { in sg_read_oxfer()
1877 if (__copy_to_user(outp, page_address(schp->pages[k]), in sg_read_oxfer()
1882 if (__copy_to_user(outp, page_address(schp->pages[k]), in sg_read_oxfer()
1898 Sg_scatter_hold *schp = &sfp->reserve; in sg_build_reserve() local
1904 if (0 == sg_build_indirect(schp, sfp, req_size)) in sg_build_reserve()
1907 sg_remove_scat(schp); in sg_build_reserve()