Lines Matching defs:schp
184 static int sg_build_indirect(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size);
193 static void sg_remove_scat(Sg_scatter_hold * schp);
1744 sg_build_sgat(Sg_scatter_hold * schp, const Sg_fd * sfp, int tablesize)
1749 schp->pages = kzalloc(sg_bufflen, gfp_flags);
1750 if (!schp->pages)
1752 schp->sglist_len = sg_bufflen;
1757 sg_build_indirect(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size)
1774 mx_sc_elems = sg_build_sgat(schp, sfp, sg_tablesize);
1803 schp->pages[k] = alloc_pages(gfp_mask, order);
1804 if (!schp->pages[k])
1818 schp->page_order = order;
1819 schp->k_use_sg = k;
1823 schp->bufflen = blk_size;
1829 __free_pages(schp->pages[i], order);
1838 sg_remove_scat(Sg_scatter_hold * schp)
1840 SCSI_LOG_TIMEOUT(4, printk("sg_remove_scat: k_use_sg=%d\n", schp->k_use_sg));
1841 if (schp->pages && schp->sglist_len > 0) {
1842 if (!schp->dio_in_use) {
1845 for (k = 0; k < schp->k_use_sg && schp->pages[k]; k++) {
1848 k, schp->pages[k]));
1849 __free_pages(schp->pages[k], schp->page_order);
1852 kfree(schp->pages);
1855 memset(schp, 0, sizeof (*schp));
1861 Sg_scatter_hold *schp = &srp->data;
1869 num = 1 << (PAGE_SHIFT + schp->page_order);
1870 for (k = 0; k < schp->k_use_sg && schp->pages[k]; k++) {
1872 if (__copy_to_user(outp, page_address(schp->pages[k]),
1877 if (__copy_to_user(outp, page_address(schp->pages[k]),
1893 Sg_scatter_hold *schp = &sfp->reserve;
1899 if (0 == sg_build_indirect(schp, sfp, req_size))
1902 sg_remove_scat(schp);