RFC Recursive mtime for ext3
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest3 patches 11 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | Recursive mtime for ext3 | +0 | 0 replies | |
| 2/3 | Recursive mtime for ext3fs/ fs/ fs/ +2 more | +4 | 0 replies | |
| 3/3 | Recursive mtime for ext3fs/ fs/ fs/ +4 more | +130 | 11 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC] [PATCH 0/3] Recursive mtime for ext3
Hello,
in following three patches is implemented recursive mtime feature for
ext3. The first two patches are mostly clean-up patches, the third patch implements the feature itself. If somebody is interested in testing this (or even writing a support of this feature in rsync and similar), please contact me. Attached are sources of simple tools set_recmod, get_recmod for testing the feature and also a patch implementing basic support of the feature in e2fsprogs. Comments welcome.
Honza
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <sys/ioctl.h>
#include <linux/fs.h>
#include <linux/ext2_fs.h>
#define EXT2_IOC_GETRTIME _IOR('f', 9, unsigned int)
#define S_RECMOD 0x100000
int main(int argc, char **argv)
{
int fd;
long flags;
if (argc < 2)
return 1;
fd = open(argv[1], O_RDONLY);
if (fd < 0) {
printf("Cannot open: %m\n");
return 1;
}
if (ioctl(fd, EXT2_IOC_GETFLAGS, &flags) < 0) {
printf("Cannot get flags: %m\n");
return 1;
}
flags |= S_RECMOD;
if (ioctl(fd, EXT2_IOC_SETFLAGS, &flags) < 0) {
printf("Cannot set flags: %m\n");
return 1;
}
return 0;
}#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <sys/ioctl.h>
#include <linux/fs.h>
#include <linux/ext2_fs.h>
#define EXT2_IOC_GETRTIME _IOR('f', 9, unsigned int)
#define S_RECMOD 0x100000
int main(int argc, char **argv)
{
int fd;
long flags;
unsigned time;
if (argc < 2)
return 1;
fd = open(argv[1], O_RDONLY);
if (fd < 0) {
printf("Cannot open: %m\n");
return 1;
}
if (ioctl(fd, EXT2_IOC_GETFLAGS, &flags) < 0) {
printf("Cannot get flags: %m\n");
return 1;
}
if (ioctl(fd, EXT2_IOC_GETRTIME, &time) < 0) {
printf("Cannot get rtime: %s\n", strerror(errno));
return 1;
}
printf("RECMOD flags: %d, time %u\n", !!(flags & S_RECMOD), time);
return 0;
}lib/e2p/feature.c +2 -0
@@ -37,6 +37,8 @@ static struct feature feature_list[] = { "resize_inode" }, {E2P_FEATURE_COMPAT ,EXT2_FEATURE_COMPAT_LAZY_BG , "lazy_bg" }, + { E2P_FEATURE_COMPAT, EXT2_FEATURE_COMPAT_RTIME, + "recursive_mtime" }, { E2P_FEATURE_RO_INCOMPAT, EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER, "sparse_super" },
lib/ext2fs/ext2_fs.h +1 -0
@@ -623,6 +623,7 @@ struct ext2_super_block {#define EXT2_FEATURE_COMPAT_RESIZE_INODE 0x0010#define EXT2_FEATURE_COMPAT_DIR_INDEX 0x0020#define EXT2_FEATURE_COMPAT_LAZY_BG 0x0040 +#define EXT2_FEATURE_COMPAT_RTIME 0x0080#define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001#define EXT2_FEATURE_RO_COMPAT_LARGE_FILE 0x0002
lib/ext2fs/ext2fs.h +2 -1
@@ -418,7 +418,8 @@ typedef struct ext2_icount *ext2_icount_ EXT2_FEATURE_COMPAT_RESIZE_INODE|\ EXT2_FEATURE_COMPAT_DIR_INDEX|\ EXT2_FEATURE_COMPAT_LAZY_BG|\ - EXT2_FEATURE_COMPAT_EXT_ATTR) + EXT2_FEATURE_COMPAT_EXT_ATTR|\ + EXT2_FEATURE_COMPAT_RTIME)/* This #ifdef is temporary until compression is fully supported */ #ifdef ENABLE_COMPRESSION
misc/mke2fs.c +2 -1
@@ -870,7 +870,8 @@ static __u32 ok_features[3] = {EXT3_FEATURE_COMPAT_HAS_JOURNAL |EXT2_FEATURE_COMPAT_RESIZE_INODE |EXT2_FEATURE_COMPAT_DIR_INDEX | -EXT2_FEATURE_COMPAT_LAZY_BG ,/* Compat */ +EXT2_FEATURE_COMPAT_LAZY_BG | +EXT2_FEATURE_COMPAT_RTIME ,/* Compat */ EXT2_FEATURE_INCOMPAT_FILETYPE |/* Incompat */ EXT3_FEATURE_INCOMPAT_JOURNAL_DEV | EXT2_FEATURE_INCOMPAT_META_BG,
misc/tune2fs.c +2 -1
@@ -96,7 +96,8 @@ static void usage(void)static __u32 ok_features[3 ] = {EXT3_FEATURE_COMPAT_HAS_JOURNAL | -EXT2_FEATURE_COMPAT_DIR_INDEX ,/* Compat */ +EXT2_FEATURE_COMPAT_DIR_INDEX | +EXT2_FEATURE_COMPAT_RTIME ,/* Compat */ EXT2_FEATURE_INCOMPAT_FILETYPE ,/* Incompat */ EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER /* R/O compat */ };