Page MenuHomeFreeBSD

cuse: Improve server cleanup
Needs ReviewPublic

Authored by christos on Mon, Sep 21, 11:31 AM.

Details

Reviewers
markj
emaste
kib
Summary

Factor out cuse_server_unref()'s device cleanup look into a new
cuse_server_free_devs_locked(), and use it in cuse_server_free() too.

In cuse_kern_init(), delete the infinite loop which waits for all open
/dev/cuse instances to exit, and instead call destroy_dev() directly,
which runs their cdevpriv destructor.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 77147
Build 74030: arc lint + arc unit

Event Timeline

BTW, there is almost always a blank line after each code line in cuse.c. It eats the screen space without giving any clarity.

sys/fs/cuse/cuse.c
295

I think MPASS() is enough there.

656

Again, I think you need to destroy_dev() before iterating over the hcli tailq.

1276

I think you should use make_dev_s() there to set si_drv1 atomically when creating the device.

In D59872#1373978, @kib wrote:

BTW, there is almost always a blank line after each code line in cuse.c. It eats the screen space without giving any clarity.

I will do a style(9) and blank line clean up at some point.

sys/fs/cuse/cuse.c
656

The hcli loop sets is_closing, so why would we want to destroy_dev() first?

1276
christos marked an inline comment as done.

Address Konstantin's comments, minus the destroy_dev() comment.