From owner-freebsd-arch@FreeBSD.ORG Mon Oct 31 21:22:01 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55CCB1065670; Mon, 31 Oct 2011 21:22:01 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 014CB8FC13; Mon, 31 Oct 2011 21:22:00 +0000 (UTC) Received: by qadz32 with SMTP id z32so7160210qad.13 for ; Mon, 31 Oct 2011 14:22:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=4hJsPLvdFaBmVOy0Nm4aTmKOCXPfpOdqBHuKWlbQ0iw=; b=KOoqQ+K0pYFBE7wmMvTCtHd2np6wuDOcrxAxIkmfMbeVybicWCgpcZjL71tG8fnsPj yHnXihMX5aRI2Rp9ScOM2hZrHcYbXqU2E5ZG+KjWnLKtiu2qWKa7jvBireL+MMP3E6Yi Gt8Ea6XV5GFQOl3yZFMrS651FcRlel5VHxgBI= MIME-Version: 1.0 Received: by 10.182.41.4 with SMTP id b4mr3257532obl.76.1320096120045; Mon, 31 Oct 2011 14:22:00 -0700 (PDT) Received: by 10.182.122.33 with HTTP; Mon, 31 Oct 2011 14:22:00 -0700 (PDT) In-Reply-To: <201110311717.53476.jhb@freebsd.org> References: <201110281426.00013.jhb@freebsd.org> <201110311024.07580.jhb@freebsd.org> <20111031190359.GP2258@hoeg.nl> <201110311717.53476.jhb@freebsd.org> Date: Mon, 31 Oct 2011 14:22:00 -0700 Message-ID: From: Garrett Cooper To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Ed Schouten , Jilles Tjoelker , arch@freebsd.org Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 21:22:01 -0000 On Mon, Oct 31, 2011 at 2:17 PM, John Baldwin wrote: > On Monday, October 31, 2011 3:03:59 pm Ed Schouten wrote: >> Hi John, >> >> * John Baldwin , 20111031 15:24: >> > Existing applications use the name and I find it ugly. =A0(I also wish= we >> > had a plain fallocate() instead of just posix_fallocate().) =A0However= , if >> > other folks prefer not having the wrapper I could update it to use the >> > posix_* name. >> >> I agree with Jilles. It's easier to introduce namespace pollution than >> it is to get rid of it afterwards. If the function is called >> posix_fadvise(), people should just use that. > > They don't. =A0They use fadvise() which is part of Linux's API much as > madvise(2) is part of ours. =A0(See the other fork in this thread.) > >> People are constantly complaining about `Linuxisms' when they want to >> port software to FreeBSD. The word `BSDism' should remain an euphemism. >> ;-) > > I think kqueue() is a useful BSDism. =A0I think the attitude that we shou= ld have > nothing that deviates from an established standard would be harmful if it= was > actually applied. > > I also really do think that posix_*() truly is far uglier to read. =A0In = the > worst case, imagine something like this: > > =A0 =A0 =A0 =A0char *cp; > > =A0 =A0 =A0 =A0cp =3D posix_malloc(posix_strlen(some_string) + 1); > =A0 =A0 =A0 =A0posix_strcpy(cp, s); > =A0 =A0 =A0 =A0posix_printf("%s\n", cp); > > *blech* > > I realize not all symbols will get this treatment, but this will eventual= ly > lead to some ugly code the more it is done. =A0I am fine with fully POSIX= - > compliant code looking ugly, but I'd like for code written for FreeBSD to= not > be quite so clunky. =A0Yes, POSIX wants to use a clean namespace for new > routines going forward, that's fine. =A0However, I think we should provid= e sane > names for our APIs and implement POSIX on top of those. =A0How many folks= have > actually used posix_madvise() instead of madvise()? =A0And do you really = think > posix_fadvise() as a function name is not less orthogonal to madvise() th= an > fadvise()? int fadvise(...); #ifdef _POSIX_SOURCE #define posix_fadvise fadvise #endif Done :P? posix_* IMO is a mistake that really should be controlled via the _POSIX_SOURCE macro. > > > That said, I can update the patch to use the ugly name. =A0Can someone el= se > volunteer to implement a VOP_ADVISE() for UFS that actually does the read= - > ahead (for FADV_WILLNEED) (or for other filesystems for that matter). =A0= ZFS > might need to use a custom FADV_DONTNEED as well.