Lines Matching refs:mip
597 static void init_mmap_info(struct mmap_info *mip) in init_mmap_info() argument
599 mip->buf_size = buf_size; in init_mmap_info()
600 mip->buf_nr = buf_nr; in init_mmap_info()
601 mip->pagesize = pagesize; in init_mmap_info()
749 struct mmap_info *mip, in setup_mmap() argument
752 if (mip->fs_off + maxlen > mip->fs_buf_len) { in setup_mmap()
753 unsigned long nr = max(16, mip->buf_nr); in setup_mmap()
755 if (mip->fs_buf) { in setup_mmap()
756 munlock(mip->fs_buf, mip->fs_buf_len); in setup_mmap()
757 munmap(mip->fs_buf, mip->fs_buf_len); in setup_mmap()
758 mip->fs_buf = NULL; in setup_mmap()
761 mip->fs_off = mip->fs_size & (mip->pagesize - 1); in setup_mmap()
762 mip->fs_buf_len = (nr * mip->buf_size) - mip->fs_off; in setup_mmap()
763 mip->fs_max_size += mip->fs_buf_len; in setup_mmap()
765 if (ftruncate(fd, mip->fs_max_size) < 0) { in setup_mmap()
770 mip->fs_buf = my_mmap(NULL, mip->fs_buf_len, PROT_WRITE, in setup_mmap()
772 mip->fs_size - mip->fs_off); in setup_mmap()
773 if (mip->fs_buf == MAP_FAILED) { in setup_mmap()
777 if (my_mlock(tp, mip->fs_buf, mip->fs_buf_len) < 0) { in setup_mmap()
1609 struct mmap_info *mip = &iop->mmap_info; in close_iop() local
1611 if (mip->fs_buf) in close_iop()
1612 munmap(mip->fs_buf, mip->fs_buf_len); in close_iop()
1615 if (ftruncate(fileno(iop->ofp), mip->fs_size) < 0) { in close_iop()
1719 struct mmap_info *mip; in handle_pfds_file() local
1726 mip = &iop->mmap_info; in handle_pfds_file()
1728 ret = setup_mmap(iop->ofd, buf_size, mip, tp); in handle_pfds_file()
1734 ret = read(iop->ifd, mip->fs_buf + mip->fs_off, in handle_pfds_file()
1738 mip->fs_size += ret; in handle_pfds_file()
1739 mip->fs_off += ret; in handle_pfds_file()
2471 struct mmap_info *mip = &iop->mmap_info; in net_client_read_data() local
2479 ret = net_recv_data(nc->fd, mip->fs_buf + mip->fs_off, bnh->len); in net_client_read_data()
2482 mip->fs_size += ret; in net_client_read_data()
2483 mip->fs_off += ret; in net_client_read_data()