From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Machek Subject: Re: Finding hardlinks Date: Fri, 29 Dec 2006 10:02:23 +0000 Message-ID: <20061229100223.GF3955@ucw.cz> References: <20061221185850.GA16807@delft.aura.cs.cmu.edu> <1166869106.3281.587.camel@laptopd505.fenrus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Arjan van de Ven , Jan Harkes , Miklos Szeredi , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Return-path: Received: from gprs189-60.eurotel.cz ([160.218.189.60]:4662 "EHLO spitz.ucw.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755234AbXAAQ3E (ORCPT ); Mon, 1 Jan 2007 11:29:04 -0500 To: Mikulas Patocka Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Hi! > >>If user (or script) doesn't specify that flag, it > >>doesn't help. I think > >>the best solution for these filesystems would be > >>either to add new syscall > >> int is_hardlink(char *filename1, char *filename2) > >>(but I know adding syscall bloat may be objectionable) > > > >it's also the wrong api; the filenames may have been > >changed under you > >just as you return from this call, so it really is a > >"was_hardlink_at_some_point()" as you specify it. > >If you make it work on fd's.. it has a chance at least. > > Yes, but it doesn't matter --- if the tree changes under > "cp -a" command, no one guarantees you what you get. > int fis_hardlink(int handle1, int handle 2); > Is another possibility but it can't detect hardlinked > symlinks. Ugh. Is it even legal to hardlink symlinks? Anyway, cp -a is not the only application that wants to do hardlink detection. Pavel -- Thanks for all the (sleeping) penguins.