Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4b3cc340614e552c476bec29d984c5a363b26494
Commit:     4b3cc340614e552c476bec29d984c5a363b26494
Parent:     aeddb87718823fb81b896155b34d1bb4c8cae874
Author:     Artem Bityutskiy <[EMAIL PROTECTED]>
AuthorDate: Wed Dec 26 15:59:39 2007 +0200
Committer:  Artem Bityutskiy <[EMAIL PROTECTED]>
CommitDate: Wed Dec 26 19:15:18 2007 +0200

    UBI: bugfix: do not forget to increment vol_count
    
    When creating a new volume, do not forget to increment the
    vol_count variable.
    
    Also, users are not interested in internal volumes, so do not show
    them in the volumes_count sysfs file.
    
    Signed-off-by: Artem Bityutskiy <[EMAIL PROTECTED]>
---
 drivers/mtd/ubi/build.c |    2 +-
 drivers/mtd/ubi/vmt.c   |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index b967191..8f1f9fe 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -246,7 +246,7 @@ static ssize_t dev_attribute_show(struct device *dev,
        else if (attr == &dev_total_eraseblocks)
                ret = sprintf(buf, "%d\n", ubi->good_peb_count);
        else if (attr == &dev_volumes_count)
-               ret = sprintf(buf, "%d\n", ubi->vol_count);
+               ret = sprintf(buf, "%d\n", ubi->vol_count - UBI_INT_VOL_COUNT);
        else if (attr == &dev_max_ec)
                ret = sprintf(buf, "%d\n", ubi->max_ec);
        else if (attr == &dev_reserved_for_bad)
diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c
index 42d3dd7..177227e 100644
--- a/drivers/mtd/ubi/vmt.c
+++ b/drivers/mtd/ubi/vmt.c
@@ -357,6 +357,7 @@ int ubi_create_volume(struct ubi_device *ubi, struct 
ubi_mkvol_req *req)
 
        spin_lock(&ubi->volumes_lock);
        ubi->volumes[vol_id] = vol;
+       ubi->vol_count += 1;
        spin_unlock(&ubi->volumes_lock);
 
        paranoid_check_volumes(ubi);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to