From owner-freebsd-fs@FreeBSD.ORG Sun Feb 13 21:39:51 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBA69106566B for ; Sun, 13 Feb 2011 21:39:51 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 5485F8FC15 for ; Sun, 13 Feb 2011 21:39:50 +0000 (UTC) Received: by wwf26 with SMTP id 26so4159852wwf.31 for ; Sun, 13 Feb 2011 13:39:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=mAL2nzV/hdT3a6Ji6RzRMGsmLNGl04fGQjN+tUW6nAY=; b=bnGOMr0xgOLwXXRHN+HYbcuWRw3HOqB9rkmpXcQekctEpMmKsPOtLX4GxwZ0kbv+g5 c+5zYJeNKQOR6k9CGaE2wPvJXtfoYbRQ0EdQw5R7t3n0T4qATkQMLCBxeeDHtgjxqbYo XHr9E6fGuv2p5SuE84ay41QyPshX54q1id+tU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=XI0pT62B85XR+2FW5KoNUnbO7lLMiBOPz48WPJdefYX8NqQwhflSLNKY9iYinwcy5m /kId/tRAzqBJZfpiQJ6mxOG2qeplsOXhJhtqK35fxgVsxS0ulY7zrs/nTOTKjuY2dkGt EiYeVhCWV1eH5mTANsM4u6qvyX9XaXCnuUwto= MIME-Version: 1.0 Received: by 10.216.63.138 with SMTP id a10mr41286wed.27.1297633189995; Sun, 13 Feb 2011 13:39:49 -0800 (PST) Received: by 10.216.71.200 with HTTP; Sun, 13 Feb 2011 13:39:49 -0800 (PST) Date: Sun, 13 Feb 2011 13:39:49 -0800 Message-ID: From: Garrett Cooper To: freebsd-fs@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: The history behind the undocumented NetBSD stat syscalls? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2011 21:39:51 -0000 Hi FS folks, I was poking through vfs_syscalls.c and I noticed that there was a syscall called nlstat, and nstat, and a kernel-public only helper function called cvtnstat: These aren't used anywhere in our source tree (I trimmed out the false positives -- i.e. connstat and instat), minus their declarations in kern/vfs_syscalls.c, etc: $ svngrep -Er 'nl?stat\(' /usr/src/ /usr/src/sys/kern/kern_descrip.c: cvtnstat(&ub, &nub); /usr/src/sys/kern/syscalls.master:278 AUE_STAT STD { int nstat(char *path, struct nstat *ub); } /usr/src/sys/kern/syscalls.master:280 AUE_LSTAT STD { int nlstat(char *path, struct nstat *ub); } /usr/src/sys/kern/vfs_syscalls.c:cvtnstat(sb, nsb) /usr/src/sys/kern/vfs_syscalls.c:nstat(td, uap) /usr/src/sys/kern/vfs_syscalls.c: cvtnstat(&sb, &nsb); /usr/src/sys/kern/vfs_syscalls.c:nlstat(td, uap) /usr/src/sys/kern/vfs_syscalls.c: cvtnstat(&sb, &nsb); /usr/src/sys/compat/freebsd32/syscalls.master:278 AUE_STAT NOPROTO{ int nstat(char *path, struct nstat *ub); } /usr/src/sys/compat/freebsd32/syscalls.master:280 AUE_LSTAT NOPROTO{ int nlstat(char *path, struct nstat *ub); } /usr/src/sys/sys/vnode.h:void cvtnstat(struct stat *sb, struct nstat *nsb); /usr/src/sys/sys/sysproto.h:int nstat(struct thread *, struct nstat_args *); /usr/src/sys/sys/sysproto.h:int nlstat(struct thread *, struct nlstat_args *); And seems like it should be superseded by lstat, et all, which were introduced a little earlier on [1]. Do they serve a real purpose of some kind today? It was introduced in the revision seen in SVN here [2], and looking back in time there isn't reference to a NetBSD compat layer in sys/conf/options [3], etc, so I was a bit curious why there are dangling undocumented (but publicly visible via sysproto.h) VFS-related syscalls entries hanging around (in particular because the syscalls aren't declared that way in NetBSD either). Thanks! -Garrett 1. http://svn.freebsd.org/viewvc/base/head/sys/kern/vfs_syscalls.c?revision=24438&view=markup 2. http://svn.freebsd.org/viewvc/base/head/sys/kern/vfs_syscalls.c?revision=35938&view=markup 3. http://svn.freebsd.org/viewvc/base/head/sys/conf/options?view=log