Date: Tue, 19 Feb 2002 01:38:00 -0600 From: "Mike Meyer" <mwm-dated-1014536281.2bfaf3@mired.org> To: Balaji <balajibsd@yahoo.com> Cc: questions@freebsd.org Subject: Re: Has anyone done VFS kernel programming here? Message-ID: <15474.216.900732.817580@guru.mired.org> In-Reply-To: <33903856@toto.iv>
next in thread | previous in thread | raw e-mail | index | archive | help
Balaji <balajibsd@yahoo.com> 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. <mike -- Mike Meyer <mwm@mired.org> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15474.216.900732.817580>