From owner-freebsd-hackers@freebsd.org Wed Nov 11 20:08:07 2015 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86FFAA2BE0C for ; Wed, 11 Nov 2015 20:08:07 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yk0-f181.google.com (mail-yk0-f181.google.com [209.85.160.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47E7F1CD6 for ; Wed, 11 Nov 2015 20:08:06 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by ykba77 with SMTP id a77so67749338ykb.2 for ; Wed, 11 Nov 2015 12:08:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=rB1ClKAYQjVNZF4txwfioMzyViJLL7OGufVGs2UxpKA=; b=KmDvj9pGu+QeIPF4P5PEKMDADlQfA9rg/tw7LJ523J9asvO7hkmDwxhYvZHGDIWwQp frrPy3FAxGYmfbUV8bw4ap6lMZzfG/3LCWof+4eDo8yQDELIBvrUB3o+MmB9EIqH3jOr 71IF+PIHg+1QBsXLa1OBonXh30si94J8hvbYuYuuvp1j6NoO88DKPQB+2xb6bPZc5MeD i+0JQ1Z//xfMOmdyvHZFZPlKU0nzEshtN9UDT97H/cJjXf3JbKRvJiwyyRLcHvMQ37vF zmGopDvY0tYUg9J4KTdrnO0TRgUQDuR5dH79Eyqz30E+nfp24BOoBMvu2zy8mFO7i0+s b+9A== X-Received: by 10.13.213.134 with SMTP id x128mr1897299ywd.139.1447272083485; Wed, 11 Nov 2015 12:01:23 -0800 (PST) Received: from mail-yk0-f175.google.com (mail-yk0-f175.google.com. [209.85.160.175]) by smtp.gmail.com with ESMTPSA id e64sm12432458ywb.25.2015.11.11.12.01.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Nov 2015 12:01:23 -0800 (PST) Received: by ykfs79 with SMTP id s79so67799792ykf.1 for ; Wed, 11 Nov 2015 12:01:22 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.129.13.213 with SMTP id 204mr12642748ywn.281.1447272082795; Wed, 11 Nov 2015 12:01:22 -0800 (PST) Reply-To: cem@FreeBSD.org Received: by 10.37.17.2 with HTTP; Wed, 11 Nov 2015 12:01:22 -0800 (PST) In-Reply-To: <20151111193612.GG2257@kib.kiev.ua> References: <5641A2A5.7070909@gmail.com> <20151110081421.GL2257@kib.kiev.ua> <56426054.2070007@gmail.com> <20151111105656.GX2257@kib.kiev.ua> <20151111193612.GG2257@kib.kiev.ua> Date: Wed, 11 Nov 2015 12:01:22 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Detecting new file name after receiving kevent's NOTE_RENAME From: Conrad Meyer To: Konstantin Belousov Cc: Ivan Radovanovic , FreeBSD Hackers Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 20:08:07 -0000 On Wed, Nov 11, 2015 at 11:36 AM, Konstantin Belousov wrote: > VOP_VPTOCNP() still must get the data somewhere. It is usually easy to > provide the name for a synthetic file system, where the data is fully > controlled by the filesystem. Also, it is always possible to provide the > name for a directory on any unix-like filesystem, due to dotdot. Both > cases are what handled by fs-specific implementations of VOP_VPTOCNP() > and by the default code. > > For the rest, you e.g. must be able to answer with the name for regular > inode on UFS, given the inode number. If you can provide such code, I > will be quite amazed. I'm not sure what you're talking about. To have a NOTE_RENAME monitor as originally discussed, the userspace program must have an fd open to the vnode. With a vnode, the boring generic vn_fullpath and vop_stdvptocnp can find a whole path using .. and directory traversal. It may not be fast, but it is possible. Conrad