Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-6210

change positional struct initializers to C99 initializers

Details

    • 17372

    Description

      In the libcfs and lnet code there are many places where positional struct initializers are used instead of named C99 initializers:

      static struct netstrfns  libcfs_netstrfns[] = {
              {/* .nf_type      */  LOLND,
               /* .nf_name      */  "lo",
               /* .nf_modname   */  "klolnd",
               /* .nf_addr2str  */  libcfs_decnum_addr2str,
               /* .nf_str2addr  */  libcfs_lo_str2addr,
               /* .nf_parse_addr*/  libcfs_num_parse,
               /* .nf_print_addrlist*/  libcfs_num_addr_range_print,
               /* .nf_match_addr*/      libcfs_num_match,
               /* .nf_is_contiguous */  cfs_num_is_contiguous,
               /* .nf_min_max   */      cfs_num_min_max},
      

      instead of

      static struct netstrfns  libcfs_netstrfns[] = {
              {
                       .nf_type              =  LOLND,
                       .nf_name              = "lo",
                       .nf_modname           = "klolnd",
                       .nf_addr2str          = libcfs_decnum_addr2str,
                       .nf_str2addr          = libcfs_lo_str2addr,
                       .nf_parse_addr        = libcfs_num_parse,
                       .nf_print_addrlist    = libcfs_num_addr_range_print,
                       .nf_match_addr        = libcfs_num_match,
                       .nf_is_contiguous     = cfs_num_is_contiguous,
                       .nf_min_max           = cfs_num_min_max},
      

      This was done because WinNT didn't have C99 initializer support, but we don't care about that anymore.

      All of the positional struct initializers in libcfs, lnet, and lustre should be changed to named initializers, probably in several independent patches for different subdirectories.

      Attachments

        Activity

          [LU-6210] change positional struct initializers to C99 initializers

          Steve Guminski (stephenx.guminski@intel.com) uploaded a new patch: https://review.whamcloud.com/28421
          Subject: LU-6210 utils: Use C99 struct initializers in lfs_getdirstripe
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: 7f7e46213f488a66b09e9be3b891c04bbdf082db

          gerrit Gerrit Updater added a comment - Steve Guminski (stephenx.guminski@intel.com) uploaded a new patch: https://review.whamcloud.com/28421 Subject: LU-6210 utils: Use C99 struct initializers in lfs_getdirstripe Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 7f7e46213f488a66b09e9be3b891c04bbdf082db

          Steve Guminski (stephenx.guminski@intel.com) uploaded a new patch: https://review.whamcloud.com/28417
          Subject: LU-6210 lnet: Use C99 struct initializers in lsnapshot
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: 20aed5ac4bb96ae5e5a2626d9a80fc0a61c335d6

          gerrit Gerrit Updater added a comment - Steve Guminski (stephenx.guminski@intel.com) uploaded a new patch: https://review.whamcloud.com/28417 Subject: LU-6210 lnet: Use C99 struct initializers in lsnapshot Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 20aed5ac4bb96ae5e5a2626d9a80fc0a61c335d6

          Yes, it looks like https://review.whamcloud.com/#/c/27522/ is the only committed patch that has not yet been landed.  I just re-ran the Python script attached to this ticket, and discovered that there are still a few occurrences of C89 initializers.  I'll submit patches for them shortly.

          sguminsx Steve Guminski (Inactive) added a comment - Yes, it looks like https://review.whamcloud.com/#/c/27522/ is the only committed patch that has not yet been landed.  I just re-ran the Python script attached to this ticket, and discovered that there are still a few occurrences of C89 initializers.  I'll submit patches for them shortly.

          Only one patch left maybe? Steve is that the case

          simmonsja James A Simmons added a comment - Only one patch left maybe? Steve is that the case

          Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/27883/
          Subject: LU-6210 utils: Use C99 initializer in jt_nodemap_del_range()
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: 2b90c15b72c25711793cc4ea46b964098131c736

          gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/27883/ Subject: LU-6210 utils: Use C99 initializer in jt_nodemap_del_range() Project: fs/lustre-release Branch: master Current Patch Set: Commit: 2b90c15b72c25711793cc4ea46b964098131c736

          Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/27881/
          Subject: LU-6210 utils: Use C99 initializer in jt_nodemap_test_id()
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: dad40c1980cbe67ec60055258f435cc3369745db

          gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/27881/ Subject: LU-6210 utils: Use C99 initializer in jt_nodemap_test_id() Project: fs/lustre-release Branch: master Current Patch Set: Commit: dad40c1980cbe67ec60055258f435cc3369745db

          Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/27825/
          Subject: LU-6210 utils: Use C99 struct initializer in mount_utils_zfs.c
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: 990890eacf757d73fc87a83bfa703a51b739a05c

          gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/27825/ Subject: LU-6210 utils: Use C99 struct initializer in mount_utils_zfs.c Project: fs/lustre-release Branch: master Current Patch Set: Commit: 990890eacf757d73fc87a83bfa703a51b739a05c

          Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/27891/
          Subject: LU-6210 utils: Use C99 initializer in jt_nodemap_del_idmap()
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: 9999d2d959e74f79be00e1708d0e53c5e600c47a

          gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/27891/ Subject: LU-6210 utils: Use C99 initializer in jt_nodemap_del_idmap() Project: fs/lustre-release Branch: master Current Patch Set: Commit: 9999d2d959e74f79be00e1708d0e53c5e600c47a

          Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/27890/
          Subject: LU-6210 utils: Use C99 initializer in jt_nodemap_add_idmap()
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: fc55dd29cfaccbe925839ff665591c85313e3359

          gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/27890/ Subject: LU-6210 utils: Use C99 initializer in jt_nodemap_add_idmap() Project: fs/lustre-release Branch: master Current Patch Set: Commit: fc55dd29cfaccbe925839ff665591c85313e3359

          Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/27889/
          Subject: LU-6210 utils: Use C99 initializer in jt_nodemap_modify()
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: 8633aaba2da245bc62b876e535e7ac26385e1385

          gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/27889/ Subject: LU-6210 utils: Use C99 initializer in jt_nodemap_modify() Project: fs/lustre-release Branch: master Current Patch Set: Commit: 8633aaba2da245bc62b876e535e7ac26385e1385

          Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/27888/
          Subject: LU-6210 utils: Use C99 initializer in jt_nodemap_set_fileset()
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: 9c5fad36aac2086b38f91e28db90da01efc9126a

          gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/27888/ Subject: LU-6210 utils: Use C99 initializer in jt_nodemap_set_fileset() Project: fs/lustre-release Branch: master Current Patch Set: Commit: 9c5fad36aac2086b38f91e28db90da01efc9126a

          People

            sguminsx Steve Guminski (Inactive)
            adilger Andreas Dilger
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: