diff options
author | David Sterba <dsterba@suse.com> | 2022-05-17 16:50:30 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-07-25 17:45:38 +0200 |
commit | 22a5b2abb7340cb05a34eb47d0271a6714cf5e3f (patch) | |
tree | 0f28860a1809e12f02fa2d7985000d082c76ddc6 /fs/btrfs/send.c | |
parent | btrfs: output mirror number for bad metadata (diff) | |
download | linux-22a5b2abb7340cb05a34eb47d0271a6714cf5e3f.tar.xz linux-22a5b2abb7340cb05a34eb47d0271a6714cf5e3f.zip |
btrfs: send: add OTIME as utimes attribute for proto 2+ by default
When send v1 was introduced the otime (inode creation time) was not
available, however the attribute in btrfs send protocol exists. Though
it would be possible to add it for v1 too as the attribute would be
ignored by v1 receive, let's not change the layout of v1 and only add
that to v2+. The otime cannot be changed and is only informative.
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/send.c')
-rw-r--r-- | fs/btrfs/send.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index d31cd39edff4..c2c429005e73 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -2580,7 +2580,8 @@ static int send_utimes(struct send_ctx *sctx, u64 ino, u64 gen) TLV_PUT_BTRFS_TIMESPEC(sctx, BTRFS_SEND_A_ATIME, eb, &ii->atime); TLV_PUT_BTRFS_TIMESPEC(sctx, BTRFS_SEND_A_MTIME, eb, &ii->mtime); TLV_PUT_BTRFS_TIMESPEC(sctx, BTRFS_SEND_A_CTIME, eb, &ii->ctime); - /* TODO Add otime support when the otime patches get into upstream */ + if (sctx->proto >= 2) + TLV_PUT_BTRFS_TIMESPEC(sctx, BTRFS_SEND_A_OTIME, eb, &ii->otime); ret = send_cmd(sctx); |