Page MenuHomeFreeBSD

Make camdd(8) protocol aware
ClosedPublic

Authored by chuck_tuffli.net on Jun 15 2017, 9:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 15 2024, 8:37 AM
Unknown Object (File)
Mar 13 2024, 8:02 AM
Unknown Object (File)
Jan 24 2024, 11:37 PM
Unknown Object (File)
Jan 21 2024, 11:31 PM
Unknown Object (File)
Dec 23 2023, 2:41 AM
Unknown Object (File)
Dec 13 2023, 6:19 AM
Unknown Object (File)
Nov 25 2023, 7:53 PM
Unknown Object (File)
Nov 22 2023, 1:13 PM
Subscribers

Details

Summary

This is a slight restructuring of camdd(8) to allow it to use protocols other than SCSI in the future.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ken requested changes to this revision.Jun 20 2017, 2:01 PM

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.

This revision now requires changes to proceed.Jun 20 2017, 2:01 PM
chuck_tuffli.net added inline comments.
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

See the inline comments. Thanks!

usr.sbin/camdd/camdd.c
1259 ↗(On Diff #29687)

I agree, that would be good.

1333 ↗(On Diff #29687)

Ahh, I didn't realize that. Yes, could you put back the gotos? Thanks!

chuck_tuffli.net edited edge metadata.

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. :)

Looks good, thank you!

This revision is now accepted and ready to land.Jun 29 2017, 6:47 PM