search for: file_ext

Displaying 20 results from an estimated 33 matches for "file_ext".

2013 Jun 04
3
[PATCH] Btrfs: fix broken nocow after balance
Balance will create reloc_root for each fs root, and it''s going to record last_snapshot to filter shared blocks. The side effect of setting last_snapshot is to break nocow attributes of files. So it turns out that checking last_snapshot does not always ensure that a node/leaf/file_extent is shared. That''s why shared node/leaf needs to search extent tree for number of references even after having checked last_snapshot, and updating fs/file tree works top-down so the children will always know how many references parents put on them at the moment of checking shared status...
2019 Feb 14
1
Proposed function file.backup
...(default), rename the file. Otherwise, keep old copy. ##' @param verbose If TRUE, list the files in the output directory ##' @author Shadi Pirhosseinloo <shadi@@ku.edu> Paul Johnson <pauljohn@@ ku.edu> ##' @return The name of the newly created file. ##' @importFrom tools file_ext ##' @importFrom tools file_path_sans_ext ##' @export ##' @examples ##' tdir <- tempdir() ##' owd <- getwd() ##' ##' setwd(tdir) ##' system("touch test.1.txt") ##' system("touch test.2.txt") ##' system("touch test.3.txt") ##...
2019 Mar 20
0
[PATCH nbdkit 8/8] file: Implement extents.
...*/ + if (pos > offset) { + if (nbdkit_add_extent (extents, offset, pos - offset, + 0 /* allocated data */) == -1) + return -1; + if (req_one) + break; + } + + offset = pos; + } while (offset < end); + + return 0; +} + +static int +file_extents (void *handle, uint32_t count, uint64_t offset, + uint32_t flags, struct nbdkit_extents *extents) +{ + int r; + + pthread_mutex_lock (&lseek_lock); + r = do_extents (handle, count, offset, flags, extents); + pthread_mutex_unlock (&lseek_lock); + + return r; +} +#endif...
2011 Oct 18
2
patch proposal: omindex library or daemon
...fe): Omindex::init(options) // struct Omindex::options { ... } initialize mime_map, store default options session = new Omindex::Session(db_pathname) user threads use different sessions session.index_files(list, options) // list & return value are vector of { char * url, * file_path, * file_ext } perform a transaction for all files in list; create & return skip_list session.index_directory(url, dir_name, options) perform a transaction for all files in a directory tree; return skip_list main() moves to omindex_main.cc process command line, call Omindex::init(), proceed nor...
2019 Mar 28
0
[PATCH nbdkit v5 FINAL 15/19] file: Implement extents.
...*/ + if (pos > offset) { + if (nbdkit_add_extent (extents, offset, pos - offset, + 0 /* allocated data */) == -1) + return -1; + if (req_one) + break; + } + + offset = pos; + } while (offset < end); + + return 0; +} + +static int +file_extents (void *handle, uint32_t count, uint64_t offset, + uint32_t flags, struct nbdkit_extents *extents) +{ + int r; + + pthread_mutex_lock (&lseek_lock); + r = do_extents (handle, count, offset, flags, extents); + pthread_mutex_unlock (&lseek_lock); + + return r; +} +#endif...
2015 Oct 13
0
[PATCH 1/2] ldlinux: fix stack overflow when running COM32 modules
...E_TYPE_CONFIG) { char *argv[] = { LDLINUX, NULL, NULL }; char *config; diff --git a/com32/elflink/ldlinux/ldlinux.c b/com32/elflink/ldlinux/ldlinux.c index 9b01dd3..0172117 100644 --- a/com32/elflink/ldlinux/ldlinux.c +++ b/com32/elflink/ldlinux/ldlinux.c @@ -31,6 +31,8 @@ static const struct file_ext file_extensions[] = { { NULL, 0 }, }; +jmp_buf __return_to_command_prompt; + /* * Return a pointer to one byte after the last character of the * command. @@ -302,6 +304,7 @@ __export int main(int argc __unused, char **argv) const void *adv; const char *cmdline; size_t count = 0; + i...
2020 Feb 10
2
[nbdkit PATCH 05/10] plugins: Wire up file-based plugin support for NBD_INFO_INIT_STATE
...filesystem. - */ - ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&lseek_lock); - r = lseek (h->fd, 0, SEEK_HOLE); - if (r == -1) { - nbdkit_debug ("extents disabled: lseek: SEEK_HOLE: %m"); - return 0; - } - return 1; + return h->can_extents; } static int @@ -622,6 +661,23 @@ file_extents (void *handle, uint32_t count, uint64_t offset, ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&lseek_lock); return do_extents (handle, count, offset, flags, extents); } + +/* Initial state. */ +static int +file_init_sparse (void *handle) +{ + struct handle *h = handle; + + return h->init_spar...
2012 Apr 17
2
[GIT PULL] elflink warning fixes and auto extension support
...bool.h> +#include <string.h> #include <core.h> +#include <fs.h> #include "cli.h" #include "console.h" #include "com32.h" @@ -11,40 +14,119 @@ #include <sys/module.h> -static enum kernel_type parse_kernel_type(char *kernel) -{ +struct file_ext { + const char *name; enum kernel_type type; +}; + +static const struct file_ext file_extensions[] = { + { ".com", KT_COMBOOT }, + { ".cbt", KT_COMBOOT }, + { ".c32", KT_COM32 }, + { ".img", KT_FDIMAGE }, + { ".bss", KT_BSS }, + { ".bin"...
2019 Mar 23
1
Re: [PATCH nbdkit 8/8] file: Implement extents.
...ata without calling .extents, and NBDKIT_EXTENT_NATIVE (requires .extents, and lets the plugin do all the work). Then, when lseek(SEEK_HOLE) returns EOF, we can return NBDKIT_EXTENT_EMULATE instead of having to track our optimization of skipping lseek in .extents ourselves. > +static int > +file_extents (void *handle, uint32_t count, uint64_t offset, > + uint32_t flags, struct nbdkit_extents *extents) > +{ > + int r; > + > + pthread_mutex_lock (&lseek_lock); > + r = do_extents (handle, count, offset, flags, extents); > + pthread_mutex_unlock (&lsee...
2019 Apr 23
0
[nbdkit PATCH 4/4] plugins: Utilize ACQUIRE_LOCK_FOR_CURRENT_SCOPE
...; - size = block_device_size (h->fd); - pthread_mutex_unlock (&lseek_lock); - return size; + ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&lseek_lock); + return block_device_size (h->fd); } else { /* Regular file. */ struct stat statbuf; @@ -607,13 +604,8 @@ static int file_extents (void *handle, uint32_t count, uint64_t offset, uint32_t flags, struct nbdkit_extents *extents) { - int r; - - pthread_mutex_lock (&lseek_lock); - r = do_extents (handle, count, offset, flags, extents); - pthread_mutex_unlock (&lseek_lock); - - return r; + ACQUIRE_...
2015 Oct 13
5
[PATCH 0/2] Stack overflows when running commands
From: Sylvain Gault <sylvain.gault at gmail.com> Hello there, I propose 2 patches that fix two possible stack overflows either when running a COM32 module or when loading a new config file. I didn't find a better way to do this than to use the infamous setjmp/longjmp functions to restore the stack to a previous state. This makes the logic a bit more complex, but the behavior is not
2004 Feb 06
4
memory reduction
..._list *flist; flist = new(struct file_list); if (!flist) - out_of_memory("send_file_list"); + out_of_memory(msg); - flist->count = 0; - flist->malloced = 0; - flist->files = NULL; + memset(flist, 0, sizeof (struct file_list)); + + if (!(flist->file_pool = pool_create(FILE_EXTENT, 0, + out_of_memory, POOL_INTERN))) + out_of_memory(msg); + +#if SUPPORT_HARD_LINKS + if (with_hlink && preserve_hard_links) { + if (!(flist->hlink_pool = pool_create(HLINK_EXTENT, 0, + out_of_memory, POOL_INTERN))) + out_of_memory(msg); + } +#endif return flist; } @...
2016 Mar 20
0
[PATCH 0/1] EFI image booting capabilities
...styling. > diff -uprN a/com32/elflink/ldlinux/ldlinux.c b/com32/elflink/ldlinux/ldlinux.c > --- a/com32/elflink/ldlinux/ldlinux.c 2014-10-06 10:27:44.000000000 -0600 > +++ b/com32/elflink/ldlinux/ldlinux.c 2015-02-18 18:33:39.370445843 -0700 > @@ -28,6 +28,7 @@ static const struct file_ext file_extens > { ".bin", IMAGE_TYPE_BOOT }, > { ".bs", IMAGE_TYPE_BOOT }, > { ".0", IMAGE_TYPE_PXE }, > + { ".efi", IMAGE_TYPE_EFI }, > { NULL, 0 }, > }; > Looks good. Glue > diff -uprN a/com32/...
2020 Apr 09
0
[PATCH nbdkit v2 1/3] file: Move file operators to a new common/fileops mini-library.
...*/ - if (pos > offset) { - if (nbdkit_add_extent (extents, offset, pos - offset, - 0 /* allocated data */) == -1) - return -1; - if (req_one) - break; - } - - offset = pos; - } while (offset < end); - - return 0; -} - -static int -file_extents (void *handle, uint32_t count, uint64_t offset, - uint32_t flags, struct nbdkit_extents *extents) -{ - ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&lseek_lock); - return do_extents (handle, count, offset, flags, extents); -} -#endif /* SEEK_HOLE */ - -#if HAVE_POSIX_FADVISE -/* Caching....
2020 Apr 09
1
[PATCH nbdkit PRELIMINARY] file: Move file operators to a new fileops mini-library
There's a lot of code in nbdkit-file-plugin which it would be nice to reuse elsewhere. One possible approach (as outlined here) is simply to move the file callbacks (like file.pread, file.pwrite, file.zero etc) to a new mini-library. They can then be consumed by other plugins fairly easily by doing: static void * foo_open (int readonly) { struct fileops *fops; int fd, flags; /*
2020 Aug 07
0
[nbdkit PATCH 2/4] file: Add .list_exports support
...n * the current filesystem. */ - ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&lseek_lock); + ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&lock); r = lseek (h->fd, 0, SEEK_HOLE); if (r == -1) { nbdkit_debug ("extents disabled: lseek: SEEK_HOLE: %m"); @@ -628,7 +712,7 @@ static int file_extents (void *handle, uint32_t count, uint64_t offset, uint32_t flags, struct nbdkit_extents *extents) { - ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&lseek_lock); + ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&lock); return do_extents (handle, count, offset, flags, extents); } #endif /* SEEK_...
2020 Apr 09
6
[PATCH nbdkit v2 0/3] Implement fileops.
Needs some work still, see in particular the commit message for patch 3. Rich.
2015 Feb 20
6
[PATCH 0/1] EFI image booting capabilities
...trerror(errno)); + return 1; +} diff -uprN a/com32/elflink/ldlinux/ldlinux.c b/com32/elflink/ldlinux/ldlinux.c --- a/com32/elflink/ldlinux/ldlinux.c 2014-10-06 10:27:44.000000000 -0600 +++ b/com32/elflink/ldlinux/ldlinux.c 2015-02-18 18:33:39.370445843 -0700 @@ -28,6 +28,7 @@ static const struct file_ext file_extens { ".bin", IMAGE_TYPE_BOOT }, { ".bs", IMAGE_TYPE_BOOT }, { ".0", IMAGE_TYPE_PXE }, + { ".efi", IMAGE_TYPE_EFI }, { NULL, 0 }, }; diff -uprN a/com32/include/syslinux/boot.h b/com32/include/syslinux/boot.h --- a/com32/include/syslinux/boo...
2012 Jul 16
5
[PATCH 0/5] Deleting __intcall() from Syslinux
From: Matt Fleming <matt.fleming at intel.com> Since we can't use __intcall() for EFI, and since we can now have the ELF module code resolve all our symbols at runtime, we should delete as many references to __intcall() as possible and just access the symbols directly. The most interesting patch is the support for weak symbols. We need to be able to reference derivative-specific
2012 Aug 14
1
[GIT PULL] elflink fixes
...d 100644 --- a/com32/elflink/ldlinux/ldlinux.c +++ b/com32/elflink/ldlinux/ldlinux.c @@ -11,6 +11,7 @@ #include "menu.h" #include "config.h" #include "syslinux/adv.h" +#include "syslinux/boot.h" #include <sys/module.h> @@ -20,15 +21,15 @@ struct file_ext { }; static const struct file_ext file_extensions[] = { - { ".com", KT_COMBOOT }, - { ".cbt", KT_COMBOOT }, - { ".c32", KT_COM32 }, - { ".img", KT_FDIMAGE }, - { ".bss", KT_BSS }, - { ".bin", KT_BOOT }, - { ".bs", KT_BOOT },...