From: NeilBrown Date: Wed, 2 Mar 2011 22:44:45 +0000 (+1100) Subject: mkfs: add accesstime file to new filesystem X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=c03853c686ccc241bf8c9c21e8f2a74a9a976158;p=lafs-utils.git mkfs: add accesstime file to new filesystem But allow this to be suppressed with --no-atime-file Signed-off-by: NeilBrown --- diff --git a/tools/mkfs.lafs.c b/tools/mkfs.lafs.c index 2986d58..f3a5157 100644 --- a/tools/mkfs.lafs.c +++ b/tools/mkfs.lafs.c @@ -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;