Details

    • 9223372036854775807

    Description

      The --maxdepth M option exists, but there is no corresponding --mindepth N option to find entries at N directory levels down in the tree.

      Attachments

        Issue Links

          Activity

            [LU-10552] add "lfs find --mindepth"
            adilger Andreas Dilger made changes -
            Fix Version/s New: Lustre 2.16.0 [ 15190 ]
            Resolution New: Fixed [ 1 ]
            Status Original: Open [ 1 ] New: Resolved [ 5 ]
            adilger Andreas Dilger added a comment - - edited

            "Maximilian Dilger <mdilger@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/55226
            Subject: LU-10522 utils: new --mindepth for lfs find
            Branch: master
            Current Patch Set: 5
            Commit: 9df10214fb073434c6e634e5169e72aa7a606e9f

            adilger Andreas Dilger added a comment - - edited "Maximilian Dilger <mdilger@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/55226 Subject: LU-10522 utils: new --mindepth for lfs find Branch: master Current Patch Set: 5 Commit: 9df10214fb073434c6e634e5169e72aa7a606e9f

            Sorry, I didn't get an email about this. There is no need for a "short" letter option for every long option like "--maxdepth". It could use a numeric option value as some of the other options do.

            The lustreapi.h file is definitely located in the Lustre source tree, even if it is installed into the system by RPM packages. Using "git grep" is your friend to find things in the source code, if your IDE does not have tags to jump to structure and function definitions.

            As for modifying the find_param struct, since this is also used as part of the user API, it should only be modified by adding new fields to the end. Some caution is needed since there are a few other patches in flight that are also modifying this struct.

            adilger Andreas Dilger added a comment - Sorry, I didn't get an email about this. There is no need for a "short" letter option for every long option like "--maxdepth". It could use a numeric option value as some of the other options do. The lustreapi.h file is definitely located in the Lustre source tree, even if it is installed into the system by RPM packages. Using "git grep" is your friend to find things in the source code, if your IDE does not have tags to jump to structure and function definitions. As for modifying the find_param struct, since this is also used as part of the user API, it should only be modified by adding new fields to the end. Some caution is needed since there are a few other patches in flight that are also modifying this struct.
            mdilger Max Dilger added a comment -

            About implementing "lfs find --mindepth", and i see the logic for "lfs find --maxdepth" in the lfs.c file. Based on how it's implemented it would make sense to me to add a .fp_min_depth value to the "find_param param" struct but i see that it is declared in the lustreapi.h file which is located at /usr/include/lustre directory and not inside the lustre-release which is where everything else is. I am worried that any changes i make to the lustreapi.h file will not get included in any git commits that I make. Also in the long_opts[] struct --maxdepth is listed as "D", so while the two are both related adding --mindepth to "D" aswell will likely cause some confusion.

            mdilger Max Dilger added a comment - About implementing "lfs find --mindepth", and i see the logic for "lfs find --maxdepth" in the lfs.c file. Based on how it's implemented it would make sense to me to add a .fp_min_depth value to the "find_param param" struct but i see that it is declared in the lustreapi.h file which is located at /usr/include/lustre directory and not inside the lustre-release which is where everything else is. I am worried that any changes i make to the lustreapi.h file will not get included in any git commits that I make. Also in the long_opts[] struct --maxdepth is listed as "D", so while the two are both related adding --mindepth to "D" aswell will likely cause some confusion.
            mdilger Max Dilger made changes -
            Assignee Original: WC Triage [ wc-triage ] New: Max Dilger [ mdilger ]
            adilger Andreas Dilger made changes -
            Labels Original: easy lad23dd lfs lug23dd New: easy lfs lug23dd lug24dd
            adilger Andreas Dilger made changes -
            Description Original: The {{--maxdepth M}} option exists, but there is no corresponding {{--mindepth N}} option to find entries at {{N}} directory levels down in the tree.
            New: The {{\-\-maxdepth M}} option exists, but there is no corresponding {{\-\-mindepth N}} option to find entries at {{N}} directory levels down in the tree.
            adilger Andreas Dilger made changes -
            Labels Original: easy lfs lug23dd New: easy lad23dd lfs lug23dd
            adilger Andreas Dilger made changes -
            Description Original: All of the other options to {{lfs find}} allow the use of {{!}} and {{+}}/{{\-}} operators to negate the search option, or specify that the numeric value should be respectively greater than, or less than the specified argument. The {{\-\-maxdepth}} option does not support these values, but indicates "less than or equal to the specified depth".

            Since "max" is already part of the option name, it might be better to deprecate that option and instead implement a {{\-\-depth [+\-]n}} option that allows specifying the minimum or maximum depth of traversal. If used without an argument, it should specify depth-first traversal rather than breadth-first traversal, similar to {{find(1)}}. The deprecated {{\-\-maxdepth n}} option would be mapped to {{! \-\-depth +n}} (i.e. depth not greater than {{n}}).
            New: The {{--maxdepth M}} option exists, but there is no corresponding {{--mindepth N}} option to find entries at {{N}} directory levels down in the tree.
            adilger Andreas Dilger made changes -
            Summary Original: "lfs find --maxdepth" should allow min/max depth New: add "lfs find --mindepth"

            People

              mdilger Max Dilger
              adilger Andreas Dilger
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: