Lines Matching refs:mip

580 static void init_mmap_info(struct mmap_info *mip)  in init_mmap_info()  argument
582 mip->buf_size = buf_size; in init_mmap_info()
583 mip->buf_nr = buf_nr; in init_mmap_info()
584 mip->pagesize = pagesize; in init_mmap_info()
732 static int setup_mmap(int fd, unsigned int maxlen, struct mmap_info *mip) in setup_mmap() argument
734 if (mip->fs_off + maxlen > mip->fs_buf_len) { in setup_mmap()
735 unsigned long nr = max(16, mip->buf_nr); in setup_mmap()
737 if (mip->fs_buf) { in setup_mmap()
738 munlock(mip->fs_buf, mip->fs_buf_len); in setup_mmap()
739 munmap(mip->fs_buf, mip->fs_buf_len); in setup_mmap()
740 mip->fs_buf = NULL; in setup_mmap()
743 mip->fs_off = mip->fs_size & (mip->pagesize - 1); in setup_mmap()
744 mip->fs_buf_len = (nr * mip->buf_size) - mip->fs_off; in setup_mmap()
745 mip->fs_max_size += mip->fs_buf_len; in setup_mmap()
747 if (ftruncate(fd, mip->fs_max_size) < 0) { in setup_mmap()
752 mip->fs_buf = my_mmap(NULL, mip->fs_buf_len, PROT_WRITE, in setup_mmap()
754 mip->fs_size - mip->fs_off); in setup_mmap()
755 if (mip->fs_buf == MAP_FAILED) { in setup_mmap()
759 my_mlock(mip->fs_buf, mip->fs_buf_len); in setup_mmap()
1554 struct mmap_info *mip = &iop->mmap_info; in close_iop() local
1556 if (mip->fs_buf) in close_iop()
1557 munmap(mip->fs_buf, mip->fs_buf_len); in close_iop()
1560 if (ftruncate(fileno(iop->ofp), mip->fs_size) < 0) { in close_iop()
1664 struct mmap_info *mip; in handle_pfds_file() local
1671 mip = &iop->mmap_info; in handle_pfds_file()
1673 ret = setup_mmap(iop->ofd, buf_size, mip); in handle_pfds_file()
1679 ret = read(iop->ifd, mip->fs_buf + mip->fs_off, in handle_pfds_file()
1683 mip->fs_size += ret; in handle_pfds_file()
1684 mip->fs_off += ret; in handle_pfds_file()
2369 struct mmap_info *mip = &iop->mmap_info; in net_client_read_data() local
2377 ret = net_recv_data(nc->fd, mip->fs_buf + mip->fs_off, bnh->len); in net_client_read_data()
2380 mip->fs_size += ret; in net_client_read_data()
2381 mip->fs_off += ret; in net_client_read_data()