Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 08 Dec 2008 11:20:24 +0100
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        Joe Marcus Clarke <marcus@FreeBSD.org>
Cc:        arch@FreeBSD.org
Subject:   Re: RFC: New VOP to translate vnode to its component name
Message-ID:  <86tz9fynmf.fsf@ds4.des.no>
In-Reply-To: <1228667168.69753.16.camel@shumai.marcuscom.com> (Joe Marcus Clarke's message of "Sun, 07 Dec 2008 11:26:08 -0500")
References:  <1228667168.69753.16.camel@shumai.marcuscom.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Joe Marcus Clarke <marcus@FreeBSD.org> writes:
> Here is a patch to HEAD, along with a man page, for VOP_CNP.  VOP_CNP
> translates a vnode to its component name.  It is currently called from
> vn_fullpath1() to traverse a vnode hierarchy when cache lookups for
> those vnodes fail.  I have currently implemented VOP_CNP for devfs and
> pseudofs.  Kostik has thoroughly reviewed the devfs implementation.  I
> only recently did the pseudofs implementation at his request.

I would prefer pidbuf[PFS_NAMLEN] to pidbuf[11], and you can avoid two
strlen()s by storing the return value from snprintf().  Also, defining
pidbuf at the start of the block instead of the start of the function is
a style(9) violation.  Other than that, the pseudofs part of the patch
has my approval.

BTW, snprintf(buf, buflen, "%d", i) is so common in the kernel that we
should consider adding some sort of itoa(9) to avoid the overhead of
snprintf(9).

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86tz9fynmf.fsf>