- int ret = 0;
- int fd = -1;
- u64 flags = 0;
-
- fd = open(object, O_RDONLY);
- if (fd < 0) {
- ret = -errno;
- fprintf(stderr, "ERROR: open %s failed. %s\n",
- object, strerror(-ret));
- goto out;
- }
-
- ret = ioctl(fd, BTRFS_IOC_SUBVOL_GETFLAGS, &flags);
- if (ret < 0) {
- ret = -errno;
- fprintf(stderr, "ERROR: failed to get flags for %s. %s\n",
- object, strerror(-ret));
- goto out;
- }