Re: [PATCH] rbd: replace the rbd sysfs interface

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Sage Weil
Date: Wednesday, December 1, 2010 - 12:25 pm

Hi Greg,

I'm sure you're busy and as tired of this thread as we are, but I think
it's close and we have (I hope) just one remaining question.  The current
patch (see below) gives us

 /sys/bus/rbd/{add,remove}
 /sys/bus/rbd/devices/<devid>/                 <-- struct device
 /sys/bus/rbd/devices/<devid>/{some dev attrs}
 /sys/bus/rbd/devices/<devid>/snap_<snapid>/   <-- struct device
 /sys/bus/rbd/devices/<devid>/snap_<snapid>/{some snap attrs}

This works, and I is (I hope) using struct device properly.  The only 
problem, purely from a user interface standpoint, is that the snaps are 
mixed in with attributes, so anybody wanting to iterate over snaps needs 
to do something crufty like

 $ for snap in `ls /sys/bus/rbd/devices/$id | grep ^snap_ | cut -c 6-`; do ...

Adding an intermediate snaps/ subdir would let them instead do

 $ for snap in `ls /sys/bus/rbd/devices/$id/snaps/`; do ...

without worrying about the (arbitrarily named) snaps from colliding with 
device attributes.  Assuming that is a preferable interface, is the 
"right" way to do that to make "snaps" a struct device?  Or is there a 
good reason why that is not preferable?

Thanks!
sage



On Tue, 23 Nov 2010, Yehuda Sadeh wrote:

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] rbd: replace the rbd sysfs interface, Yehuda Sadeh, (Tue Nov 16, 5:32 pm)
Re: [PATCH] rbd: replace the rbd sysfs interface, Greg KH, (Wed Nov 17, 10:19 am)
Re: [PATCH] rbd: replace the rbd sysfs interface, Yehuda Sadeh Weinraub, (Wed Nov 17, 4:00 pm)
Re: [PATCH] rbd: replace the rbd sysfs interface, Greg KH, (Wed Nov 17, 6:30 pm)
Re: [PATCH] rbd: replace the rbd sysfs interface, Yehuda Sadeh Weinraub, (Thu Nov 18, 3:53 pm)
Re: [PATCH] rbd: replace the rbd sysfs interface, Greg KH, (Thu Nov 18, 7:08 pm)
Re: [PATCH] rbd: replace the rbd sysfs interface, Yehuda Sadeh Weinraub, (Fri Nov 19, 1:42 pm)
Re: [PATCH] rbd: replace the rbd sysfs interface, Yehuda Sadeh, (Mon Nov 22, 4:33 pm)
Re: [PATCH] rbd: replace the rbd sysfs interface, Greg KH, (Mon Nov 22, 5:14 pm)
Re: [PATCH] rbd: replace the rbd sysfs interface, Greg KH, (Mon Nov 22, 5:14 pm)
Re: [PATCH] rbd: replace the rbd sysfs interface, Sage Weil, (Mon Nov 22, 5:45 pm)
Re: [PATCH] rbd: replace the rbd sysfs interface, Yehuda Sadeh Weinraub, (Mon Nov 22, 5:48 pm)
Re: [PATCH] rbd: replace the rbd sysfs interface, Greg KH, (Mon Nov 22, 5:56 pm)
Re: [PATCH] rbd: replace the rbd sysfs interface, Greg KH, (Mon Nov 22, 5:58 pm)
Re: [PATCH] rbd: replace the rbd sysfs interface, Yehuda Sadeh Weinraub, (Mon Nov 22, 6:19 pm)
Re: [PATCH] rbd: replace the rbd sysfs interface, Yehuda Sadeh, (Tue Nov 23, 5:23 pm)
Re: [PATCH] rbd: replace the rbd sysfs interface, Sage Weil, (Wed Dec 1, 12:25 pm)
Re: [PATCH] rbd: replace the rbd sysfs interface, Greg KH, (Wed Dec 1, 12:47 pm)
Re: [PATCH] rbd: replace the rbd sysfs interface, Sage Weil, (Wed Dec 1, 1:08 pm)
Re: [PATCH] rbd: replace the rbd sysfs interface, Sage Weil, (Wed Dec 1, 5:11 pm)