Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 97873
b: refs/heads/master
c: 64a3dcd
h: refs/heads/master
i:
  97871: a532db3
v: v3
  • Loading branch information
Linus Torvalds committed Jun 9, 2008
1 parent 2aac368 commit 4a312d1
Show file tree
Hide file tree
Showing 17 changed files with 209 additions and 71 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 60d5019be8acef268f4676d229c490186d338fbc
refs/heads/master: 64a3dcd5d33d0c5253de2eba31b28a197d3e5e6b
12 changes: 10 additions & 2 deletions trunk/Documentation/filesystems/ext4.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,16 @@ commit=nrsec (*) Ext4 can be told to sync all its data and metadata
Setting it to very large values will improve
performance.

barrier=1 This enables/disables barriers. barrier=0 disables
it, barrier=1 enables it.
barrier=<0|1(*)> This enables/disables the use of write barriers in
the jbd code. barrier=0 disables, barrier=1 enables.
This also requires an IO stack which can support
barriers, and if jbd gets an error on a barrier
write, it will disable again with a warning.
Write barriers enforce proper on-disk ordering
of journal commits, making volatile disk write caches
safe to use, at some performance penalty. If
your disks are battery-backed in one way or another,
disabling barriers may safely improve performance.

orlov (*) This enables the new Orlov block allocator. It is
enabled by default.
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/sh/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ cflags-$(CONFIG_CPU_SH5) := $(call cc-option,-m5-32media-nofpu,)
cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb
cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml

cflags-y += $(call cc-option,-mno-fdpic)

#
# -Wa,-isa= tuning implies -Wa,-dsp for the versions of binutils that
# support it, while -Wa,-dsp by itself limits the range of usable opcodes
Expand Down
41 changes: 41 additions & 0 deletions trunk/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@

static struct plat_sci_port sci_platform_data[] = {
{
.mapbase = 0xffe00000,
.flags = UPF_BOOT_AUTOCONF,
.type = PORT_SCIF,
.irqs = { 80, 80, 80, 80 },
},{
.mapbase = 0xffe10000,
.flags = UPF_BOOT_AUTOCONF,
.type = PORT_SCIF,
.irqs = { 81, 81, 81, 81 },
},{
.mapbase = 0xffe20000,
.flags = UPF_BOOT_AUTOCONF,
.type = PORT_SCIF,
.irqs = { 82, 82, 82, 82 },
},{
.mapbase = 0xa4e30000,
.flags = UPF_BOOT_AUTOCONF,
.type = PORT_SCI,
Expand Down Expand Up @@ -73,9 +88,35 @@ static struct platform_device rtc_device = {
.resource = rtc_resources,
};

static struct resource sh7723_usb_host_resources[] = {
[0] = {
.name = "r8a66597_hcd",
.start = 0xa4d80000,
.end = 0xa4d800ff,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 65,
.end = 65,
.flags = IORESOURCE_IRQ,
},
};

static struct platform_device sh7723_usb_host_device = {
.name = "r8a66597_hcd",
.id = 0,
.dev = {
.dma_mask = NULL, /* not use dma */
.coherent_dma_mask = 0xffffffff,
},
.num_resources = ARRAY_SIZE(sh7723_usb_host_resources),
.resource = sh7723_usb_host_resources,
};

static struct platform_device *sh7723_devices[] __initdata = {
&sci_device,
&rtc_device,
&sh7723_usb_host_device,
};

static int __init sh7723_devices_setup(void)
Expand Down
9 changes: 5 additions & 4 deletions trunk/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,9 @@ static struct intc_sense_reg irq_sense_registers[] __initdata = {
};

static DECLARE_INTC_DESC(intc_irq_desc, "sh7763-irq", irq_vectors,
NULL, NULL, irq_mask_registers, irq_prio_registers,
irq_sense_registers);
NULL, irq_mask_registers, irq_prio_registers,
irq_sense_registers);


/* External interrupt pins in IRL mode */
static struct intc_vect irl_vectors[] __initdata = {
Expand Down Expand Up @@ -324,10 +325,10 @@ static struct intc_mask_reg irl7654_mask_registers[] __initdata = {
};

static DECLARE_INTC_DESC(intc_irl7654_desc, "sh7763-irl7654", irl_vectors,
NULL, NULL, irl7654_mask_registers, NULL, NULL);
NULL, irl7654_mask_registers, NULL, NULL);

static DECLARE_INTC_DESC(intc_irl3210_desc, "sh7763-irl3210", irl_vectors,
NULL, NULL, irl3210_mask_registers, NULL, NULL);
NULL, irl3210_mask_registers, NULL, NULL);

#define INTC_ICR0 0xffd00000
#define INTC_INTMSK0 0xffd00044
Expand Down
2 changes: 2 additions & 0 deletions trunk/block/genhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,8 @@ dev_t blk_lookup_devt(const char *name, int part)

mutex_lock(&block_class_lock);
list_for_each_entry(dev, &block_class.devices, node) {
if (dev->type != &disk_type)
continue;
if (strcmp(dev->bus_id, name) == 0) {
struct gendisk *disk = dev_to_disk(dev);

Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/usb/host/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ config USB_R8A66597_HCD
module will be called r8a66597-hcd.

config SUPERH_ON_CHIP_R8A66597
boolean "Enable SuperH on-chip USB like the R8A66597"
depends on USB_R8A66597_HCD && CPU_SUBTYPE_SH7366
boolean "Enable SuperH on-chip R8A66597 USB"
depends on USB_R8A66597_HCD && (CPU_SUBTYPE_SH7366 || CPU_SUBTYPE_SH7723)
help
Renesas SuperH processor has USB like the R8A66597.
This driver supported processor is SH7366.
This driver enables support for the on-chip R8A66597 in the
SH7366 and SH7723 processors.
71 changes: 62 additions & 9 deletions trunk/fs/ext4/balloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,46 @@ void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr,

}

static int ext4_block_in_group(struct super_block *sb, ext4_fsblk_t block,
ext4_group_t block_group)
{
ext4_group_t actual_group;
ext4_get_group_no_and_offset(sb, block, &actual_group, 0);
if (actual_group == block_group)
return 1;
return 0;
}

static int ext4_group_used_meta_blocks(struct super_block *sb,
ext4_group_t block_group)
{
ext4_fsblk_t tmp;
struct ext4_sb_info *sbi = EXT4_SB(sb);
/* block bitmap, inode bitmap, and inode table blocks */
int used_blocks = sbi->s_itb_per_group + 2;

if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_FLEX_BG)) {
struct ext4_group_desc *gdp;
struct buffer_head *bh;

gdp = ext4_get_group_desc(sb, block_group, &bh);
if (!ext4_block_in_group(sb, ext4_block_bitmap(sb, gdp),
block_group))
used_blocks--;

if (!ext4_block_in_group(sb, ext4_inode_bitmap(sb, gdp),
block_group))
used_blocks--;

tmp = ext4_inode_table(sb, gdp);
for (; tmp < ext4_inode_table(sb, gdp) +
sbi->s_itb_per_group; tmp++) {
if (!ext4_block_in_group(sb, tmp, block_group))
used_blocks -= 1;
}
}
return used_blocks;
}
/* Initializes an uninitialized block bitmap if given, and returns the
* number of blocks free in the group. */
unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh,
Expand Down Expand Up @@ -105,29 +145,42 @@ unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh,
free_blocks = group_blocks - bit_max;

if (bh) {
ext4_fsblk_t start;
ext4_fsblk_t start, tmp;
int flex_bg = 0;

for (bit = 0; bit < bit_max; bit++)
ext4_set_bit(bit, bh->b_data);

start = ext4_group_first_block_no(sb, block_group);

/* Set bits for block and inode bitmaps, and inode table */
ext4_set_bit(ext4_block_bitmap(sb, gdp) - start, bh->b_data);
ext4_set_bit(ext4_inode_bitmap(sb, gdp) - start, bh->b_data);
for (bit = (ext4_inode_table(sb, gdp) - start),
bit_max = bit + sbi->s_itb_per_group; bit < bit_max; bit++)
ext4_set_bit(bit, bh->b_data);
if (EXT4_HAS_INCOMPAT_FEATURE(sb,
EXT4_FEATURE_INCOMPAT_FLEX_BG))
flex_bg = 1;

/* Set bits for block and inode bitmaps, and inode table */
tmp = ext4_block_bitmap(sb, gdp);
if (!flex_bg || ext4_block_in_group(sb, tmp, block_group))
ext4_set_bit(tmp - start, bh->b_data);

tmp = ext4_inode_bitmap(sb, gdp);
if (!flex_bg || ext4_block_in_group(sb, tmp, block_group))
ext4_set_bit(tmp - start, bh->b_data);

tmp = ext4_inode_table(sb, gdp);
for (; tmp < ext4_inode_table(sb, gdp) +
sbi->s_itb_per_group; tmp++) {
if (!flex_bg ||
ext4_block_in_group(sb, tmp, block_group))
ext4_set_bit(tmp - start, bh->b_data);
}
/*
* Also if the number of blocks within the group is
* less than the blocksize * 8 ( which is the size
* of bitmap ), set rest of the block bitmap to 1
*/
mark_bitmap_end(group_blocks, sb->s_blocksize * 8, bh->b_data);
}

return free_blocks - sbi->s_itb_per_group - 2;
return free_blocks - ext4_group_used_meta_blocks(sb, block_group);
}


Expand Down
8 changes: 4 additions & 4 deletions trunk/fs/ext4/mballoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2745,8 +2745,6 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
sbi = EXT4_SB(sb);
es = sbi->s_es;

ext4_debug("using block group %lu(%d)\n", ac->ac_b_ex.fe_group,
gdp->bg_free_blocks_count);

err = -EIO;
bitmap_bh = read_block_bitmap(sb, ac->ac_b_ex.fe_group);
Expand All @@ -2762,6 +2760,9 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
if (!gdp)
goto out_err;

ext4_debug("using block group %lu(%d)\n", ac->ac_b_ex.fe_group,
gdp->bg_free_blocks_count);

err = ext4_journal_get_write_access(handle, gdp_bh);
if (err)
goto out_err;
Expand Down Expand Up @@ -3094,8 +3095,7 @@ static void ext4_mb_use_inode_pa(struct ext4_allocation_context *ac,
static void ext4_mb_use_group_pa(struct ext4_allocation_context *ac,
struct ext4_prealloc_space *pa)
{
unsigned len = ac->ac_o_ex.fe_len;

unsigned int len = ac->ac_o_ex.fe_len;
ext4_get_group_no_and_offset(ac->ac_sb, pa->pa_pstart,
&ac->ac_b_ex.fe_group,
&ac->ac_b_ex.fe_start);
Expand Down
3 changes: 2 additions & 1 deletion trunk/fs/ext4/resize.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,8 @@ static int reserve_backup_gdb(handle_t *handle, struct inode *inode,
}

blk = EXT4_SB(sb)->s_sbh->b_blocknr + 1 + EXT4_SB(sb)->s_gdb_count;
data = (__le32 *)dind->b_data + EXT4_SB(sb)->s_gdb_count;
data = (__le32 *)dind->b_data + (EXT4_SB(sb)->s_gdb_count %
EXT4_ADDR_PER_BLOCK(sb));
end = (__le32 *)dind->b_data + EXT4_ADDR_PER_BLOCK(sb);

/* Get each reserved primary GDT block and verify it holds backups */
Expand Down
36 changes: 34 additions & 2 deletions trunk/fs/ext4/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,7 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
unsigned long def_mount_opts;
struct super_block *sb = vfs->mnt_sb;
struct ext4_sb_info *sbi = EXT4_SB(sb);
journal_t *journal = sbi->s_journal;
struct ext4_super_block *es = sbi->s_es;

def_mount_opts = le32_to_cpu(es->s_default_mount_opts);
Expand Down Expand Up @@ -729,8 +730,15 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
seq_printf(seq, ",commit=%u",
(unsigned) (sbi->s_commit_interval / HZ));
}
if (test_opt(sb, BARRIER))
seq_puts(seq, ",barrier=1");
/*
* We're changing the default of barrier mount option, so
* let's always display its mount state so it's clear what its
* status is.
*/
seq_puts(seq, ",barrier=");
seq_puts(seq, test_opt(sb, BARRIER) ? "1" : "0");
if (test_opt(sb, JOURNAL_ASYNC_COMMIT))
seq_puts(seq, ",journal_async_commit");
if (test_opt(sb, NOBH))
seq_puts(seq, ",nobh");
if (!test_opt(sb, EXTENTS))
Expand Down Expand Up @@ -1907,6 +1915,7 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
sbi->s_resgid = le16_to_cpu(es->s_def_resgid);

set_opt(sbi->s_mount_opt, RESERVATION);
set_opt(sbi->s_mount_opt, BARRIER);

/*
* turn on extents feature by default in ext4 filesystem
Expand Down Expand Up @@ -2189,6 +2198,29 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_HAS_JOURNAL)) {
if (ext4_load_journal(sb, es, journal_devnum))
goto failed_mount3;
if (!(sb->s_flags & MS_RDONLY) &&
EXT4_SB(sb)->s_journal->j_failed_commit) {
printk(KERN_CRIT "EXT4-fs error (device %s): "
"ext4_fill_super: Journal transaction "
"%u is corrupt\n", sb->s_id,
EXT4_SB(sb)->s_journal->j_failed_commit);
if (test_opt (sb, ERRORS_RO)) {
printk (KERN_CRIT
"Mounting filesystem read-only\n");
sb->s_flags |= MS_RDONLY;
EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS;
es->s_state |= cpu_to_le16(EXT4_ERROR_FS);
}
if (test_opt(sb, ERRORS_PANIC)) {
EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS;
es->s_state |= cpu_to_le16(EXT4_ERROR_FS);
ext4_commit_super(sb, es, 1);
printk(KERN_CRIT
"EXT4-fs (device %s): mount failed\n",
sb->s_id);
goto failed_mount4;
}
}
} else if (journal_inum) {
if (ext4_create_journal(sb, es, journal_inum))
goto failed_mount3;
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/jbd2/commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ static int journal_submit_commit_record(journal_t *journal,
spin_unlock(&journal->j_state_lock);

/* And try again, without the barrier */
lock_buffer(bh);
set_buffer_uptodate(bh);
set_buffer_dirty(bh);
ret = submit_bh(WRITE, bh);
Expand Down
12 changes: 5 additions & 7 deletions trunk/fs/jbd2/recovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ static int calc_chksums(journal_t *journal, struct buffer_head *bh,
*crc32_sum = crc32_be(*crc32_sum, (void *)obh->b_data,
obh->b_size);
}
put_bh(obh);
}
return 0;
}
Expand Down Expand Up @@ -610,9 +611,8 @@ static int do_one_pass(journal_t *journal,
chksum_err = chksum_seen = 0;

if (info->end_transaction) {
printk(KERN_ERR "JBD: Transaction %u "
"found to be corrupt.\n",
next_commit_ID - 1);
journal->j_failed_commit =
info->end_transaction;
brelse(bh);
break;
}
Expand Down Expand Up @@ -643,10 +643,8 @@ static int do_one_pass(journal_t *journal,

if (!JBD2_HAS_INCOMPAT_FEATURE(journal,
JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT)){
printk(KERN_ERR
"JBD: Transaction %u "
"found to be corrupt.\n",
next_commit_ID);
journal->j_failed_commit =
next_commit_ID;
brelse(bh);
break;
}
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/jbd2.h
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,9 @@ struct journal_s
struct proc_dir_entry *j_proc_entry;
struct transaction_stats_s j_stats;

/* Failed journal commit ID */
unsigned int j_failed_commit;

/*
* An opaque pointer to fs-private information. ext3 puts its
* superblock pointer here
Expand Down
Loading

0 comments on commit 4a312d1

Please sign in to comment.