This is a slight restructuring of camdd(8) to allow it to use protocols other than SCSI in the future.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
This looks good. Change the bzero() to the CCB clearing macro and I think it's good to go. Thanks for doing this!
usr.sbin/camdd/camdd.c | ||
---|---|---|
1272 ↗ | (On Diff #29687) | This should use CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cpi); |
1333 ↗ | (On Diff #29687) | Getting rid of all the gotos? It's fine here when there isn't much cleanup to be done in the case of an error. I would rather we keep them in other places where there is more to be done in the error case, so we don't wind up with duplicated free(foo), etc. calls. |
usr.sbin/camdd/camdd.c | ||
---|---|---|
1259 ↗ | (On Diff #29687) | @ken, I'm thinking this function should be named camdd_get_cgd for consistency, yes? |
1333 ↗ | (On Diff #29687) | This was part of the changes from https://reviews.freebsd.org/D7373 , but I'm happy to put back the goto's |
Updated patch based on feedback, including:
- use CCB_CLEAR_ALL_EXCEPT_HDR instead of bzero
- restored goto's
- fixed a log message
One more change (see inline comments) and I think we're good. Thanks!
usr.sbin/camdd/camdd.c | ||
---|---|---|
1350 ↗ | (On Diff #30071) | Thanks for putting most of the gotos back! Please put this one back too. |
usr.sbin/camdd/camdd.c | ||
---|---|---|
1350 ↗ | (On Diff #30071) | The thought here was to invert the sense of the maxsector check and avoid the goto altogether. That said, I can revert this too if you'd rather have it the old way. |
usr.sbin/camdd/camdd.c | ||
---|---|---|
1350 ↗ | (On Diff #30071) | Ahh. The goal is to reduce the level of indentation when it isn't really necessary, and the goto is the means to that end. :) |