From owner-freebsd-hackers Tue Jan 21 3: 8:37 2003 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 16DD037B401 for ; Tue, 21 Jan 2003 03:08:36 -0800 (PST) Received: from HAL9000.homeunix.com (12-233-57-224.client.attbi.com [12.233.57.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id 58B4A43F5F for ; Tue, 21 Jan 2003 03:08:35 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.6/8.12.5) with ESMTP id h0LB8Y0L007216; Tue, 21 Jan 2003 03:08:34 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.6/8.12.5/Submit) id h0LB8YCY007215; Tue, 21 Jan 2003 03:08:34 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Date: Tue, 21 Jan 2003 03:08:34 -0800 From: David Schultz To: Mark Santcroos Cc: hackers@FreeBSD.ORG Subject: Re: nswap Message-ID: <20030121110834.GA6842@HAL9000.homeunix.com> Mail-Followup-To: Mark Santcroos , hackers@FreeBSD.ORG References: <20030117000917.GA7277@laptop.6bone.nl> <20030117232729.GA5908@HAL9000.homeunix.com> <20030120145205.GA4911@laptop.6bone.nl> <20030120190936.GA3192@HAL9000.homeunix.com> <20030121074128.GA880@laptop.6bone.nl> <20030121093301.GB6497@HAL9000.homeunix.com> <20030121093942.GD620@laptop.6bone.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030121093942.GD620@laptop.6bone.nl> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Thus spake Mark Santcroos : > On Tue, Jan 21, 2003 at 01:33:01AM -0800, David Schultz wrote: > > Thus spake Mark Santcroos : > > > Yes, that is also what I meant. We now have a swapoff() system call that > > > does all the work itself. > > > > > > My idea was to split that up: > > > > > > /* turn of swap device */ > > > static int swapoff_one(struct swdevt *sp) > > > { > > > /* Do all things that we don't want to know about outside this function > > > */ > > > } > > > > > > /* turn off all swap devices */ > > > int swapoff_all() > > > { > > > int index; > > > struct swdevt *sp; > > > > > > for (sp = swdevt, index = 0; index < nswdev; index++, sp++) > > > swapoff_one(sp); > > > } > > > > > > So the swapoff() system call would call swapoff_one() and my code in > > > kern/kern_swsuspend.c would call swapoff_all(). > > > > See swapoff(8), in particular the -a flag. > > I'm aware of that, but imho it doesn't suite my purpose. Are you strongly > against having such code inside the kernel? In that case, I'm not sure I understand what you're trying to do. There's already a sysctl interface to get the names of all the swap devices in the system, and from there you can call swapoff(2) on each one. Anyway, it doesn't really bother me to add similar functionality to the kernel if that seems useful, but it's also not my decision. Perhaps if you posted patches, someone could make more specific comments. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message