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

          John L. Hammond (john.hammond@intel.com) merged in patch https://review.whamcloud.com/30499/
          Subject: LU-6210 utils: Use C99 struct initializers in lfs_hsm_state()
          Project: fs/lustre-release
          Branch: b2_10
          Current Patch Set:
          Commit: 924586bdcc5a053bc06ef7c73ae2112866b880c5

          gerrit Gerrit Updater added a comment - John L. Hammond (john.hammond@intel.com) merged in patch https://review.whamcloud.com/30499/ Subject: LU-6210 utils: Use C99 struct initializers in lfs_hsm_state() Project: fs/lustre-release Branch: b2_10 Current Patch Set: Commit: 924586bdcc5a053bc06ef7c73ae2112866b880c5

          John L. Hammond (john.hammond@intel.com) merged in patch https://review.whamcloud.com/30264/
          Subject: LU-6210 utils: Use C99 initializer for lfsck_types_names
          Project: fs/lustre-release
          Branch: b2_10
          Current Patch Set:
          Commit: 7cdc62964119f5f13070d0549d157e4a6135dc5c

          gerrit Gerrit Updater added a comment - John L. Hammond (john.hammond@intel.com) merged in patch https://review.whamcloud.com/30264/ Subject: LU-6210 utils: Use C99 initializer for lfsck_types_names Project: fs/lustre-release Branch: b2_10 Current Patch Set: Commit: 7cdc62964119f5f13070d0549d157e4a6135dc5c

          Minh Diep (minh.diep@intel.com) uploaded a new patch: https://review.whamcloud.com/30499
          Subject: LU-6210 utils: Use C99 struct initializers in lfs_hsm_state()
          Project: fs/lustre-release
          Branch: b2_10
          Current Patch Set: 1
          Commit: 4ae30c07195b4e25e5ef88cb216a944bd9fe116b

          gerrit Gerrit Updater added a comment - Minh Diep (minh.diep@intel.com) uploaded a new patch: https://review.whamcloud.com/30499 Subject: LU-6210 utils: Use C99 struct initializers in lfs_hsm_state() Project: fs/lustre-release Branch: b2_10 Current Patch Set: 1 Commit: 4ae30c07195b4e25e5ef88cb216a944bd9fe116b

          Minh Diep (minh.diep@intel.com) uploaded a new patch: https://review.whamcloud.com/30264
          Subject: LU-6210 utils: Use C99 initializer for lfsck_types_names
          Project: fs/lustre-release
          Branch: b2_10
          Current Patch Set: 1
          Commit: f77870de3c743b30d2481c3c546f74a875a33af3

          gerrit Gerrit Updater added a comment - Minh Diep (minh.diep@intel.com) uploaded a new patch: https://review.whamcloud.com/30264 Subject: LU-6210 utils: Use C99 initializer for lfsck_types_names Project: fs/lustre-release Branch: b2_10 Current Patch Set: 1 Commit: f77870de3c743b30d2481c3c546f74a875a33af3

          Final patch landed for 2.11.

          sguminsx Steve Guminski (Inactive) added a comment - Final patch landed for 2.11.
          pjones Peter Jones added a comment -

          Dare I ask - are there more such patches still to come?

          pjones Peter Jones added a comment - Dare I ask - are there more such patches still to come?

          Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/28423/
          Subject: LU-6210 utils: Use C99 struct initializers in lnetctl
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: 7e58fd07723483517dbe712ee671db416b6d3ac4

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

          Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/28436/
          Subject: LU-6210 lnet: Use C99 struct initializer in framework.c
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: 60c9a2d351d40b5306b586d08847b6c7727b73cf

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

          Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/28479/
          Subject: LU-6210 ptlrpc: Use C99 initializer in ptlrpc_register_rqbd()
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: 3af10d510078ddf050fbda2ef80bdc6920d89f8d

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

          Oleg Drokin (oleg.drokin@intel.com) merged in 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:
          Commit: 0568e93539ebc1bbec601182f9faba4d43ed106b

          gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in 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: Commit: 0568e93539ebc1bbec601182f9faba4d43ed106b

          People

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

            Dates

              Created:
              Updated:
              Resolved: