]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
mkfs: use opts parameter during option parsing
authorDave Chinner <dchinner@redhat.com>
Wed, 3 Jan 2018 20:10:10 +0000 (14:10 -0600)
committerEric Sandeen <sandeen@redhat.com>
Wed, 3 Jan 2018 20:10:10 +0000 (14:10 -0600)
Rather than hard coding the global table variable into the
parsing functions.

Signed-Off-By: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
mkfs/xfs_mkfs.c

index 2fd4e866173041cf61a720c5ebdc2c6c06e32f57..c4de836076a0ac42eb203baeb867bac7863d6742 100644 (file)
@@ -1532,29 +1532,29 @@ inode_opts_parser(
 
        switch (subopt) {
        case I_ALIGN:
-               cli->sb_feat.inode_align = getnum(value, &iopts, I_ALIGN);
+               cli->sb_feat.inode_align = getnum(value, opts, I_ALIGN);
                break;
        case I_LOG:
-               inodelog = getnum(value, &iopts, I_LOG);
+               inodelog = getnum(value, opts, I_LOG);
                cli->inodesize = 1 << inodelog;
                break;
        case I_MAXPCT:
-               cli->imaxpct = getnum(value, &iopts, I_MAXPCT);
+               cli->imaxpct = getnum(value, opts, I_MAXPCT);
                break;
        case I_PERBLOCK:
-               cli->inopblock = getnum(value, &iopts, I_PERBLOCK);
+               cli->inopblock = getnum(value, opts, I_PERBLOCK);
                break;
        case I_SIZE:
-               cli->inodesize = getnum(value, &iopts, I_SIZE);
+               cli->inodesize = getnum(value, opts, I_SIZE);
                break;
        case I_ATTR:
-               cli->sb_feat.attr_version = getnum(value, &iopts, I_ATTR);
+               cli->sb_feat.attr_version = getnum(value, opts, I_ATTR);
                break;
        case I_PROJID32BIT:
-               cli->sb_feat.projid32bit = getnum(value, &iopts, I_PROJID32BIT);
+               cli->sb_feat.projid32bit = getnum(value, opts, I_PROJID32BIT);
                break;
        case I_SPINODES:
-               cli->sb_feat.spinodes = getnum(value, &iopts, I_SPINODES);
+               cli->sb_feat.spinodes = getnum(value, opts, I_SPINODES);
                break;
        default:
                return -EINVAL;
@@ -1573,40 +1573,40 @@ log_opts_parser(
 
        switch (subopt) {
        case L_AGNUM:
-               cli->logagno = getnum(value, &lopts, L_AGNUM);
+               cli->logagno = getnum(value, opts, L_AGNUM);
                break;
        case L_FILE:
-               cli->xi->lisfile = getnum(value, &lopts, L_FILE);
+               cli->xi->lisfile = getnum(value, opts, L_FILE);
                break;
        case L_INTERNAL:
-               cli->loginternal = getnum(value, &lopts, L_INTERNAL);
+               cli->loginternal = getnum(value, opts, L_INTERNAL);
                break;
        case L_SU:
-               cli->lsu = getstr(value, &lopts, L_SU);
+               cli->lsu = getstr(value, opts, L_SU);
                break;
        case L_SUNIT:
-               cli->lsunit = getnum(value, &lopts, L_SUNIT);
+               cli->lsunit = getnum(value, opts, L_SUNIT);
                break;
        case L_NAME:
        case L_DEV:
-               cli->xi->logname = getstr(value, &lopts, L_NAME);
+               cli->xi->logname = getstr(value, opts, L_NAME);
                cli->loginternal = 0;
                break;
        case L_VERSION:
-               cli->sb_feat.log_version = getnum(value, &lopts, L_VERSION);
+               cli->sb_feat.log_version = getnum(value, opts, L_VERSION);
                break;
        case L_SIZE:
-               cli->logsize = getstr(value, &lopts, L_SIZE);
+               cli->logsize = getstr(value, opts, L_SIZE);
                break;
        case L_SECTLOG:
-               lsectorlog = getnum(value, &lopts, L_SECTLOG);
+               lsectorlog = getnum(value, opts, L_SECTLOG);
                cli->lsectorsize = 1 << lsectorlog;
                break;
        case L_SECTSIZE:
-               cli->lsectorsize = getnum(value, &lopts, L_SECTSIZE);
+               cli->lsectorsize = getnum(value, opts, L_SECTSIZE);
                break;
        case L_LAZYSBCNTR:
-               cli->sb_feat.lazy_sb_counters = getnum(value, &lopts, L_LAZYSBCNTR);
+               cli->sb_feat.lazy_sb_counters = getnum(value, opts, L_LAZYSBCNTR);
                break;
        default:
                return -EINVAL;
@@ -1623,12 +1623,12 @@ meta_opts_parser(
 {
        switch (subopt) {
        case M_CRC:
-               cli->sb_feat.crcs_enabled = getnum(value, &mopts, M_CRC);
+               cli->sb_feat.crcs_enabled = getnum(value, opts, M_CRC);
                if (cli->sb_feat.crcs_enabled)
                        cli->sb_feat.dirftype = true;
                break;
        case M_FINOBT:
-               cli->sb_feat.finobt = getnum(value, &mopts, M_FINOBT);
+               cli->sb_feat.finobt = getnum(value, opts, M_FINOBT);
                break;
        case M_UUID:
                if (!value || *value == '\0')
@@ -1637,10 +1637,10 @@ meta_opts_parser(
                        illegal(value, "m uuid");
                break;
        case M_RMAPBT:
-               cli->sb_feat.rmapbt = getnum(value, &mopts, M_RMAPBT);
+               cli->sb_feat.rmapbt = getnum(value, opts, M_RMAPBT);
                break;
        case M_REFLINK:
-               cli->sb_feat.reflink = getnum(value, &mopts, M_REFLINK);
+               cli->sb_feat.reflink = getnum(value, opts, M_REFLINK);
                break;
        default:
                return -EINVAL;
@@ -1689,20 +1689,20 @@ rtdev_opts_parser(
 {
        switch (subopt) {
        case R_EXTSIZE:
-               cli->rtextsize = getstr(value, &ropts, R_EXTSIZE);
+               cli->rtextsize = getstr(value, opts, R_EXTSIZE);
                break;
        case R_FILE:
-               cli->xi->risfile = getnum(value, &ropts, R_FILE);
+               cli->xi->risfile = getnum(value, opts, R_FILE);
                break;
        case R_NAME:
        case R_DEV:
-               cli->xi->rtname = getstr(value, &ropts, R_NAME);
+               cli->xi->rtname = getstr(value, opts, R_NAME);
                break;
        case R_SIZE:
-               cli->rtsize = getstr(value, &ropts, R_SIZE);
+               cli->rtsize = getstr(value, opts, R_SIZE);
                break;
        case R_NOALIGN:
-               cli->sb_feat.nortalign = getnum(value, &ropts, R_NOALIGN);
+               cli->sb_feat.nortalign = getnum(value, opts, R_NOALIGN);
                break;
        default:
                return -EINVAL;
@@ -1724,7 +1724,7 @@ sector_opts_parser(
        case S_SECTLOG:
                if (cli->sectorsize)
                        conflict('s', opts->subopts, S_SECTSIZE, S_SECTLOG);
-               sectorlog = getnum(value, &sopts, S_SECTLOG);
+               sectorlog = getnum(value, opts, S_SECTLOG);
                cli->sectorsize = 1 << sectorlog;
                cli->lsectorsize = cli->sectorsize;
                break;
@@ -1732,7 +1732,7 @@ sector_opts_parser(
        case S_SECTSIZE:
                if (cli->sectorsize)
                        conflict('s', opts->subopts, S_SECTLOG, S_SECTSIZE);
-               cli->sectorsize = getnum(value, &sopts, S_SECTSIZE);
+               cli->sectorsize = getnum(value, opts, S_SECTSIZE);
                cli->lsectorsize = cli->sectorsize;
                break;
        default: