Print this page
3006 VERIFY[S,U,P] and ASSERT[S,U,P] frequently check if first argument is zero


 157                         return (RESUME_SKIP_ALL);
 158 
 159                 /*
 160                  * If we found the block we're trying to resume from, zero
 161                  * the bookmark out to indicate that we have resumed.
 162                  */
 163                 ASSERT3U(zb->zb_object, <=, td->td_resume->zb_object);
 164                 if (bcmp(zb, td->td_resume, sizeof (*zb)) == 0) {
 165                         bzero(td->td_resume, sizeof (*zb));
 166                         if (td->td_flags & TRAVERSE_POST)
 167                                 return (RESUME_SKIP_CHILDREN);
 168                 }
 169         }
 170         return (RESUME_SKIP_NONE);
 171 }
 172 
 173 static void
 174 traverse_pause(traverse_data_t *td, const zbookmark_t *zb)
 175 {
 176         ASSERT(td->td_resume != NULL);
 177         ASSERT3U(zb->zb_level, ==, 0);
 178         bcopy(zb, td->td_resume, sizeof (*td->td_resume));
 179 }
 180 
 181 static int
 182 traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp,
 183     arc_buf_t *pbuf, blkptr_t *bp, const zbookmark_t *zb)
 184 {
 185         zbookmark_t czb;
 186         int err = 0, lasterr = 0;
 187         arc_buf_t *buf = NULL;
 188         prefetch_data_t *pd = td->td_pfd;
 189         boolean_t hard = td->td_flags & TRAVERSE_HARD;
 190         boolean_t pause = B_FALSE;
 191 
 192         switch (resume_skip_check(td, dnp, zb)) {
 193         case RESUME_SKIP_ALL:
 194                 return (0);
 195         case RESUME_SKIP_CHILDREN:
 196                 goto post;
 197         case RESUME_SKIP_NONE:




 157                         return (RESUME_SKIP_ALL);
 158 
 159                 /*
 160                  * If we found the block we're trying to resume from, zero
 161                  * the bookmark out to indicate that we have resumed.
 162                  */
 163                 ASSERT3U(zb->zb_object, <=, td->td_resume->zb_object);
 164                 if (bcmp(zb, td->td_resume, sizeof (*zb)) == 0) {
 165                         bzero(td->td_resume, sizeof (*zb));
 166                         if (td->td_flags & TRAVERSE_POST)
 167                                 return (RESUME_SKIP_CHILDREN);
 168                 }
 169         }
 170         return (RESUME_SKIP_NONE);
 171 }
 172 
 173 static void
 174 traverse_pause(traverse_data_t *td, const zbookmark_t *zb)
 175 {
 176         ASSERT(td->td_resume != NULL);
 177         ASSERT0(zb->zb_level);
 178         bcopy(zb, td->td_resume, sizeof (*td->td_resume));
 179 }
 180 
 181 static int
 182 traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp,
 183     arc_buf_t *pbuf, blkptr_t *bp, const zbookmark_t *zb)
 184 {
 185         zbookmark_t czb;
 186         int err = 0, lasterr = 0;
 187         arc_buf_t *buf = NULL;
 188         prefetch_data_t *pd = td->td_pfd;
 189         boolean_t hard = td->td_flags & TRAVERSE_HARD;
 190         boolean_t pause = B_FALSE;
 191 
 192         switch (resume_skip_check(td, dnp, zb)) {
 193         case RESUME_SKIP_ALL:
 194                 return (0);
 195         case RESUME_SKIP_CHILDREN:
 196                 goto post;
 197         case RESUME_SKIP_NONE: