Merge branch 'for-3.11/core' of git://git.kernel.dk/linux-block
[linux-2.6-block.git] / fs / block_dev.c
index 85f5c85ec91c050818495c49c1e4a2a669c14322..c7bda5cd3da74daa998d1fda16c3e78240d7e872 100644 (file)
@@ -332,31 +332,10 @@ static int blkdev_write_end(struct file *file, struct address_space *mapping,
 static loff_t block_llseek(struct file *file, loff_t offset, int whence)
 {
        struct inode *bd_inode = file->f_mapping->host;
-       loff_t size;
        loff_t retval;
 
        mutex_lock(&bd_inode->i_mutex);
-       size = i_size_read(bd_inode);
-
-       retval = -EINVAL;
-       switch (whence) {
-               case SEEK_END:
-                       offset += size;
-                       break;
-               case SEEK_CUR:
-                       offset += file->f_pos;
-               case SEEK_SET:
-                       break;
-               default:
-                       goto out;
-       }
-       if (offset >= 0 && offset <= size) {
-               if (offset != file->f_pos) {
-                       file->f_pos = offset;
-               }
-               retval = offset;
-       }
-out:
+       retval = fixed_size_llseek(file, offset, whence, i_size_read(bd_inode));
        mutex_unlock(&bd_inode->i_mutex);
        return retval;
 }
@@ -1590,6 +1569,7 @@ static const struct address_space_operations def_blk_aops = {
        .writepages     = generic_writepages,
        .releasepage    = blkdev_releasepage,
        .direct_IO      = blkdev_direct_IO,
+       .is_dirty_writeback = buffer_check_dirty_writeback,
 };
 
 const struct file_operations def_blk_fops = {