X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fieee1394%2Fnodemgr.c;h=d541b508a159b8103c128a0cc4f3d76d9bdd6d6a;hb=b197ba3c70638a3a2ae39296781912f26ac0f991;hp=948f1b8c42388152ff8d6f9d8445e75bcb957281;hpb=dbe1ab9514c231c9b062140a107d9dea0eabefcc;p=linux-2.6 diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c index 948f1b8c42..d541b508a1 100644 --- a/drivers/ieee1394/nodemgr.c +++ b/drivers/ieee1394/nodemgr.c @@ -8,8 +8,8 @@ * directory of the kernel sources for details. */ +#include #include -#include #include #include #include @@ -334,10 +334,12 @@ static ssize_t fw_show_ne_bus_options(struct device *dev, struct device_attribut static DEVICE_ATTR(bus_options,S_IRUGO,fw_show_ne_bus_options,NULL); +/* tlabels_free, tlabels_allocations, tlabels_mask are read non-atomically + * here, therefore displayed values may be occasionally wrong. */ static ssize_t fw_show_ne_tlabels_free(struct device *dev, struct device_attribute *attr, char *buf) { struct node_entry *ne = container_of(dev, struct node_entry, device); - return sprintf(buf, "%d\n", atomic_read(&ne->tpool->count.count) + 1); + return sprintf(buf, "%d\n", 64 - bitmap_weight(ne->tpool->pool, 64)); } static DEVICE_ATTR(tlabels_free,S_IRUGO,fw_show_ne_tlabels_free,NULL);