Displaying 4 results from an estimated 4 matches for "bmap_prepare".
2014 Nov 23
0
[PATCH 3/3] New APIs: bmap-file, bmap-device, bmap.
...1;
+static DIR *dir = NULL;
+static struct stat statbuf;
+
+static void bmap_finalize (void) __attribute__((destructor));
+static void
+bmap_finalize (void)
+{
+ if (fd >= 0) {
+ close (fd);
+ fd = -1;
+ }
+ if (dir != NULL) {
+ closedir (dir);
+ dir = NULL;
+ }
+}
+
+static int
+bmap_prepare (const char *path, const char *orig_path)
+{
+ bmap_finalize ();
+
+ if (stat (path, &statbuf) == -1) {
+ reply_with_perror ("%s", orig_path);
+ return -1;
+ }
+
+ if (S_ISDIR (statbuf.st_mode)) {
+ /* Open a directory. */
+ dir = opendir (path);
+ if (dir == NULL)...
2014 Nov 23
7
[PATCH 0/3] patches needed for virt-bmap
See http://rwmj.wordpress.com/2014/11/23/mapping-files-to-disk/
2014 Nov 24
1
Re: [PATCH 3/3] New APIs: bmap-file, bmap-device, bmap.
...p_finalize (void) __attribute__((destructor));
> +static void
> +bmap_finalize (void)
> +{
> + if (fd >= 0) {
> + close (fd);
> + fd = -1;
> + }
> + if (dir != NULL) {
> + closedir (dir);
> + dir = NULL;
> + }
> +}
> +
> +static int
> +bmap_prepare (const char *path, const char *orig_path)
> +{
> + bmap_finalize ();
> +
> + if (stat (path, &statbuf) == -1) {
> + reply_with_perror ("%s", orig_path);
> + return -1;
> + }
> +
> + if (S_ISDIR (statbuf.st_mode)) {
> + /* Open a directory. */...
2014 Nov 24
2
[PATCH v2 0/2] patches needed for virt-bmap
Does *not* incorporate changes suggested by Pino yet.
Rich.