[ENBD] md5sum switch

Peter T. Breuer ptb at it.uc3m.es
Sat Jan 10 12:31:34 MST 2004


"Also sprach ptb:"
> "Also sprach Peter T. Breuer:"
> Well - I can see how one is supposed to do it ... one can make a subdir
> and let the subdir have subdirs for every device. Hmmm. Unfortunately
> the whole C structure concerned (which has a field "child" for a subdir)
> seems to have to be static, and yet has to control variables which are
> allocated dynamically ...  owww.

Well, more or less, I have done it - it's still horrible.  Every time
one starts a new device one has to unregister and rerister the syctl
tables. Horrible horrible race conditions, which I haven't even tried
to avoid.

   betty:/usr/oboe/ptb/lang/c/nbd/nbd-2.4.32% ls /proc/sys/dev/enbd/devices/b/
   total 0
   -rw-r--r--    1 root            0 Jan 10 20:28 md5_off_threshold
   -rw-r--r--    1 root            0 Jan 10 20:28 md5_on_threshold
   betty:/usr/oboe/ptb/lang/c/nbd/nbd-2.4.32% 

   betty:/usr/oboe/ptb/lang/c/nbd/nbd-2.4.32% cat /proc/sys/dev/enbd/devices/b/md5_off_threshold
   10
   betty:/usr/oboe/ptb/lang/c/nbd/nbd-2.4.32% 

and that is a direct control over the per-device threshold (which in
turn is enough to switch things on and off if one knows what negative
numbers do).

Now, how do I get sysctl to look at a _single_ _bit_ in a atomic_type 32
bit flag?

Somehow I get the awful feeling I  am going to have to write that
kernel routine. And where is the sysctl "refresh" function ...


Peter


More information about the ENBD mailing list