Skip to contentSkip to conversation

RFE: per-subvolume timestamp that is updated on every change to a subvolume

DISCUSSION Lennart Poettering 3 participants 4 messages Jan 5, 2015 – Jan 6, 2015 Btrfs file system

lore
Share & tools
lore
#0 lore raw

Heya!

I am looking for a nice way to query the overall last modification timestamp of a subvolume. i.e. the most recent mtime of *any* file or directory within a subvolume. Ideally, I think, there was a btrfs_timespec field for this in "struct btrfs_root_item", alas there isn't afaics. Any chance this can be added?

Or is there another workable way to query this value? Maybe determine it from the current generation of a subvolume or so? Is that tracked? Ideas?

Lennart

#1 lore raw
Quoted 11 lines · Lennart Poettering

Heya!

I am looking for a nice way to query the overall last modification timestamp of a subvolume. i.e. the most recent mtime of *any* file or directory within a subvolume. Ideally, I think, there was a btrfs_timespec field for this in "struct btrfs_root_item", alas there isn't afaics. Any chance this can be added?

Or is there another workable way to query this value? Maybe determine it from the current generation of a subvolume or so? Is that tracked? Ideas?

Did you tried with "btrfs subvolume find-new" ?

Quoted 7 lines

Lennart
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
gpg @keyserver.linux.it: Goffredo Baroncelli <kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D  17B2 0EDA 9B37 8B82 E0B5
#2 lore raw
In reply to Lennart Poettering

-------- Original Message --------
Subject: RFE: per-subvolume timestamp that is updated on every change to a subvolume
From: Lennart Poettering <[email protected]>
To: <[email protected]>
Date: 2015年01月06日 01:27

Quoted 7 lines

Heya!

I am looking for a nice way to query the overall last modification timestamp of a subvolume. i.e. the most recent mtime of *any* file or directory within a subvolume. Ideally, I think, there was a btrfs_timespec field for this in "struct btrfs_root_item", alas there isn't afaics. Any chance this can be added?

In fact, btrfs_root_item contains one btrfs_inode_item, which contains the a/c/m/otime. But not sure if it contains the time you need.

I'd better add acmotime output for inode_item in btrfs-debug-tree and try myself.

Thanks,
Qu

Quoted 10 lines

Or is there another workable way to query this value? Maybe determine it from the current generation of a subvolume or so? Is that tracked? Ideas?

Lennart
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

-------- Original Message --------
Subject: Re: RFE: per-subvolume timestamp that is updated on every change to a subvolume
From: Qu Wenruo <[email protected]>
To: Lennart Poettering <[email protected]>, <[email protected]>
Date: 2015年01月06日 14:02

Quoted 13 lines

-------- Original Message --------
Subject: RFE: per-subvolume timestamp that is updated on every change to a subvolume
From: Lennart Poettering <[email protected]>
To: <[email protected]>
Date: 2015年01月06日 01:27

Quoted 7 lines

Heya!

I am looking for a nice way to query the overall last modification timestamp of a subvolume. i.e. the most recent mtime of *any* file or directory within a subvolume. Ideally, I think, there was a btrfs_timespec field for this in "struct btrfs_root_item", alas there isn't afaics. Any chance this can be added?

Quoted 7 lines

In fact, btrfs_root_item contains one btrfs_inode_item, which contains the a/c/m/otime. But not sure if it contains the time you need.

I'd better add acmotime output for inode_item in btrfs-debug-tree and try myself.

Thanks,
Qu

The value in acmotime of the inode_item in root_item is not used, so it seems anyone can use it to record the acmotime for your purpose.

Thanks,
Qu

Quoted 15 lines
Quoted 10 lines

Or is there another workable way to query this value? Maybe determine it from the current generation of a subvolume or so? Is that tracked? Ideas?

Lennart

Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html