]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - fs/udf/super.c
udf: add extent cache support in case of file reading
[linux.git] / fs / udf / super.c
index e9be396a558d944fde7086cce64d22c672cdc5b7..da8ce9f14387aab98fbdc8f6c3048b66d48bdc61 100644 (file)
@@ -134,6 +134,8 @@ static struct inode *udf_alloc_inode(struct super_block *sb)
        ei->i_next_alloc_goal = 0;
        ei->i_strat4096 = 0;
        init_rwsem(&ei->i_data_sem);
+       ei->cached_extent.lstart = -1;
+       spin_lock_init(&ei->i_extent_cache_lock);
 
        return &ei->vfs_inode;
 }
@@ -1866,6 +1868,8 @@ static void udf_open_lvid(struct super_block *sb)
        mark_buffer_dirty(bh);
        sbi->s_lvid_dirty = 0;
        mutex_unlock(&sbi->s_alloc_mutex);
+       /* Make opening of filesystem visible on the media immediately */
+       sync_dirty_buffer(bh);
 }
 
 static void udf_close_lvid(struct super_block *sb)
@@ -1906,6 +1910,8 @@ static void udf_close_lvid(struct super_block *sb)
        mark_buffer_dirty(bh);
        sbi->s_lvid_dirty = 0;
        mutex_unlock(&sbi->s_alloc_mutex);
+       /* Make closing of filesystem visible on the media immediately */
+       sync_dirty_buffer(bh);
 }
 
 u64 lvid_get_unique_id(struct super_block *sb)