View | Details | Raw Unified | Return to bug 43049
Collapse All | Expand All

(-)file_not_specified_in_diff (-13 / +28 lines)
Line     Link Here 
0
-- a/fs/ext3/ext3.h
0
++ b/fs/ext3/ext3.h
 Lines 340-345   struct ext3_inode_info { Link Here 
340
 * Mount flags
340
 * Mount flags
341
 */
341
 */
342
#define EXT3_MOUNT_CHECK		0x00001	/* Do mount-time checks */
342
#define EXT3_MOUNT_CHECK		0x00001	/* Do mount-time checks */
343
#define EXT3_MOUNT_NO_MBCACHE		0x00002 /* Disable mbcache */
343
/* EXT3_MOUNT_OLDALLOC was there */
344
/* EXT3_MOUNT_OLDALLOC was there */
344
#define EXT3_MOUNT_GRPID		0x00004	/* Create files with directory's group */
345
#define EXT3_MOUNT_GRPID		0x00004	/* Create files with directory's group */
345
#define EXT3_MOUNT_DEBUG		0x00008	/* Some debugging messages */
346
#define EXT3_MOUNT_DEBUG		0x00008	/* Some debugging messages */
346
-- a/fs/ext3/super.c
347
++ b/fs/ext3/super.c
 Lines 814-819   enum { Link Here 
814
	Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_jqfmt_vfsv1, Opt_quota,
814
	Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_jqfmt_vfsv1, Opt_quota,
815
	Opt_noquota, Opt_ignore, Opt_barrier, Opt_nobarrier, Opt_err,
815
	Opt_noquota, Opt_ignore, Opt_barrier, Opt_nobarrier, Opt_err,
816
	Opt_resize, Opt_usrquota, Opt_grpquota
816
	Opt_resize, Opt_usrquota, Opt_grpquota
817
	,Opt_no_mbcache
817
};
818
};
818
819
819
static const match_table_t tokens = {
820
static const match_table_t tokens = {
 Lines 871-876   static const match_table_t tokens = { Link Here 
871
	{Opt_nobarrier, "nobarrier"},
872
	{Opt_nobarrier, "nobarrier"},
872
	{Opt_resize, "resize"},
873
	{Opt_resize, "resize"},
873
	{Opt_err, NULL},
874
	{Opt_err, NULL},
875
	{Opt_no_mbcache, "no_mbcache"},
874
};
876
};
875
877
876
static ext3_fsblk_t get_sb_block(void **data, struct super_block *sb)
878
static ext3_fsblk_t get_sb_block(void **data, struct super_block *sb)
 Lines 1275-1280   static inst parse_options { Link Here 
1275
			ext3_msg(sb, KERN_WARNING,
1277
			ext3_msg(sb, KERN_WARNING,
1276
				"warning: ignoring deprecated bh option");
1278
				"warning: ignoring deprecated bh option");
1277
			break;
1279
			break;
1280
		case Opt_no_mbcache:
1281
			set_opt(sbi->s_mount_opt, EXT3_MOUNT_NO_MBCACHE);
1282
			break;
1278
		default:
1283
		default:
1279
			ext3_msg(sb, KERN_ERR,
1284
			ext3_msg(sb, KERN_ERR,
1280
				"error: unrecognized mount option \"%s\" "
1285
				"error: unrecognized mount option \"%s\" "
1281
-- a/fs/ext3/xattr.c
1286
++ b/fs/ext3/xattr.c
 Lines 88-94    Link Here 
88
# define ea_bdebug(f...)
88
# define ea_bdebug(f...)
89
#endif
89
#endif
90
90
91
static void ext3_xattr_cache_insert(struct buffer_head *);
91
static void ext3_xattr_cache_insert(struct inode *, struct buffer_head *);
92
static struct buffer_head *ext3_xattr_cache_find(struct inode *,
92
static struct buffer_head *ext3_xattr_cache_find(struct inode *,
93
						 struct ext3_xattr_header *,
93
						 struct ext3_xattr_header *,
94
						 struct mb_cache_entry **);
94
						 struct mb_cache_entry **);
 Lines 235-241   bad_block: Link Here 
235
		error = -EIO;
234
		error = -EIO;
236
		goto cleanup;
235
		goto cleanup;
237
	}
236
	}
238
	ext3_xattr_cache_insert(bh);
237
	ext3_xattr_cache_insert(inode, bh);
239
	entry = BFIRST(bh);
238
	entry = BFIRST(bh);
240
	error = ext3_xattr_find_entry(&entry, name_index, name, bh->b_size, 1);
239
	error = ext3_xattr_find_entry(&entry, name_index, name, bh->b_size, 1);
241
	if (error == -EIO)
240
	if (error == -EIO)
 Lines 379-385   ext3_xattr_block_list(struct dentry *den Link Here 
379
		error = -EIO;
377
		error = -EIO;
380
		goto cleanup;
378
		goto cleanup;
381
	}
379
	}
382
	ext3_xattr_cache_insert(bh);
380
	ext3_xattr_cache_insert(inode, bh);
383
	error = ext3_xattr_list_entries(dentry, BFIRST(bh), buffer, buffer_size);
381
	error = ext3_xattr_list_entries(dentry, BFIRST(bh), buffer, buffer_size);
384
382
385
cleanup:
383
cleanup:
 Lines 476-482   ext3_xattr_release_block(handle_t *handl Link Here 
476
	struct mb_cache_entry *ce = NULL;
474
	struct mb_cache_entry *ce = NULL;
477
	int error = 0;
475
	int error = 0;
478
476
479
	ce = mb_cache_entry_get(ext3_xattr_cache, bh->b_bdev, bh->b_blocknr);
477
	if (!test_opt(inode->i_sb, NO_MBCACHE))
478
		ce = mb_cache_entry_get(ext3_xattr_cache, bh->b_bdev, bh->b_blocknr);
480
	error = ext3_journal_get_write_access(handle, bh);
479
	error = ext3_journal_get_write_access(handle, bh);
481
	if (error)
480
	if (error)
482
		 goto out;
481
		 goto out;
 Lines 687-694   ext3_xattr_block_set(handle_t *handle, s Link Here 
687
	if (i->value && i->value_len > sb->s_blocksize)
686
	if (i->value && i->value_len > sb->s_blocksize)
688
		return -ENOSPC;
687
		return -ENOSPC;
689
	if (s->base) {
688
	if (s->base) {
690
		ce = mb_cache_entry_get(ext3_xattr_cache, bs->bh->b_bdev,
689
		if (!test_opt(inode->i_sb, NO_MBCACHE))
691
					bs->bh->b_blocknr);
690
			ce = mb_cache_entry_get(ext3_xattr_cache, bs->bh->b_bdev,
691
						bs->bh->b_blocknr);
692
		error = ext3_journal_get_write_access(handle, bs->bh);
692
		error = ext3_journal_get_write_access(handle, bs->bh);
693
		if (error)
693
		if (error)
694
			goto cleanup;
694
			goto cleanup;
 Lines 705-711   ext3_xattr_block_set(handle_t *handle, s Link Here 
705
				if (!IS_LAST_ENTRY(s->first))
705
				if (!IS_LAST_ENTRY(s->first))
706
					ext3_xattr_rehash(header(s->base),
706
					ext3_xattr_rehash(header(s->base),
707
							  s->here);
707
							  s->here);
708
				ext3_xattr_cache_insert(bs->bh);
708
				ext3_xattr_cache_insert(inode, bs->bh);
709
			}
709
			}
710
			unlock_buffer(bs->bh);
710
			unlock_buffer(bs->bh);
711
			if (error == -EIO)
711
			if (error == -EIO)
 Lines 787-793   inserted: Link Here 
787
				if (error)
787
				if (error)
788
					goto cleanup_dquot;
788
					goto cleanup_dquot;
789
			}
789
			}
790
			mb_cache_entry_release(ce);
790
			if (ce)
791
				mb_cache_entry_release(ce);
791
			ce = NULL;
792
			ce = NULL;
792
		} else if (bs->bh && s->base == bs->bh->b_data) {
793
		} else if (bs->bh && s->base == bs->bh->b_data) {
793
			/* We were modifying this block in-place. */
794
			/* We were modifying this block in-place. */
 Lines 828-834   getblk_failed: Link Here 
828
			memcpy(new_bh->b_data, s->base, new_bh->b_size);
828
			memcpy(new_bh->b_data, s->base, new_bh->b_size);
829
			set_buffer_uptodate(new_bh);
829
			set_buffer_uptodate(new_bh);
830
			unlock_buffer(new_bh);
830
			unlock_buffer(new_bh);
831
			ext3_xattr_cache_insert(new_bh);
831
			ext3_xattr_cache_insert(inode, new_bh);
832
			error = ext3_journal_dirty_metadata(handle, new_bh);
832
			error = ext3_journal_dirty_metadata(handle, new_bh);
833
			if (error)
833
			if (error)
834
				goto cleanup;
834
				goto cleanup;
 Lines 1131-1142   ext3_xattr_put_super(struct super_block Link Here 
1131
 * Returns 0, or a negative error number on failure.
1132
 * Returns 0, or a negative error number on failure.
1132
 */
1133
 */
1133
static void
1134
static void
1134
ext3_xattr_cache_insert(struct buffer_head *bh)
1135
ext3_xattr_cache_insert(struct inode *inode, struct buffer_head *bh)
1135
{
1136
{
1137
	struct super_block *sb = inode->i_sb;
1136
	__u32 hash = le32_to_cpu(BHDR(bh)->h_hash);
1138
	__u32 hash = le32_to_cpu(BHDR(bh)->h_hash);
1137
	struct mb_cache_entry *ce;
1139
	struct mb_cache_entry *ce;
1138
	int error;
1140
	int error;
1139
1141
1142
	if (test_opt(sb, NO_MBCACHE))
1143
		return;
1144
1140
	ce = mb_cache_entry_alloc(ext3_xattr_cache, GFP_NOFS);
1145
	ce = mb_cache_entry_alloc(ext3_xattr_cache, GFP_NOFS);
1141
	if (!ce) {
1146
	if (!ce) {
1142
		ea_bdebug(bh, "out of memory");
1147
		ea_bdebug(bh, "out of memory");
 Lines 1210-1215   ext3_xattr_cache_find(struct inode *inod Link Here 
1210
	__u32 hash = le32_to_cpu(header->h_hash);
1216
	__u32 hash = le32_to_cpu(header->h_hash);
1211
	struct mb_cache_entry *ce;
1217
	struct mb_cache_entry *ce;
1212
1218
1219
	if (test_opt(inode->i_sb, NO_MBCACHE))
1220
		return NULL;
1213
	if (!header->h_hash)
1221
	if (!header->h_hash)
1214
		return NULL;  /* never share */
1222
		return NULL;  /* never share */
1215
	ea_idebug(inode, "looking for cached blocks [%x]", (int)hash);
1223
	ea_idebug(inode, "looking for cached blocks [%x]", (int)hash);

Return to bug 43049