Re: [PATCH] loop: add some basic read-only sysfs attributes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 20, 2010 at 05:02:37PM +0200, Milan Broz wrote:
>  On 07/20/2010 12:53 PM, Karel Zak wrote:
> >  
> >  My suggestion is to use /sys as alternative to useless
> >  LOOP_GET_STATUS ioctl, something like:
> >
> >     /sys/block/<devname>/loop/backing_file
> >     /sys/block/<devname>/loop/offset
> >     /sys/block/<devname>/loop/sizelimit
> >     /sys/block/<devname>/loop/autoclear
> Maybe naive, but quick implementation of this idea...

 Cool. Thanks!

> +static LOOP_ATTR_RO(backing_file);
> +static LOOP_ATTR_RO(offset);
> +static LOOP_ATTR_RO(readonly);
> +static LOOP_ATTR_RO(autoclear);
> +
> +static struct attribute *loop_attrs[] = {
> +	&loop_attr_backing_file.attr,
> +	&loop_attr_offset.attr,
> +	&loop_attr_readonly.attr,
> +	&loop_attr_autoclear.attr,
> +	NULL,
> +};


 It would be nice to have accessible loop_device->lo_sizelimit attribute too.

 I think the "readonly" attribute is unnecessary, this info is already
 exported by /sys/block/loopN/ro.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux