diff options
author | Theodore Ts'o <tytso@mit.edu> | 2001-05-09 06:09:12 +0000 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2001-05-09 06:09:12 +0000 |
commit | 085cb19a55aa45e9959d55098295355bb87b43f5 (patch) | |
tree | 65280610fbda59d37baad0bfc722f8e91a44e517 /debugfs | |
parent | f0b8c87d2a196ecc9a19998d512f3d9a46b758ea (diff) | |
download | e2fsprogs-085cb19a55aa45e9959d55098295355bb87b43f5.tar.gz |
ChangeLog, debugfs.c:
debugfs.c (do_write, do_mknod): Set the file type information when
creating the inode.
Diffstat (limited to 'debugfs')
-rw-r--r-- | debugfs/ChangeLog | 5 | ||||
-rw-r--r-- | debugfs/debugfs.c | 13 |
2 files changed, 15 insertions, 3 deletions
diff --git a/debugfs/ChangeLog b/debugfs/ChangeLog index a88452fe..58c74da8 100644 --- a/debugfs/ChangeLog +++ b/debugfs/ChangeLog @@ -1,3 +1,8 @@ +2001-05-09 Theodore Tso <tytso@valinux.com> + + * debugfs.c (do_write, do_mknod): Set the file type information + when creating the inode. + 2001-05-03 Theodore Tso <tytso@valinux.com> * debugfs.c (do_open_filesys, main): Add -i option which will diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c index d263919f..1973ac53 100644 --- a/debugfs/debugfs.c +++ b/debugfs/debugfs.c @@ -1175,7 +1175,8 @@ void do_write(int argc, char *argv[]) current_fs->super->s_free_inodes_count--; ext2fs_mark_super_dirty(current_fs); printf("Allocated inode: %u\n", newfile); - retval = ext2fs_link(current_fs, cwd, argv[2], newfile, 0); + retval = ext2fs_link(current_fs, cwd, argv[2], newfile, + EXT2_FT_REG_FILE); if (retval) { com_err(argv[2], retval, ""); close(fd); @@ -1211,6 +1212,7 @@ void do_mknod(int argc, char *argv[]) ext2_ino_t newfile; errcode_t retval; struct ext2_inode inode; + int filetype; if (check_fs_open(argv[0])) return; @@ -1222,17 +1224,21 @@ void do_mknod(int argc, char *argv[]) switch (argv[2][0]) { case 'p': mode = LINUX_S_IFIFO; + filetype = EXT2_FT_FIFO; nr = 3; break; case 'c': mode = LINUX_S_IFCHR; + filetype = EXT2_FT_CHRDEV; nr = 5; break; case 'b': mode = LINUX_S_IFBLK; + filetype = EXT2_FT_BLKDEV; nr = 5; break; default: + filetype = 0; nr = 0; } if (nr == 5) { @@ -1253,13 +1259,14 @@ void do_mknod(int argc, char *argv[]) return; } printf("Allocated inode: %u\n", newfile); - retval = ext2fs_link(current_fs, cwd, argv[1], newfile, 0); + retval = ext2fs_link(current_fs, cwd, argv[1], newfile, filetype); if (retval) { if (retval == EXT2_ET_DIR_NO_SPACE) { retval = ext2fs_expand_dir(current_fs, cwd); if (!retval) retval = ext2fs_link(current_fs, cwd, - argv[1], newfile, 0); + argv[1], newfile, + filetype); } if (retval) { com_err(argv[1], retval, ""); |