lkml.org 
[lkml]   [2004]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] cowlinks v2
    On Sat, 3 April 2004 12:47:58 -0700, Eric W. Biederman wrote:
    >
    > And a few scenarios to hopefully make things clear.
    >
    > So your fs starts out as:
    >
    > /file1 -> ino1 (link count 2) -> data block #1
    > /file2 -> ino1 (link count 2) -> data block #1
    >
    > file1 is only 4K long, so I only need to describe one data block.
    >
    > Actions:
    >
    > cowcopy(file2, file3):
    >
    > /file1 -> ino1 (link count 2) -> ino2 (link count 2) -> data block #1
    > /file2 -> ino1 (link count 2) -> ino2 (link count 2) -> data block #1
    > /file3 -> ino3 (link count 1) -> ino2 (link count 2) -> data block #1
    >
    >
    > copyfile(file3, file4):
    >
    > /file1 -> ino1 (link count 2) -> ino2 (link count 3) -> data block #1
    > /file2 -> ino1 (link count 2) -> ino2 (link count 3) -> data block #1
    > /file3 -> ino3 (link count 1) -> ino2 (link count 3) -> data block #1
    > /file4 -> ino4 (link count 1) -> ino2 (link count 3) -> data block #1
    >
    > unlink(file2):
    >
    > /file1 -> ino1 (link count 1) -> ino2 (link count 3) -> data block #1
    > /file3 -> ino3 (link count 1) -> ino2 (link count 3) -> data block #1
    > /file4 -> ino4 (link count 1) -> ino2 (link count 3) -> data block #1
    >
    > link(file4, file5):
    >
    > /file1 -> ino1 (link count 1) -> ino2 (link count 3) -> data block #1
    > /file3 -> ino3 (link count 1) -> ino2 (link count 3) -> data block #1
    > /file4 -> ino4 (link count 2) -> ino2 (link count 3) -> data block #1
    > /file5 -> ino4 (link count 2) -> ino2 (link count 3) -> data block #1
    >
    > write(file3):
    >
    > /file1 -> ino1 (link count 1) -> ino2 (link count 2) -> data block #1
    > /file3 -> ino3 (link count 1) -> data block #2
    > /file4 -> ino4 (link count 2) -> ino2 (link count 2) -> data block #1
    > /file5 -> ino4 (link count 2) -> ino2 (link count 2) -> data block #1
    >
    > write(file5):
    >
    > /file1 -> ino1 (link count 1) -> ino2 (link count 1) -> data block #1
    > /file3 -> ino3 (link count 1) -> data block #2
    > /file4 -> ino4 (link count 2) -> data block #3
    > /file5 -> ino4 (link count 2) -> data block #3
    >
    > write(file1):
    >
    > /file1 -> ino1 (link count 1) -> data block #1 (with modified contents)
    > /file3 -> ino3 (link count 1) -> data block #2
    > /file4 -> ino4 (link count 2) -> data block #3
    > /file5 -> ino4 (link count 2) -> data block #3
    >
    > Does this make things clear?

    Almost. What exactly do cowcopy() and copyfile() do? They look the
    same, so why the difference?

    Jörn

    --
    The story so far:
    In the beginning the Universe was created. This has made a lot
    of people very angry and been widely regarded as a bad move.
    -- Douglas Adams?
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 14:02    [W:0.026 / U:149.888 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site