search for: ext2_ft_symlink

Displaying 8 results from an estimated 8 matches for "ext2_ft_symlink".

2019 Nov 26
0
[PATCH supermin] ext2: Build symbolic links correctly (RHBZ#1770304).
...lse if (S_ISLNK (statbuf.st_mode)) { - ext2_ino_t ino; - ext2_empty_inode (data->fs, dir_ino, dirname, basename, - statbuf.st_mode, statbuf.st_uid, statbuf.st_gid, - statbuf.st_ctime, statbuf.st_atime, statbuf.st_mtime, - 0, 0, EXT2_FT_SYMLINK, &ino); - char *buf = malloc (statbuf.st_size+1); if (buf == NULL) caml_raise_out_of_memory (); @@ -797,7 +791,7 @@ ext2_copy_file (struct ext2_data *data, const char *src, const char *dest) if (r > statbuf.st_size) r = statbuf.st_size; buf[r] = '\0'...
2010 Mar 20
2
[PATCH 4/4] btrfs-convert: split into convert/.
...e_conversion_table[EXT2_FT_MAX] = { - [EXT2_FT_UNKNOWN] = BTRFS_FT_UNKNOWN, - [EXT2_FT_REG_FILE] = BTRFS_FT_REG_FILE, - [EXT2_FT_DIR] = BTRFS_FT_DIR, - [EXT2_FT_CHRDEV] = BTRFS_FT_CHRDEV, - [EXT2_FT_BLKDEV] = BTRFS_FT_BLKDEV, - [EXT2_FT_FIFO] = BTRFS_FT_FIFO, - [EXT2_FT_SOCK] = BTRFS_FT_SOCK, - [EXT2_FT_SYMLINK] = BTRFS_FT_SYMLINK, -}; - -static int dir_iterate_proc(ext2_ino_t dir, int entry, - struct ext2_dir_entry *old, - int offset, int blocksize, - char *buf,void *priv_data) -{ - int ret; - int file_type; - u64 objectid; - u64 inode_size; - char dotdot[] = ".."; - st...
2014 Jul 30
2
[PATCH 1/3] ext2: create a struct for the OCaml 't' type
...o; - ext2_empty_inode (fs, dir_ino, dirname, basename, + ext2_empty_inode (data->fs, dir_ino, dirname, basename, statbuf.st_mode, statbuf.st_uid, statbuf.st_gid, statbuf.st_ctime, statbuf.st_atime, statbuf.st_mtime, 0, 0, EXT2_FT_SYMLINK, &ino); @@ -693,11 +698,11 @@ ext2_copy_file (ext2_filsys fs, const char *src, const char *dest) ssize_t r = readlink (src, buf, sizeof buf); if (r == -1) unix_error (errno, (char *) "readlink", caml_copy_string (src)); - ext2_write_file (fs, ino, buf, r, dest); +...
2017 Jul 13
3
[PATCH supermin v2] ext2: Create symlinks properly (RHBZ#1470157).
...e host file must be a regular + * file. */ static void ext2_write_host_file (ext2_filsys fs, @@ -829,11 +788,17 @@ ext2_copy_file (struct ext2_data *data, const char *src, const char *dest) statbuf.st_ctime, statbuf.st_atime, statbuf.st_mtime, 0, 0, EXT2_FT_SYMLINK, &ino); - char buf[PATH_MAX+1]; - ssize_t r = readlink (src, buf, sizeof buf); + char *buf = malloc (statbuf.st_size+1); + if (buf == NULL) + caml_raise_out_of_memory (); + ssize_t r = readlink (src, buf, statbuf.st_size); if (r == -1) unix_error (errno, (char...
2019 Feb 19
0
[PATCH nbdkit 4/4] Add linuxdisk plugin.
...&file->ino) == -1) + return -1; + + if (file->statbuf.st_size > 0) { + if (e2copyfiledata (fs, file) == -1) + return -1; + } + } + /* Symbolic link. */ + else if (S_ISLNK (file->statbuf.st_mode)) { + char *buf; + ssize_t r; + + file->ino_flags = EXT2_FT_SYMLINK; + file->type = "symbolic link"; + if (e2emptyinode (fs, file->dir_ino, file->name, &file->statbuf, + file->ino_flags, &file->ino) == -1) + return -1; + + buf = malloc (file->statbuf.st_size + 1); + if (buf == NULL) { +...
2019 Feb 19
6
[PATCH nbdkit v2 0/5] Add linuxdisk plugin.
Another interesting thing you can do with this plugin: https://rwmj.wordpress.com/2019/02/19/nbdkit-linuxdisk-plugin/ v2: - Fix inconsistent tab/space. - All 3 plugins now contain a block of text pointing to the other 2 plugins. - TMDIR -> TMPDIR - Unlink the temporary file and other cleanups along error paths. - fclose -> pclose, and check the return value for errors. -
2019 Feb 19
7
[PATCH nbdkit 0/4] New plugin: Add linuxdisk plugin.
Turns out Japanese trains are good for coding! In supermin we have a bunch of code to create the libguestfs appliance. It creates it directly using libext2fs (part of e2fsprogs). We can use the same technique to create ext2 virtual disks in nbdkit, which is what this new plugin does. Why a new plugin instead of modifying the floppy plugin? See the 4/4 commit message for an explanation. The
2014 Feb 25
2
[PATCH supermin v4] Supermin 5 rewrite.
...(statbuf->st_mode)) { - ext2_ino_t ino; - ext2_empty_inode (dir_ino, dirname, basename, - statbuf->st_mode, statbuf->st_uid, statbuf->st_gid, - statbuf->st_ctime, statbuf->st_atime, statbuf->st_mtime, - 0, 0, EXT2_FT_SYMLINK, &ino); - - char buf[PATH_MAX+1]; - ssize_t r = readlink (orig_filename, buf, sizeof buf); - if (r == -1) - error (EXIT_FAILURE, errno, "readlink: %s", orig_filename); - ext2_write_file (ino, buf, r, orig_filename); - } - /* Create directory. */ - else if (S_ISDIR...