diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-12-26 09:52:54 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-12-26 09:52:54 -0500 |
commit | 7f50548abb5454bd82c25aae15f0a3bf6a530f46 (patch) | |
tree | 175b5d695437151f0f9f778ad8eb7f274468842f /fs/ubifs | |
parent | b3172f222ab5afdc91ea058bd11c42cf169728f3 (diff) | |
parent | 6b7b284958d47b77d06745b36bc7f36dab769d9b (diff) |
Merge commit 'v2.6.33-rc2' into for-2.6.33
Diffstat (limited to 'fs/ubifs')
-rw-r--r-- | fs/ubifs/debug.c | 11 | ||||
-rw-r--r-- | fs/ubifs/file.c | 15 | ||||
-rw-r--r-- | fs/ubifs/recovery.c | 2 | ||||
-rw-r--r-- | fs/ubifs/super.c | 27 |
4 files changed, 22 insertions, 33 deletions
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c index dbc093afd946..90492327b383 100644 --- a/fs/ubifs/debug.c +++ b/fs/ubifs/debug.c | |||
@@ -350,13 +350,8 @@ void dbg_dump_node(const struct ubifs_info *c, const void *node) | |||
350 | le32_to_cpu(sup->fmt_version)); | 350 | le32_to_cpu(sup->fmt_version)); |
351 | printk(KERN_DEBUG "\ttime_gran %u\n", | 351 | printk(KERN_DEBUG "\ttime_gran %u\n", |
352 | le32_to_cpu(sup->time_gran)); | 352 | le32_to_cpu(sup->time_gran)); |
353 | printk(KERN_DEBUG "\tUUID %02X%02X%02X%02X-%02X%02X" | 353 | printk(KERN_DEBUG "\tUUID %pUB\n", |
354 | "-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X\n", | 354 | sup->uuid); |
355 | sup->uuid[0], sup->uuid[1], sup->uuid[2], sup->uuid[3], | ||
356 | sup->uuid[4], sup->uuid[5], sup->uuid[6], sup->uuid[7], | ||
357 | sup->uuid[8], sup->uuid[9], sup->uuid[10], sup->uuid[11], | ||
358 | sup->uuid[12], sup->uuid[13], sup->uuid[14], | ||
359 | sup->uuid[15]); | ||
360 | break; | 355 | break; |
361 | } | 356 | } |
362 | case UBIFS_MST_NODE: | 357 | case UBIFS_MST_NODE: |
@@ -2014,7 +2009,7 @@ static int check_leaf(struct ubifs_info *c, struct ubifs_zbranch *zbr, | |||
2014 | inum = key_inum_flash(c, &dent->key); | 2009 | inum = key_inum_flash(c, &dent->key); |
2015 | fscki1 = read_add_inode(c, priv, inum); | 2010 | fscki1 = read_add_inode(c, priv, inum); |
2016 | if (IS_ERR(fscki1)) { | 2011 | if (IS_ERR(fscki1)) { |
2017 | err = PTR_ERR(fscki); | 2012 | err = PTR_ERR(fscki1); |
2018 | ubifs_err("error %d while processing entry node and " | 2013 | ubifs_err("error %d while processing entry node and " |
2019 | "trying to find parent inode node %lu", | 2014 | "trying to find parent inode node %lu", |
2020 | err, (unsigned long)inum); | 2015 | err, (unsigned long)inum); |
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index 1009adc8d602..16a6444330ec 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c | |||
@@ -45,7 +45,7 @@ | |||
45 | * | 45 | * |
46 | * Similarly, @i_mutex is not always locked in 'ubifs_readpage()', e.g., the | 46 | * Similarly, @i_mutex is not always locked in 'ubifs_readpage()', e.g., the |
47 | * read-ahead path does not lock it ("sys_read -> generic_file_aio_read -> | 47 | * read-ahead path does not lock it ("sys_read -> generic_file_aio_read -> |
48 | * ondemand_readahead -> readpage"). In case of readahead, @I_LOCK flag is not | 48 | * ondemand_readahead -> readpage"). In case of readahead, @I_SYNC flag is not |
49 | * set as well. However, UBIFS disables readahead. | 49 | * set as well. However, UBIFS disables readahead. |
50 | */ | 50 | */ |
51 | 51 | ||
@@ -1389,7 +1389,6 @@ static ssize_t ubifs_aio_write(struct kiocb *iocb, const struct iovec *iov, | |||
1389 | unsigned long nr_segs, loff_t pos) | 1389 | unsigned long nr_segs, loff_t pos) |
1390 | { | 1390 | { |
1391 | int err; | 1391 | int err; |
1392 | ssize_t ret; | ||
1393 | struct inode *inode = iocb->ki_filp->f_mapping->host; | 1392 | struct inode *inode = iocb->ki_filp->f_mapping->host; |
1394 | struct ubifs_info *c = inode->i_sb->s_fs_info; | 1393 | struct ubifs_info *c = inode->i_sb->s_fs_info; |
1395 | 1394 | ||
@@ -1397,17 +1396,7 @@ static ssize_t ubifs_aio_write(struct kiocb *iocb, const struct iovec *iov, | |||
1397 | if (err) | 1396 | if (err) |
1398 | return err; | 1397 | return err; |
1399 | 1398 | ||
1400 | ret = generic_file_aio_write(iocb, iov, nr_segs, pos); | 1399 | return generic_file_aio_write(iocb, iov, nr_segs, pos); |
1401 | if (ret < 0) | ||
1402 | return ret; | ||
1403 | |||
1404 | if (ret > 0 && (IS_SYNC(inode) || iocb->ki_filp->f_flags & O_SYNC)) { | ||
1405 | err = ubifs_sync_wbufs_by_inode(c, inode); | ||
1406 | if (err) | ||
1407 | return err; | ||
1408 | } | ||
1409 | |||
1410 | return ret; | ||
1411 | } | 1400 | } |
1412 | 1401 | ||
1413 | static int ubifs_set_page_dirty(struct page *page) | 1402 | static int ubifs_set_page_dirty(struct page *page) |
diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c index f94ddf7efba0..868a55ee080f 100644 --- a/fs/ubifs/recovery.c +++ b/fs/ubifs/recovery.c | |||
@@ -23,7 +23,7 @@ | |||
23 | /* | 23 | /* |
24 | * This file implements functions needed to recover from unclean un-mounts. | 24 | * This file implements functions needed to recover from unclean un-mounts. |
25 | * When UBIFS is mounted, it checks a flag on the master node to determine if | 25 | * When UBIFS is mounted, it checks a flag on the master node to determine if |
26 | * an un-mount was completed sucessfully. If not, the process of mounting | 26 | * an un-mount was completed successfully. If not, the process of mounting |
27 | * incorparates additional checking and fixing of on-flash data structures. | 27 | * incorparates additional checking and fixing of on-flash data structures. |
28 | * UBIFS always cleans away all remnants of an unclean un-mount, so that | 28 | * UBIFS always cleans away all remnants of an unclean un-mount, so that |
29 | * errors do not accumulate. However UBIFS defers recovery if it is mounted | 29 | * errors do not accumulate. However UBIFS defers recovery if it is mounted |
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 333e181ee987..43f9d19a6f33 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c | |||
@@ -1393,12 +1393,7 @@ static int mount_ubifs(struct ubifs_info *c) | |||
1393 | c->leb_size, c->leb_size >> 10); | 1393 | c->leb_size, c->leb_size >> 10); |
1394 | dbg_msg("data journal heads: %d", | 1394 | dbg_msg("data journal heads: %d", |
1395 | c->jhead_cnt - NONDATA_JHEADS_CNT); | 1395 | c->jhead_cnt - NONDATA_JHEADS_CNT); |
1396 | dbg_msg("UUID: %02X%02X%02X%02X-%02X%02X" | 1396 | dbg_msg("UUID: %pUB", c->uuid); |
1397 | "-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X", | ||
1398 | c->uuid[0], c->uuid[1], c->uuid[2], c->uuid[3], | ||
1399 | c->uuid[4], c->uuid[5], c->uuid[6], c->uuid[7], | ||
1400 | c->uuid[8], c->uuid[9], c->uuid[10], c->uuid[11], | ||
1401 | c->uuid[12], c->uuid[13], c->uuid[14], c->uuid[15]); | ||
1402 | dbg_msg("big_lpt %d", c->big_lpt); | 1397 | dbg_msg("big_lpt %d", c->big_lpt); |
1403 | dbg_msg("log LEBs: %d (%d - %d)", | 1398 | dbg_msg("log LEBs: %d (%d - %d)", |
1404 | c->log_lebs, UBIFS_LOG_LNUM, c->log_last); | 1399 | c->log_lebs, UBIFS_LOG_LNUM, c->log_last); |
@@ -1842,22 +1837,32 @@ const struct super_operations ubifs_super_operations = { | |||
1842 | * @name: UBI volume name | 1837 | * @name: UBI volume name |
1843 | * @mode: UBI volume open mode | 1838 | * @mode: UBI volume open mode |
1844 | * | 1839 | * |
1845 | * There are several ways to specify UBI volumes when mounting UBIFS: | 1840 | * The primary method of mounting UBIFS is by specifying the UBI volume |
1846 | * o ubiX_Y - UBI device number X, volume Y; | 1841 | * character device node path. However, UBIFS may also be mounted withoug any |
1847 | * o ubiY - UBI device number 0, volume Y; | 1842 | * character device node using one of the following methods: |
1843 | * | ||
1844 | * o ubiX_Y - mount UBI device number X, volume Y; | ||
1845 | * o ubiY - mount UBI device number 0, volume Y; | ||
1848 | * o ubiX:NAME - mount UBI device X, volume with name NAME; | 1846 | * o ubiX:NAME - mount UBI device X, volume with name NAME; |
1849 | * o ubi:NAME - mount UBI device 0, volume with name NAME. | 1847 | * o ubi:NAME - mount UBI device 0, volume with name NAME. |
1850 | * | 1848 | * |
1851 | * Alternative '!' separator may be used instead of ':' (because some shells | 1849 | * Alternative '!' separator may be used instead of ':' (because some shells |
1852 | * like busybox may interpret ':' as an NFS host name separator). This function | 1850 | * like busybox may interpret ':' as an NFS host name separator). This function |
1853 | * returns ubi volume object in case of success and a negative error code in | 1851 | * returns UBI volume description object in case of success and a negative |
1854 | * case of failure. | 1852 | * error code in case of failure. |
1855 | */ | 1853 | */ |
1856 | static struct ubi_volume_desc *open_ubi(const char *name, int mode) | 1854 | static struct ubi_volume_desc *open_ubi(const char *name, int mode) |
1857 | { | 1855 | { |
1856 | struct ubi_volume_desc *ubi; | ||
1858 | int dev, vol; | 1857 | int dev, vol; |
1859 | char *endptr; | 1858 | char *endptr; |
1860 | 1859 | ||
1860 | /* First, try to open using the device node path method */ | ||
1861 | ubi = ubi_open_volume_path(name, mode); | ||
1862 | if (!IS_ERR(ubi)) | ||
1863 | return ubi; | ||
1864 | |||
1865 | /* Try the "nodev" method */ | ||
1861 | if (name[0] != 'u' || name[1] != 'b' || name[2] != 'i') | 1866 | if (name[0] != 'u' || name[1] != 'b' || name[2] != 'i') |
1862 | return ERR_PTR(-EINVAL); | 1867 | return ERR_PTR(-EINVAL); |
1863 | 1868 | ||