From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 11 15:43:11 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7C5A916A4BF for ; Thu, 11 Sep 2003 15:43:11 -0700 (PDT) Received: from web20504.mail.yahoo.com (web20504.mail.yahoo.com [216.136.226.139]) by mx1.FreeBSD.org (Postfix) with SMTP id EF36E43FE0 for ; Thu, 11 Sep 2003 15:43:10 -0700 (PDT) (envelope-from vijjus@rocketmail.com) Message-ID: <20030911224310.9331.qmail@web20504.mail.yahoo.com> Received: from [63.78.179.4] by web20504.mail.yahoo.com via HTTP; Thu, 11 Sep 2003 15:43:10 PDT Date: Thu, 11 Sep 2003 15:43:10 -0700 (PDT) From: vijay singh To: hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: help with sendfile code X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Sep 2003 22:43:11 -0000 Hello hackers. What would be the FreeBSD 2.1 equivalent of the following sendfile code from uipc_syscalls.c for (off = uap->offset; ; off += xfsize, sbytes += xfsize) { vm_pindex_t pindex; vm_offset_t pgoff; pindex = OFF_TO_IDX(off); retry_lookup: /* * Calculate the amount to transfer. Not to exceed a page, * the EOF, or the passed in nbytes. */ xfsize = obj->un_pager.vnp.vnp_size - off; I have: for (off = uap->offset; ; off += xfsize, sbytes += xfsize) { vm_offset_t pindex; vm_offset_t pgoff; register vn_pager_t vnp = (vn_pager_t) obj->pager->pg_data; pindex = OFF_TO_IDX(off); retry_lookup: /* * Calculate the amount to transfer. Not to exceed a page, * the EOF, or the passed in nbytes. */ xfsize = vnp->vnp_size - off; with OFF_TO_IDX defined as: #define OFF_TO_IDX(off) ((vm_pindex_t)(((int64_t)(off)) >> PAGE_SHIFT)) However this seems to result in xfsize = 0. Could someome please point out what I'm doing wrong? Any help will be greatly appreciated. Kindly CC me. thanks vijay ===== Everytime I scream, I'm killing pain. __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com