aboutsummaryrefslogtreecommitdiff
path: root/e2fsprogs/old_e2fsprogs/ext2fs/newdir.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2015-07-19 23:12:51 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2015-07-19 23:12:51 +0200
commitce193f809b32368796a3aacf2ac8ba277f4c102a (patch)
tree6528caca18ddaf19d1326329ee4ab83dcd46f1ee /e2fsprogs/old_e2fsprogs/ext2fs/newdir.c
parentd840c5d139cfa50fbe4f6f67c178b0edf0c690c8 (diff)
downloadbusybox-ce193f809b32368796a3aacf2ac8ba277f4c102a.tar.gz
Remove old_e2fsprogs/*
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'e2fsprogs/old_e2fsprogs/ext2fs/newdir.c')
-rw-r--r--e2fsprogs/old_e2fsprogs/ext2fs/newdir.c72
1 files changed, 0 insertions, 72 deletions
diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/newdir.c b/e2fsprogs/old_e2fsprogs/ext2fs/newdir.c
deleted file mode 100644
index 9f156626d..000000000
--- a/e2fsprogs/old_e2fsprogs/ext2fs/newdir.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* vi: set sw=4 ts=4: */
-/*
- * newdir.c --- create a new directory block
- *
- * Copyright (C) 1994, 1995 Theodore Ts'o.
- *
- * %Begin-Header%
- * This file may be redistributed under the terms of the GNU Public
- * License.
- * %End-Header%
- */
-
-#include <stdio.h>
-#include <string.h>
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include "ext2_fs.h"
-#include "ext2fs.h"
-
-#ifndef EXT2_FT_DIR
-#define EXT2_FT_DIR 2
-#endif
-
-/*
- * Create new directory block
- */
-errcode_t ext2fs_new_dir_block(ext2_filsys fs, ext2_ino_t dir_ino,
- ext2_ino_t parent_ino, char **block)
-{
- struct ext2_dir_entry *dir = NULL;
- errcode_t retval;
- char *buf;
- int rec_len;
- int filetype = 0;
-
- EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
-
- retval = ext2fs_get_mem(fs->blocksize, &buf);
- if (retval)
- return retval;
- memset(buf, 0, fs->blocksize);
- dir = (struct ext2_dir_entry *) buf;
- dir->rec_len = fs->blocksize;
-
- if (dir_ino) {
- if (fs->super->s_feature_incompat &
- EXT2_FEATURE_INCOMPAT_FILETYPE)
- filetype = EXT2_FT_DIR << 8;
- /*
- * Set up entry for '.'
- */
- dir->inode = dir_ino;
- dir->name_len = 1 | filetype;
- dir->name[0] = '.';
- rec_len = dir->rec_len - EXT2_DIR_REC_LEN(1);
- dir->rec_len = EXT2_DIR_REC_LEN(1);
-
- /*
- * Set up entry for '..'
- */
- dir = (struct ext2_dir_entry *) (buf + dir->rec_len);
- dir->rec_len = rec_len;
- dir->inode = parent_ino;
- dir->name_len = 2 | filetype;
- dir->name[0] = '.';
- dir->name[1] = '.';
- }
- *block = buf;
- return 0;
-}