- if (a->volname) {
- if(!check_open(a->volname,flags,&rawfile,&blockfile))
- goto done;
- fd = open(rawfile, O_RDONLY);
- dname = a->dname = a->volname;
- a->volname = NULL;
- }
- if (dname) {
- if (a->disfile) {
- a->ddev= libxfs_device_open(dname, a->dcreat, flags,
- a->setblksize);
- a->dfd = libxfs_device_to_fd(a->ddev);
- platform_findsizes(dname, a->dfd, &a->dsize,
- &a->dbsize);
- } else {
- if (!check_open(dname, flags, &rawfile, &blockfile))
- goto done;
- a->ddev = libxfs_device_open(rawfile,
- a->dcreat, flags, a->setblksize);
- a->dfd = libxfs_device_to_fd(a->ddev);
- platform_findsizes(rawfile, a->dfd,
- &a->dsize, &a->dbsize);
- }
- } else
- a->dsize = 0;
- if (logname) {
- if (a->lisfile) {
- a->logdev = libxfs_device_open(logname,
- a->lcreat, flags, a->setblksize);
- a->logfd = libxfs_device_to_fd(a->logdev);
- platform_findsizes(dname, a->logfd, &a->logBBsize,
- &a->lbsize);
- } else {
- if (!check_open(logname, flags, &rawfile, &blockfile))
- goto done;
- a->logdev = libxfs_device_open(rawfile,
- a->lcreat, flags, a->setblksize);
- a->logfd = libxfs_device_to_fd(a->logdev);
- platform_findsizes(rawfile, a->logfd,
- &a->logBBsize, &a->lbsize);
- }
- } else
- a->logBBsize = 0;
- if (rtname) {
- if (a->risfile) {
- a->rtdev = libxfs_device_open(rtname,
- a->rcreat, flags, a->setblksize);
- a->rtfd = libxfs_device_to_fd(a->rtdev);
- platform_findsizes(dname, a->rtfd, &a->rtsize,
- &a->rtbsize);
- } else {
- if (!check_open(rtname, flags, &rawfile, &blockfile))
- goto done;
- a->rtdev = libxfs_device_open(rawfile,
- a->rcreat, flags, a->setblksize);
- a->rtfd = libxfs_device_to_fd(a->rtdev);
- platform_findsizes(rawfile, a->rtfd,
- &a->rtsize, &a->rtbsize);
- }
- } else
- a->rtsize = 0;
- if (a->dsize < 0) {
- fprintf(stderr, _("%s: can't get size for data subvolume\n"),
- progname);