From: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
To: Sytse Wielinga <s.b.wielinga@student.utwente.nl>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH for testing] cow behaviour for hard links
Date: Fri, 12 Mar 2004 19:18:28 +0100 [thread overview]
Message-ID: <20040312181828.GA7087@wohnheim.fh-wedel.de> (raw)
In-Reply-To: <200403121849.03505.s.b.wielinga@student.utwente.nl>
On Fri, 12 March 2004 18:48:57 +0100, Sytse Wielinga wrote:
>
> I'm sorry to say this, but I stumbled upon a prohibitive problem...
>
> The problem is that if a hard link would be broken up, one of the dentry's
> would get a link to a new inode with a new inode number. This would mean that
> right under the nose of the app, the file suddenly gets a new inode number.
> Apps don't like that. If anyone has any suggestion that might make this
> possible please say so, but I don't see it.
Different design. How about this:
- Files with just one link remain as-is.
- Linking a file:
- Create a new inode and move all data into new inode.
- Make old inode a pointer to new inode.
- Create a second pointer to new inode.
- Unlinking a file:
- Unlink pointer inode
- Unlink target inode
- Writing to a pointer inode:
- Make pointer inode a regular one.
- Copy target inode data into former pointer inode.
- Unlink target inode
- If target count was 1, we don't even need to copy.
Or in ascii art:
Regular file:
inode 1
Second link:
inode 1 ---> inode 2
^
inode 3 -----|
Write to inode 1:
inode 1
inode 3 ---> inode 2
Unlink of inode 3:
inode 1
Not quite as simple and straightforward as my first design, but it has
some advantages. Would even be possible to extend it and allow links
across different filesystems.
Jörn
--
A quarrel is quickly settled when deserted by one party; there is
no battle unless there be two.
-- Seneca
next prev parent reply other threads:[~2004-03-12 18:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-10 19:34 Jörn Engel
2004-03-10 19:35 ` [Program " Jörn Engel
2004-03-10 21:34 ` [PATCH " Jamie Lokier
2004-03-10 22:17 ` Jörn Engel
2004-03-10 23:07 ` Sytse Wielinga
2004-03-10 23:46 ` Sytse Wielinga
2004-03-12 17:48 ` Sytse Wielinga
2004-03-12 18:18 ` Jörn Engel [this message]
2004-03-12 18:29 ` Jörn Engel
2004-03-13 13:43 ` Pavel Machek
2004-03-13 19:48 ` Jörn Engel
2004-03-13 21:03 ` Pavel Machek
2004-03-15 7:45 ` Jamie Lokier
2004-03-15 10:27 ` Jörn Engel
2004-03-13 22:14 ` Jörn Engel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040312181828.GA7087@wohnheim.fh-wedel.de \
--to=joern@wohnheim.fh-wedel.de \
--cc=linux-kernel@vger.kernel.org \
--cc=s.b.wielinga@student.utwente.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®