Displaying 3 results from an estimated 3 matches for "defaultsubvolid".
2011 Jul 12
0
[PATCH]: Use a general way to get the default subvolume for btrfs
...fs_ioctl_search_key *sk = &args.key;
+ struct btrfs_ioctl_search_header *sh;
+ int ret, i;
+ int fd;
+ struct btrfs_root_ref *ref;
+ struct btrfs_dir_item *dir_item;
+ unsigned long off = 0;
+ int name_len;
+ char *name;
+ u64 dir_id;
+ char dirname[4096];
+ u64 defaultsubvolid = 0;
+
+ ret = test_issubvolume(rootdir);
+ if (ret == 1) {
+ fd = open_file_or_dir(rootdir);
+ if (fd < 0) {
+ fprintf(stderr, "ERROR: failed to open %s\n", rootdir);
+ }
+ ret = fd;
+ }
+ if (ret <= 0) {
+ subvol[0] = '...
2015 Sep 09
1
[PATCH v1 1/1] extlinux: fix file descriptors leak
...ot;);
subvol[0] = '\0';
+ if (fd >= 0)
+ close(fd);
return NULL;
}
/* the ioctl returns the number of item it found in nr_items */
@@ -891,6 +896,8 @@ static char * get_default_subvol(char * rootdir, char * subvol)
if (defaultsubvolid == 0) {
subvol[0] = '\0';
+ if (fd >= 0)
+ close(fd);
return NULL;
}
@@ -922,6 +929,8 @@ static char * get_default_subvol(char * rootdir, char * subvol)
if (ret < 0) {
fprintf(stderr, "ERROR: can't perform the search\n...
2015 Sep 09
0
[PATCH v1 1/1] extlinux: fix file descriptors leak
...ot;);
subvol[0] = '\0';
+ if (fd >= 0)
+ close(fd);
return NULL;
}
/* the ioctl returns the number of item it found in nr_items */
@@ -891,6 +896,8 @@ static char * get_default_subvol(char * rootdir, char * subvol)
if (defaultsubvolid == 0) {
subvol[0] = '\0';
+ if (fd >= 0)
+ close(fd);
return NULL;
}
@@ -922,6 +929,8 @@ static char * get_default_subvol(char * rootdir, char * subvol)
if (ret < 0) {
fprintf(stderr, "ERROR: can't perform the search\n...