[LU-10849] dt_it_ops.load comments confusing and inconsistent with usage Created: 26/Mar/18  Updated: 29/Jan/22

Status: Open
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: John Hammond Assignee: WC Triage
Resolution: Unresolved Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   
                /**
                 * Initialize position using cookie/hash.
                 *
                 * Initializes the current position of the iterator to one
                 * described by the cookie/hash as returned by ->store()
                 * previously.
                 *
                 * \param[in] env       execution environment for this thread
                 * \param[in] di        iterator
                 * \param[in] hash      cookie/hash value
                 *
                 * \retval positive     if current position points to
                 *                      record with least cookie not larger
                 *                      than cookie
                 * \retval 0            if current position matches cookie
                 * \retval negative     negated errno on error
                 */
                int           (*load)(const struct lu_env *env,
                                      const struct dt_it *di,
                                      __u64 hash);
dt_index_walk():
        rc = iops->load(env, it, rdpg->rp_hash);
        if (rc == 0) {
                /*                                                                                                   
                 * Iterator didn't find record with exactly the key requested.                                       
                 *                                                                                                   
                 * It is currently either                                                                            
                 *                                                                                                   
                 *     - positioned above record with key less than                                                  
                 *     requested---skip it.                                                                          
                 *     - or not positioned at all (is in IAM_IT_SKEWED                                               
                 *     state)---position it on the next item.                                                        
                 */
                rc = iops->next(env, it);
        } else if (rc > 0) {
                rc = 0;
        } else {
                if (rc == -ENODATA)
                        rc = 0;
                GOTO(out, rc);
        }

Generated at Sat Feb 10 02:38:44 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.