Skip to content

Commit

Permalink
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/tytso/ext4

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (48 commits)
  ext4: fix hot spins in mballoc after err_freebuddy and err_freemeta
  ext4: fix test ext_generic_write_end() copied return value
  ext3: fix test ext_generic_write_end() copied return value
  ext4: Move mballoc headers/structures to a seperate header file mballoc.h
  ext4: cleanup for compiling mballoc with verification and debugging #defines
  ext4: don't use ext4_error in ext4_check_descriptors
  ext4: mark inode dirty after initializing the extent tree
  ext4: update ctime and mtime for truncate with extents.
  ext4: Don't do GFP_NOFS allocations after taking ext4_lock_group
  ext4: move headers out of include/linux
  ext4: fix wrong gfp type under transaction
  ext4: Fix hang on umount with quotas when journal is aborted
  ext4: Fix update of mtime and ctime on rename
  jdb2: replace remaining __FUNCTION__ occurrences
  ext4: replace remaining __FUNCTION__ occurrences
  jbd2: only create debugfs and stats entries if init is successful
  jbd2: fix kernel-doc notation
  jbd2: replace potentially false assertion with if block
  jbd2: eliminate duplicated code in revocation table init/destroy functions
  jbd2: tidy up revoke cache initialisation and destruction
  ...
  • Loading branch information
Linus Torvalds committed Apr 30, 2008
2 parents c15a243 + f1fa334 commit c4755d1
Show file tree
Hide file tree
Showing 38 changed files with 1,086 additions and 837 deletions.
1 change: 1 addition & 0 deletions arch/arm/mm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
* zero-initialized data and COW.
*/
struct page *empty_zero_page;
EXPORT_SYMBOL(empty_zero_page);

/*
* The pmd table for the upper-most set of pages.
Expand Down
1 change: 1 addition & 0 deletions arch/m68k/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ void __init m68k_setup_node(int node)
*/

void *empty_zero_page;
EXPORT_SYMBOL(empty_zero_page);

void show_mem(void)
{
Expand Down
2 changes: 2 additions & 0 deletions arch/sparc/kernel/sparc_ksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,3 +282,5 @@ EXPORT_SYMBOL(do_BUG);

/* Sun Power Management Idle Handler */
EXPORT_SYMBOL(pm_idle);

EXPORT_SYMBOL(empty_zero_page);
1 change: 1 addition & 0 deletions arch/sparc64/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ extern unsigned int sparc_ramdisk_image;
extern unsigned int sparc_ramdisk_size;

struct page *mem_map_zero __read_mostly;
EXPORT_SYMBOL(mem_map_zero);

unsigned int sparc64_highest_unlocked_tlb_ent __read_mostly;

Expand Down
14 changes: 8 additions & 6 deletions fs/ext3/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1261,10 +1261,11 @@ static int ext3_ordered_write_end(struct file *file,
new_i_size = pos + copied;
if (new_i_size > EXT3_I(inode)->i_disksize)
EXT3_I(inode)->i_disksize = new_i_size;
copied = ext3_generic_write_end(file, mapping, pos, len, copied,
ret2 = ext3_generic_write_end(file, mapping, pos, len, copied,
page, fsdata);
if (copied < 0)
ret = copied;
copied = ret2;
if (ret2 < 0)
ret = ret2;
}
ret2 = ext3_journal_stop(handle);
if (!ret)
Expand All @@ -1289,10 +1290,11 @@ static int ext3_writeback_write_end(struct file *file,
if (new_i_size > EXT3_I(inode)->i_disksize)
EXT3_I(inode)->i_disksize = new_i_size;

copied = ext3_generic_write_end(file, mapping, pos, len, copied,
ret2 = ext3_generic_write_end(file, mapping, pos, len, copied,
page, fsdata);
if (copied < 0)
ret = copied;
copied = ret2;
if (ret2 < 0)
ret = ret2;

ret2 = ext3_journal_stop(handle);
if (!ret)
Expand Down
12 changes: 6 additions & 6 deletions fs/ext4/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include <linux/slab.h>
#include <linux/capability.h>
#include <linux/fs.h>
#include <linux/ext4_jbd2.h>
#include <linux/ext4_fs.h>
#include "ext4_jbd2.h"
#include "ext4.h"
#include "xattr.h"
#include "acl.h"

Expand All @@ -37,7 +37,7 @@ ext4_acl_from_disk(const void *value, size_t size)
return ERR_PTR(-EINVAL);
if (count == 0)
return NULL;
acl = posix_acl_alloc(count, GFP_KERNEL);
acl = posix_acl_alloc(count, GFP_NOFS);
if (!acl)
return ERR_PTR(-ENOMEM);
for (n=0; n < count; n++) {
Expand Down Expand Up @@ -91,7 +91,7 @@ ext4_acl_to_disk(const struct posix_acl *acl, size_t *size)

*size = ext4_acl_size(acl->a_count);
ext_acl = kmalloc(sizeof(ext4_acl_header) + acl->a_count *
sizeof(ext4_acl_entry), GFP_KERNEL);
sizeof(ext4_acl_entry), GFP_NOFS);
if (!ext_acl)
return ERR_PTR(-ENOMEM);
ext_acl->a_version = cpu_to_le32(EXT4_ACL_VERSION);
Expand Down Expand Up @@ -187,7 +187,7 @@ ext4_get_acl(struct inode *inode, int type)
}
retval = ext4_xattr_get(inode, name_index, "", NULL, 0);
if (retval > 0) {
value = kmalloc(retval, GFP_KERNEL);
value = kmalloc(retval, GFP_NOFS);
if (!value)
return ERR_PTR(-ENOMEM);
retval = ext4_xattr_get(inode, name_index, "", value, retval);
Expand Down Expand Up @@ -335,7 +335,7 @@ ext4_init_acl(handle_t *handle, struct inode *inode, struct inode *dir)
if (error)
goto cleanup;
}
clone = posix_acl_clone(acl, GFP_KERNEL);
clone = posix_acl_clone(acl, GFP_NOFS);
error = -ENOMEM;
if (!clone)
goto cleanup;
Expand Down
33 changes: 15 additions & 18 deletions fs/ext4/balloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
#include <linux/capability.h>
#include <linux/fs.h>
#include <linux/jbd2.h>
#include <linux/ext4_fs.h>
#include <linux/ext4_jbd2.h>
#include <linux/quotaops.h>
#include <linux/buffer_head.h>

#include "ext4.h"
#include "ext4_jbd2.h"
#include "group.h"

/*
* balloc.c contains the blocks allocation and deallocation routines
*/
Expand Down Expand Up @@ -48,7 +48,6 @@ void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr,
unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh,
ext4_group_t block_group, struct ext4_group_desc *gdp)
{
unsigned long start;
int bit, bit_max;
unsigned free_blocks, group_blocks;
struct ext4_sb_info *sbi = EXT4_SB(sb);
Expand All @@ -59,7 +58,7 @@ unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh,
/* If checksum is bad mark all blocks used to prevent allocation
* essentially implementing a per-group read-only flag. */
if (!ext4_group_desc_csum_verify(sbi, block_group, gdp)) {
ext4_error(sb, __FUNCTION__,
ext4_error(sb, __func__,
"Checksum bad for group %lu\n", block_group);
gdp->bg_free_blocks_count = 0;
gdp->bg_free_inodes_count = 0;
Expand Down Expand Up @@ -106,11 +105,12 @@ 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;

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

start = block_group * EXT4_BLOCKS_PER_GROUP(sb) +
le32_to_cpu(sbi->s_es->s_first_data_block);
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);
Expand Down Expand Up @@ -235,7 +235,7 @@ static int ext4_valid_block_bitmap(struct super_block *sb,
return 1;

err_out:
ext4_error(sb, __FUNCTION__,
ext4_error(sb, __func__,
"Invalid block bitmap - "
"block_group = %d, block = %llu",
block_group, bitmap_blk);
Expand Down Expand Up @@ -264,7 +264,7 @@ read_block_bitmap(struct super_block *sb, ext4_group_t block_group)
bitmap_blk = ext4_block_bitmap(sb, desc);
bh = sb_getblk(sb, bitmap_blk);
if (unlikely(!bh)) {
ext4_error(sb, __FUNCTION__,
ext4_error(sb, __func__,
"Cannot read block bitmap - "
"block_group = %d, block_bitmap = %llu",
(int)block_group, (unsigned long long)bitmap_blk);
Expand All @@ -281,7 +281,7 @@ read_block_bitmap(struct super_block *sb, ext4_group_t block_group)
}
if (bh_submit_read(bh) < 0) {
put_bh(bh);
ext4_error(sb, __FUNCTION__,
ext4_error(sb, __func__,
"Cannot read block bitmap - "
"block_group = %d, block_bitmap = %llu",
(int)block_group, (unsigned long long)bitmap_blk);
Expand Down Expand Up @@ -360,7 +360,7 @@ static void __rsv_window_dump(struct rb_root *root, int verbose,
BUG();
}
#define rsv_window_dump(root, verbose) \
__rsv_window_dump((root), (verbose), __FUNCTION__)
__rsv_window_dump((root), (verbose), __func__)
#else
#define rsv_window_dump(root, verbose) do {} while (0)
#endif
Expand Down Expand Up @@ -740,7 +740,7 @@ void ext4_free_blocks_sb(handle_t *handle, struct super_block *sb,
if (!ext4_clear_bit_atomic(sb_bgl_lock(sbi, block_group),
bit + i, bitmap_bh->b_data)) {
jbd_unlock_bh_state(bitmap_bh);
ext4_error(sb, __FUNCTION__,
ext4_error(sb, __func__,
"bit already cleared for block %llu",
(ext4_fsblk_t)(block + i));
jbd_lock_bh_state(bitmap_bh);
Expand All @@ -752,9 +752,7 @@ void ext4_free_blocks_sb(handle_t *handle, struct super_block *sb,
jbd_unlock_bh_state(bitmap_bh);

spin_lock(sb_bgl_lock(sbi, block_group));
desc->bg_free_blocks_count =
cpu_to_le16(le16_to_cpu(desc->bg_free_blocks_count) +
group_freed);
le16_add_cpu(&desc->bg_free_blocks_count, group_freed);
desc->bg_checksum = ext4_group_desc_csum(sbi, block_group, desc);
spin_unlock(sb_bgl_lock(sbi, block_group));
percpu_counter_add(&sbi->s_freeblocks_counter, count);
Expand Down Expand Up @@ -1798,7 +1796,7 @@ ext4_fsblk_t ext4_new_blocks_old(handle_t *handle, struct inode *inode,
if (ext4_test_bit(grp_alloc_blk+i,
bh2jh(bitmap_bh)->b_committed_data)) {
printk("%s: block was unexpectedly set in "
"b_committed_data\n", __FUNCTION__);
"b_committed_data\n", __func__);
}
}
}
Expand All @@ -1823,8 +1821,7 @@ ext4_fsblk_t ext4_new_blocks_old(handle_t *handle, struct inode *inode,
spin_lock(sb_bgl_lock(sbi, group_no));
if (gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT))
gdp->bg_flags &= cpu_to_le16(~EXT4_BG_BLOCK_UNINIT);
gdp->bg_free_blocks_count =
cpu_to_le16(le16_to_cpu(gdp->bg_free_blocks_count)-num);
le16_add_cpu(&gdp->bg_free_blocks_count, -num);
gdp->bg_checksum = ext4_group_desc_csum(sbi, group_no, gdp);
spin_unlock(sb_bgl_lock(sbi, group_no));
percpu_counter_sub(&sbi->s_freeblocks_counter, num);
Expand Down
2 changes: 1 addition & 1 deletion fs/ext4/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <linux/buffer_head.h>
#include <linux/jbd2.h>
#include <linux/ext4_fs.h>
#include "ext4.h"

#ifdef EXT4FS_DEBUG

Expand Down
4 changes: 2 additions & 2 deletions fs/ext4/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@

#include <linux/fs.h>
#include <linux/jbd2.h>
#include <linux/ext4_fs.h>
#include <linux/buffer_head.h>
#include <linux/slab.h>
#include <linux/rbtree.h>
#include "ext4.h"

static unsigned char ext4_filetype_table[] = {
DT_UNKNOWN, DT_REG, DT_DIR, DT_CHR, DT_BLK, DT_FIFO, DT_SOCK, DT_LNK
Expand All @@ -42,7 +42,7 @@ const struct file_operations ext4_dir_operations = {
.llseek = generic_file_llseek,
.read = generic_read_dir,
.readdir = ext4_readdir, /* we take BKL. needed?*/
.ioctl = ext4_ioctl, /* BKL held */
.unlocked_ioctl = ext4_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = ext4_compat_ioctl,
#endif
Expand Down
18 changes: 8 additions & 10 deletions include/linux/ext4_fs.h → fs/ext4/ext4.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* linux/include/linux/ext4_fs.h
* ext4.h
*
* Copyright (C) 1992, 1993, 1994, 1995
* Remy Card (card@masi.ibp.fr)
Expand All @@ -13,14 +13,13 @@
* Copyright (C) 1991, 1992 Linus Torvalds
*/

#ifndef _LINUX_EXT4_FS_H
#define _LINUX_EXT4_FS_H
#ifndef _EXT4_H
#define _EXT4_H

#include <linux/types.h>
#include <linux/blkdev.h>
#include <linux/magic.h>

#include <linux/ext4_fs_i.h>
#include "ext4_i.h"

/*
* The second extended filesystem constants/structures
Expand Down Expand Up @@ -176,8 +175,7 @@ struct ext4_group_desc
#define EXT4_BG_INODE_ZEROED 0x0004 /* On-disk itable initialized to zero */

#ifdef __KERNEL__
#include <linux/ext4_fs_i.h>
#include <linux/ext4_fs_sb.h>
#include "ext4_sb.h"
#endif
/*
* Macro-instructions used to manage group descriptors
Expand Down Expand Up @@ -231,6 +229,7 @@ struct ext4_group_desc
#define EXT4_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/
#define EXT4_HUGE_FILE_FL 0x00040000 /* Set to each huge file */
#define EXT4_EXTENTS_FL 0x00080000 /* Inode uses extents */
#define EXT4_EXT_MIGRATE 0x00100000 /* Inode is migrating */
#define EXT4_RESERVED_FL 0x80000000 /* reserved for ext4 lib */

#define EXT4_FL_USER_VISIBLE 0x000BDFFF /* User visible flags */
Expand Down Expand Up @@ -1049,8 +1048,7 @@ extern int ext4_block_truncate_page(handle_t *handle, struct page *page,
struct address_space *mapping, loff_t from);

/* ioctl.c */
extern int ext4_ioctl (struct inode *, struct file *, unsigned int,
unsigned long);
extern long ext4_ioctl(struct file *, unsigned int, unsigned long);
extern long ext4_compat_ioctl (struct file *, unsigned int, unsigned long);

/* migrate.c */
Expand Down Expand Up @@ -1204,4 +1202,4 @@ extern int ext4_get_blocks_wrap(handle_t *handle, struct inode *inode,
int extend_disksize);
#endif /* __KERNEL__ */

#endif /* _LINUX_EXT4_FS_H */
#endif /* _EXT4_H */
8 changes: 4 additions & 4 deletions include/linux/ext4_fs_extents.h → fs/ext4/ext4_extents.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-
*/

#ifndef _LINUX_EXT4_EXTENTS
#define _LINUX_EXT4_EXTENTS
#ifndef _EXT4_EXTENTS
#define _EXT4_EXTENTS

#include <linux/ext4_fs.h>
#include "ext4.h"

/*
* With AGGRESSIVE_TEST defined, the capacity of index/leaf blocks
Expand Down Expand Up @@ -228,5 +228,5 @@ extern int ext4_ext_search_left(struct inode *, struct ext4_ext_path *,
extern int ext4_ext_search_right(struct inode *, struct ext4_ext_path *,
ext4_lblk_t *, ext4_fsblk_t *);
extern void ext4_ext_drop_refs(struct ext4_ext_path *);
#endif /* _LINUX_EXT4_EXTENTS */
#endif /* _EXT4_EXTENTS */

8 changes: 4 additions & 4 deletions include/linux/ext4_fs_i.h → fs/ext4/ext4_i.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* linux/include/linux/ext4_fs_i.h
* ext4_i.h
*
* Copyright (C) 1992, 1993, 1994, 1995
* Remy Card (card@masi.ibp.fr)
Expand All @@ -13,8 +13,8 @@
* Copyright (C) 1991, 1992 Linus Torvalds
*/

#ifndef _LINUX_EXT4_FS_I
#define _LINUX_EXT4_FS_I
#ifndef _EXT4_I
#define _EXT4_I

#include <linux/rwsem.h>
#include <linux/rbtree.h>
Expand Down Expand Up @@ -164,4 +164,4 @@ struct ext4_inode_info {
spinlock_t i_prealloc_lock;
};

#endif /* _LINUX_EXT4_FS_I */
#endif /* _EXT4_I */
Loading

0 comments on commit c4755d1

Please sign in to comment.