]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/block_dev.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
[linux-2.6-omap-h63xx.git] / fs / block_dev.c
index 33650fc537c4849cc18cfc72d68a9895137d4c04..d06fe3c3dd3f55751c381adc3a68cc2a25dadc61 100644 (file)
@@ -879,9 +879,7 @@ static void flush_disk(struct block_device *bdev)
 }
 
 /**
- * check_disk_size_change - checks for disk size change and adjusts
- *                          bdev size.
- *
+ * check_disk_size_change - checks for disk size change and adjusts bdev size.
  * @disk: struct gendisk to check
  * @bdev: struct bdev to adjust.
  *
@@ -902,14 +900,13 @@ void check_disk_size_change(struct gendisk *disk, struct block_device *bdev)
                       "%s: detected capacity change from %lld to %lld\n",
                       name, bdev_size, disk_size);
                i_size_write(bdev->bd_inode, disk_size);
+               flush_disk(bdev);
        }
 }
 EXPORT_SYMBOL(check_disk_size_change);
 
 /**
- * revalidate_disk - wrapper for lower-level driver's revalidate_disk
- *                   call-back
- *
+ * revalidate_disk - wrapper for lower-level driver's revalidate_disk call-back
  * @disk: struct gendisk to be revalidated
  *
  * This routine is a wrapper for lower-level driver's revalidate_disk
@@ -1265,40 +1262,39 @@ EXPORT_SYMBOL(ioctl_by_bdev);
 
 /**
  * lookup_bdev  - lookup a struct block_device by name
- *
  * @path:      special file representing the block device
  *
- * Get a reference to the blockdevice at @path in the current
+ * Get a reference to the blockdevice at @pathname in the current
  * namespace if possible and return it.  Return ERR_PTR(error)
  * otherwise.
  */
-struct block_device *lookup_bdev(const char *path)
+struct block_device *lookup_bdev(const char *pathname)
 {
        struct block_device *bdev;
        struct inode *inode;
-       struct nameidata nd;
+       struct path path;
        int error;
 
-       if (!path || !*path)
+       if (!pathname || !*pathname)
                return ERR_PTR(-EINVAL);
 
-       error = path_lookup(path, LOOKUP_FOLLOW, &nd);
+       error = kern_path(pathname, LOOKUP_FOLLOW, &path);
        if (error)
                return ERR_PTR(error);
 
-       inode = nd.path.dentry->d_inode;
+       inode = path.dentry->d_inode;
        error = -ENOTBLK;
        if (!S_ISBLK(inode->i_mode))
                goto fail;
        error = -EACCES;
-       if (nd.path.mnt->mnt_flags & MNT_NODEV)
+       if (path.mnt->mnt_flags & MNT_NODEV)
                goto fail;
        error = -ENOMEM;
        bdev = bd_acquire(inode);
        if (!bdev)
                goto fail;
 out:
-       path_put(&nd.path);
+       path_put(&path);
        return bdev;
 fail:
        bdev = ERR_PTR(error);