[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTilBJHoIUxbOI1RpBtBXLulcuv8VrSe6Vhwxegli@mail.gmail.com>
Date: Tue, 22 Jun 2010 11:56:24 +0300
From: "Amir G." <amir73il@...rs.sourceforge.net>
To: Andreas Dilger <andreas.dilger@...cle.com>
Cc: Amir Goldstein <amir73il@...rs.sf.net>,
"linux-ext4@...r.kernel.org development" <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH 4/8] e2fsprogs: Next3 snapshot control with chattr/lsattr
-X
On Mon, Jun 21, 2010 at 9:17 PM, Andreas Dilger
<andreas.dilger@...cle.com> wrote:
>> +static struct flags_name snapshot_flags_array[] = {
>> + { NEXT3_SNAPFILE_LIST_FL, "S", "on_liSt" },
>> + { NEXT3_SNAPFILE_ENABLED_FL, "n", "eNabled" },
>> + { NEXT3_SNAPFILE_ACTIVE_FL, "a", "Active" },
>> + { NEXT3_SNAPFILE_INUSE_FL, "p", "inuse_by_Previous" },
>> + { NEXT3_SNAPFILE_DELETED_FL, "s", "Deleted" },
>> + { NEXT3_SNAPFILE_SHRUNK_FL, "h", "sHrunk" },
>> + { NEXT3_SNAPFILE_OPEN_FL, "o", "mOunted" },
>> + { NEXT3_SNAPFILE_TAGGED_FL, "t", "Tagged" },
>> { 0, NULL, NULL }
>> };
>
> While clever, I don't think this necessarily makes for a good user interface.
> In comparison, flags "l, e, a, i, d, s, m ,t" respectively make much easier to understand/remember name abbreviations.
>
I must show you the beauty of the 'S','n','a','p','s','h','o','t'
flags, because I grew very fond of them.
Here is a list of 4 snapshots for example:
Snapshots list:
id inode attributes disk-usage mtime filename
---------------------------------------------
44 277994 Snap--o- 7.3M Jun 14 16:50 /var/vol/2/.ctera/snapshots/4
43 277993 S--psh-- 12.0K Jun 14 16:50 /var/vol/2/.ctera/snapshots/3
42 277992 ----sh-- 0 Jun 14 16:50 /var/vol/2/.ctera/snapshots/2
41 277991 Sn----o- 1.2M Jun 14 16:50 /var/vol/2/.ctera/snapshots/1
.
The capital S is a graphical representation of the snapshots list chains
(snapshot 2 was removed from the list after all its blocks were merged
into snapshot 1).
Both snapshots 2 and 3 were SHrunk, which is represented by the flag pair 'sh'
(the flag 's' alone represents a temporary transitional state before 'sh').
Both snapshots files 1 and 4 have been Opened by losetup (i.e., mounted).
BTW, Ted has suggested to combine the 'n' and 'o' flags (i.e.,
auto-enable on open).
When the snapshot list is sorted by snapshot id, as the script command
'snapshot status' does,
the 'p' flags graphically points towards a previous enabled snapshot,
which is a dependency of this snapshot
(snapshot 4 and snapshot 3 blocks are accessed by mounted snapshot 1 readers)
So far for lsattr -X flags.
As for chattr -X flags, I intend to eliminate those altogether.
As Ted suggested, controlling the 'n' flag, will no longer be needed,
once auto-enable is implemented.
Instead of controlling the 'S' flag for snapshot take/delete, 'take'
will be invoked automatically on create()
of file in a snapshots directory and 'delete' will be invoked on
attempt to unlink() a snapshot file.
See new API design at:
http://sourceforge.net/apps/mediawiki/next3/index.php?title=User-kernel_API
Amir.
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists