]> git.neil.brown.name Git - lafs-utils.git/commitdiff
mkfs: add accesstime file to new filesystem
authorNeilBrown <neilb@suse.de>
Wed, 2 Mar 2011 22:44:45 +0000 (09:44 +1100)
committerNeilBrown <neilb@suse.de>
Wed, 2 Mar 2011 22:44:45 +0000 (09:44 +1100)
But allow this to be suppressed with --no-atime-file

Signed-off-by: NeilBrown <neilb@suse.de>
tools/mkfs.lafs.c

index 2986d589fa698e3f7758d31671d427c601780754..f3a5157e26d49239c4ac99ec4797ddb669f8546b 100644 (file)
@@ -61,6 +61,7 @@ enum {
        opt_segsize = 1000,
        opt_width,
        opt_stride,
+       opt_noatime,
 };
 
 char short_options[] = "-b:Vvh";
@@ -72,6 +73,7 @@ struct option long_options[] = {
        {"version",      0, 0, 'V'},
        {"verbose",      0, 0, 'v'},
        {"help",         0, 0, 'h'},
+       {"no-atime-file",0, 0, opt_noatime},
        {0, 0, 0, 0}
 };
 
@@ -277,11 +279,13 @@ int main(int argc, char *argv[])
        long stride_bytes = 0;
        long long device_bytes;
        char *devname = NULL;
+       int create_atime = 1;
        int opt;
        int dev_fd;
        struct lafs *lafs;
        struct lafs_device *dev;
        struct lafs_ino *ifile, *imfile, *rootdir, *orphans, *segmap;
+       struct lafs_ino *atimefile = NULL;
 
        while ((opt = getopt_long(argc, argv,
                                  short_options, long_options,
@@ -309,6 +313,9 @@ int main(int argc, char *argv[])
                case opt_width:
                        get_num(&width, optarg, "device width");
                        break;
+               case opt_noatime:
+                       create_atime = 0;
+                       break;
 
                case 1:
                        if (devname == NULL) {
@@ -358,6 +365,8 @@ int main(int argc, char *argv[])
        ifile = lafs_get_itable(lafs);
        imfile = lafs_add_inode(ifile, 1, TypeInodeMap);
        rootdir = lafs_add_inode(ifile, 2, TypeDir);
+       if (create_atime)
+               atimefile = lafs_add_inode(ifile, 3, TypeAccessTime);
        rootdir->md.file.linkcount = 2;
        rootdir->md.file.mode = 0755;
        rootdir->md.file.parent = 2;