From owner-freebsd-questions Mon Feb 18 23:38:19 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mired.org (dsl-64-192-6-133.telocity.com [64.192.6.133]) by hub.freebsd.org (Postfix) with SMTP id 252EF37B41A for ; Mon, 18 Feb 2002 23:38:04 -0800 (PST) Received: (qmail 64807 invoked by uid 100); 19 Feb 2002 07:38:01 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15474.216.900732.817580@guru.mired.org> Date: Tue, 19 Feb 2002 01:38:00 -0600 To: Balaji Cc: questions@freebsd.org Subject: Re: Has anyone done VFS kernel programming here? In-Reply-To: <33903856@toto.iv> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ From: "Mike Meyer" X-Delivery-Agent: TMDA/0.46 (Python 2.2; freebsd-4.5-STABLE-i386) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Balaji types: > If anyone of u has done some kernel programming with respect to files > in the User space..... Could u please tell me how to acquire the file > structure for a file when you are given the pathname??? Even a uio and > an iovec structure would suffice. Please this is very urgent..... I > need a (struct file *) returned for a given file pathname.... Help me!! Let's see - an iovec is collection of pointers and lengths used to scatter/gather io with a file object. A uio is an iovec along with kernel state space for the same read or write. A struct file is part of the kernel descriptor table, with one for each open vnode or socket. I think you're confused. uio and iovec's are entirely different animals than a struct file. A struct file is associated with an open vnode or socket. An iovec - and any uio wrapped around one - describes an io operation. As matter of fact, there may not *be* a struct file anywhere in the system associated with a given pathname. That makes it sort of hard to give you a general procedure for finding it. Maybe if you told us what you were doing, instead of asking for things that aren't there, we can help you get there. http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message