From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 7 09:30:10 2004 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 5CA9716A4CF for ; Thu, 7 Oct 2004 09:30:10 +0000 (GMT) Received: from comsys.ntu-kpi.kiev.ua (comsys.ntu-kpi.kiev.ua [194.125.244.127]) by mx1.FreeBSD.org (Postfix) with ESMTP id DEF0043D2F for ; Thu, 7 Oct 2004 09:30:07 +0000 (GMT) (envelope-from simon@comsys.ntu-kpi.kiev.ua) Received: from pm514-9.comsys.ntu-kpi.kiev.ua (pm514-9.comsys.ntu-kpi.kiev.ua [10.18.54.109]) (authenticated bits=0)i97CbBeo031015 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 7 Oct 2004 12:37:11 GMT Received: by pm514-9.comsys.ntu-kpi.kiev.ua (Postfix, from userid 1000) id 8F5F6A7; Thu, 7 Oct 2004 12:29:52 +0300 (EEST) Date: Thu, 7 Oct 2004 12:29:52 +0300 From: Andrey Simonenko To: hackers@freebsd.org Message-ID: <20041007092952.GA658@pm514-9.comsys.ntu-kpi.kiev.ua> References: <20041006193350.GA8867@rucus.ru.ac.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041006193350.GA8867@rucus.ru.ac.za> User-Agent: Mutt/1.4.2.1i Subject: Re: Where to start for someone new to kernel coding 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, 07 Oct 2004 09:30:10 -0000 On Wed, Oct 06, 2004 at 09:33:50PM +0200, John Oxley wrote: > > I want to extend the disk quota system: > - Implement a user space daemon to control it. > - Pass control from the kernel to the user space daemon. [skipped] > Is this at all possible, and if so, where should I start looking for > coding with the kernel. Quota checks are implemented in chk*() functions from the sys/ufs/ufs/ufs_quota.c file. If you want to implement your idea as a replacement of existing QUOTA, then you need to modify this file and probably some others. It is also possible to change addresses of these functions, but this is a hack. Another way is using stackable VFS or MAC framework. In these approaches your module will have control before actual FS code is called. And a module can decide what to do: use already loaded own quota policy in the kernel or send a message to a process, which will decide what to do and send a reply back to your module.