Re: [PATCH 4/8] e2fsprogs: Next3 snapshot control with chattr/lsattr -X

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Amir G.
Date: Tuesday, June 22, 2010 - 1:56 am

On Mon, Jun 21, 2010 at 9:17 PM, Andreas Dilger
<andreas.dilger@oracle.com> wrote:

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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 4/8] e2fsprogs: Next3 snapshot control with cha ..., Amir G., (Tue Jun 22, 1:56 am)