mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-17 02:15:57 +00:00
ext4: Fix whitespace checkpatch warnings/errors
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:
parent
e5f8eab885
commit
af5bc92dde
@ -58,9 +58,9 @@ static inline int ext4_acl_count(size_t size)
|
|||||||
#define EXT4_ACL_NOT_CACHED ((void *)-1)
|
#define EXT4_ACL_NOT_CACHED ((void *)-1)
|
||||||
|
|
||||||
/* acl.c */
|
/* acl.c */
|
||||||
extern int ext4_permission (struct inode *, int);
|
extern int ext4_permission(struct inode *, int);
|
||||||
extern int ext4_acl_chmod (struct inode *);
|
extern int ext4_acl_chmod(struct inode *);
|
||||||
extern int ext4_init_acl (handle_t *, struct inode *, struct inode *);
|
extern int ext4_init_acl(handle_t *, struct inode *, struct inode *);
|
||||||
|
|
||||||
#else /* CONFIG_EXT4DEV_FS_POSIX_ACL */
|
#else /* CONFIG_EXT4DEV_FS_POSIX_ACL */
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
|
@ -132,7 +132,7 @@ unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh,
|
|||||||
*/
|
*/
|
||||||
group_blocks = ext4_blocks_count(sbi->s_es) -
|
group_blocks = ext4_blocks_count(sbi->s_es) -
|
||||||
le32_to_cpu(sbi->s_es->s_first_data_block) -
|
le32_to_cpu(sbi->s_es->s_first_data_block) -
|
||||||
(EXT4_BLOCKS_PER_GROUP(sb) * (sbi->s_groups_count -1));
|
(EXT4_BLOCKS_PER_GROUP(sb) * (sbi->s_groups_count - 1));
|
||||||
} else {
|
} else {
|
||||||
group_blocks = EXT4_BLOCKS_PER_GROUP(sb);
|
group_blocks = EXT4_BLOCKS_PER_GROUP(sb);
|
||||||
}
|
}
|
||||||
@ -200,20 +200,20 @@ unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh,
|
|||||||
* @bh: pointer to the buffer head to store the block
|
* @bh: pointer to the buffer head to store the block
|
||||||
* group descriptor
|
* group descriptor
|
||||||
*/
|
*/
|
||||||
struct ext4_group_desc * ext4_get_group_desc(struct super_block * sb,
|
struct ext4_group_desc * ext4_get_group_desc(struct super_block *sb,
|
||||||
ext4_group_t block_group,
|
ext4_group_t block_group,
|
||||||
struct buffer_head ** bh)
|
struct buffer_head **bh)
|
||||||
{
|
{
|
||||||
unsigned long group_desc;
|
unsigned long group_desc;
|
||||||
unsigned long offset;
|
unsigned long offset;
|
||||||
struct ext4_group_desc * desc;
|
struct ext4_group_desc *desc;
|
||||||
struct ext4_sb_info *sbi = EXT4_SB(sb);
|
struct ext4_sb_info *sbi = EXT4_SB(sb);
|
||||||
|
|
||||||
if (block_group >= sbi->s_groups_count) {
|
if (block_group >= sbi->s_groups_count) {
|
||||||
ext4_error (sb, "ext4_get_group_desc",
|
ext4_error(sb, "ext4_get_group_desc",
|
||||||
"block_group >= groups_count - "
|
"block_group >= groups_count - "
|
||||||
"block_group = %lu, groups_count = %lu",
|
"block_group = %lu, groups_count = %lu",
|
||||||
block_group, sbi->s_groups_count);
|
block_group, sbi->s_groups_count);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -222,10 +222,10 @@ struct ext4_group_desc * ext4_get_group_desc(struct super_block * sb,
|
|||||||
group_desc = block_group >> EXT4_DESC_PER_BLOCK_BITS(sb);
|
group_desc = block_group >> EXT4_DESC_PER_BLOCK_BITS(sb);
|
||||||
offset = block_group & (EXT4_DESC_PER_BLOCK(sb) - 1);
|
offset = block_group & (EXT4_DESC_PER_BLOCK(sb) - 1);
|
||||||
if (!sbi->s_group_desc[group_desc]) {
|
if (!sbi->s_group_desc[group_desc]) {
|
||||||
ext4_error (sb, "ext4_get_group_desc",
|
ext4_error(sb, "ext4_get_group_desc",
|
||||||
"Group descriptor not loaded - "
|
"Group descriptor not loaded - "
|
||||||
"block_group = %lu, group_desc = %lu, desc = %lu",
|
"block_group = %lu, group_desc = %lu, desc = %lu",
|
||||||
block_group, group_desc, offset);
|
block_group, group_desc, offset);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -302,8 +302,8 @@ err_out:
|
|||||||
struct buffer_head *
|
struct buffer_head *
|
||||||
ext4_read_block_bitmap(struct super_block *sb, ext4_group_t block_group)
|
ext4_read_block_bitmap(struct super_block *sb, ext4_group_t block_group)
|
||||||
{
|
{
|
||||||
struct ext4_group_desc * desc;
|
struct ext4_group_desc *desc;
|
||||||
struct buffer_head * bh = NULL;
|
struct buffer_head *bh = NULL;
|
||||||
ext4_fsblk_t bitmap_blk;
|
ext4_fsblk_t bitmap_blk;
|
||||||
|
|
||||||
desc = ext4_get_group_desc(sb, block_group, NULL);
|
desc = ext4_get_group_desc(sb, block_group, NULL);
|
||||||
@ -506,8 +506,8 @@ void ext4_rsv_window_add(struct super_block *sb,
|
|||||||
struct rb_node *node = &rsv->rsv_node;
|
struct rb_node *node = &rsv->rsv_node;
|
||||||
ext4_fsblk_t start = rsv->rsv_start;
|
ext4_fsblk_t start = rsv->rsv_start;
|
||||||
|
|
||||||
struct rb_node ** p = &root->rb_node;
|
struct rb_node **p = &root->rb_node;
|
||||||
struct rb_node * parent = NULL;
|
struct rb_node *parent = NULL;
|
||||||
struct ext4_reserve_window_node *this;
|
struct ext4_reserve_window_node *this;
|
||||||
|
|
||||||
while (*p)
|
while (*p)
|
||||||
@ -661,8 +661,8 @@ void ext4_free_blocks_sb(handle_t *handle, struct super_block *sb,
|
|||||||
ext4_grpblk_t bit;
|
ext4_grpblk_t bit;
|
||||||
unsigned long i;
|
unsigned long i;
|
||||||
unsigned long overflow;
|
unsigned long overflow;
|
||||||
struct ext4_group_desc * desc;
|
struct ext4_group_desc *desc;
|
||||||
struct ext4_super_block * es;
|
struct ext4_super_block *es;
|
||||||
struct ext4_sb_info *sbi;
|
struct ext4_sb_info *sbi;
|
||||||
int err = 0, ret;
|
int err = 0, ret;
|
||||||
ext4_grpblk_t group_freed;
|
ext4_grpblk_t group_freed;
|
||||||
@ -673,13 +673,13 @@ void ext4_free_blocks_sb(handle_t *handle, struct super_block *sb,
|
|||||||
if (block < le32_to_cpu(es->s_first_data_block) ||
|
if (block < le32_to_cpu(es->s_first_data_block) ||
|
||||||
block + count < block ||
|
block + count < block ||
|
||||||
block + count > ext4_blocks_count(es)) {
|
block + count > ext4_blocks_count(es)) {
|
||||||
ext4_error (sb, "ext4_free_blocks",
|
ext4_error(sb, "ext4_free_blocks",
|
||||||
"Freeing blocks not in datazone - "
|
"Freeing blocks not in datazone - "
|
||||||
"block = %llu, count = %lu", block, count);
|
"block = %llu, count = %lu", block, count);
|
||||||
goto error_return;
|
goto error_return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ext4_debug ("freeing block(s) %llu-%llu\n", block, block + count - 1);
|
ext4_debug("freeing block(s) %llu-%llu\n", block, block + count - 1);
|
||||||
|
|
||||||
do_more:
|
do_more:
|
||||||
overflow = 0;
|
overflow = 0;
|
||||||
@ -696,7 +696,7 @@ do_more:
|
|||||||
bitmap_bh = ext4_read_block_bitmap(sb, block_group);
|
bitmap_bh = ext4_read_block_bitmap(sb, block_group);
|
||||||
if (!bitmap_bh)
|
if (!bitmap_bh)
|
||||||
goto error_return;
|
goto error_return;
|
||||||
desc = ext4_get_group_desc (sb, block_group, &gd_bh);
|
desc = ext4_get_group_desc(sb, block_group, &gd_bh);
|
||||||
if (!desc)
|
if (!desc)
|
||||||
goto error_return;
|
goto error_return;
|
||||||
|
|
||||||
@ -705,10 +705,10 @@ do_more:
|
|||||||
in_range(block, ext4_inode_table(sb, desc), sbi->s_itb_per_group) ||
|
in_range(block, ext4_inode_table(sb, desc), sbi->s_itb_per_group) ||
|
||||||
in_range(block + count - 1, ext4_inode_table(sb, desc),
|
in_range(block + count - 1, ext4_inode_table(sb, desc),
|
||||||
sbi->s_itb_per_group)) {
|
sbi->s_itb_per_group)) {
|
||||||
ext4_error (sb, "ext4_free_blocks",
|
ext4_error(sb, "ext4_free_blocks",
|
||||||
"Freeing blocks in system zones - "
|
"Freeing blocks in system zones - "
|
||||||
"Block = %llu, count = %lu",
|
"Block = %llu, count = %lu",
|
||||||
block, count);
|
block, count);
|
||||||
goto error_return;
|
goto error_return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -850,7 +850,7 @@ void ext4_free_blocks(handle_t *handle, struct inode *inode,
|
|||||||
ext4_fsblk_t block, unsigned long count,
|
ext4_fsblk_t block, unsigned long count,
|
||||||
int metadata)
|
int metadata)
|
||||||
{
|
{
|
||||||
struct super_block * sb;
|
struct super_block *sb;
|
||||||
unsigned long dquot_freed_blocks;
|
unsigned long dquot_freed_blocks;
|
||||||
|
|
||||||
/* this isn't the right place to decide whether block is metadata
|
/* this isn't the right place to decide whether block is metadata
|
||||||
@ -1019,7 +1019,7 @@ claim_block(spinlock_t *lock, ext4_grpblk_t block, struct buffer_head *bh)
|
|||||||
if (ext4_set_bit_atomic(lock, block, bh->b_data))
|
if (ext4_set_bit_atomic(lock, block, bh->b_data))
|
||||||
return 0;
|
return 0;
|
||||||
jbd_lock_bh_state(bh);
|
jbd_lock_bh_state(bh);
|
||||||
if (jh->b_committed_data && ext4_test_bit(block,jh->b_committed_data)) {
|
if (jh->b_committed_data && ext4_test_bit(block, jh->b_committed_data)) {
|
||||||
ext4_clear_bit_atomic(lock, block, bh->b_data);
|
ext4_clear_bit_atomic(lock, block, bh->b_data);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
} else {
|
} else {
|
||||||
@ -1170,7 +1170,7 @@ fail_access:
|
|||||||
static int find_next_reservable_window(
|
static int find_next_reservable_window(
|
||||||
struct ext4_reserve_window_node *search_head,
|
struct ext4_reserve_window_node *search_head,
|
||||||
struct ext4_reserve_window_node *my_rsv,
|
struct ext4_reserve_window_node *my_rsv,
|
||||||
struct super_block * sb,
|
struct super_block *sb,
|
||||||
ext4_fsblk_t start_block,
|
ext4_fsblk_t start_block,
|
||||||
ext4_fsblk_t last_block)
|
ext4_fsblk_t last_block)
|
||||||
{
|
{
|
||||||
@ -1204,7 +1204,7 @@ static int find_next_reservable_window(
|
|||||||
|
|
||||||
prev = rsv;
|
prev = rsv;
|
||||||
next = rb_next(&rsv->rsv_node);
|
next = rb_next(&rsv->rsv_node);
|
||||||
rsv = rb_entry(next,struct ext4_reserve_window_node,rsv_node);
|
rsv = rb_entry(next, struct ext4_reserve_window_node, rsv_node);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reached the last reservation, we can just append to the
|
* Reached the last reservation, we can just append to the
|
||||||
@ -1342,7 +1342,7 @@ static int alloc_new_reservation(struct ext4_reserve_window_node *my_rsv,
|
|||||||
size = size * 2;
|
size = size * 2;
|
||||||
if (size > EXT4_MAX_RESERVE_BLOCKS)
|
if (size > EXT4_MAX_RESERVE_BLOCKS)
|
||||||
size = EXT4_MAX_RESERVE_BLOCKS;
|
size = EXT4_MAX_RESERVE_BLOCKS;
|
||||||
my_rsv->rsv_goal_size= size;
|
my_rsv->rsv_goal_size = size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1491,7 +1491,7 @@ static ext4_grpblk_t
|
|||||||
ext4_try_to_allocate_with_rsv(struct super_block *sb, handle_t *handle,
|
ext4_try_to_allocate_with_rsv(struct super_block *sb, handle_t *handle,
|
||||||
ext4_group_t group, struct buffer_head *bitmap_bh,
|
ext4_group_t group, struct buffer_head *bitmap_bh,
|
||||||
ext4_grpblk_t grp_goal,
|
ext4_grpblk_t grp_goal,
|
||||||
struct ext4_reserve_window_node * my_rsv,
|
struct ext4_reserve_window_node *my_rsv,
|
||||||
unsigned long *count, int *errp)
|
unsigned long *count, int *errp)
|
||||||
{
|
{
|
||||||
ext4_fsblk_t group_first_block, group_last_block;
|
ext4_fsblk_t group_first_block, group_last_block;
|
||||||
@ -1519,7 +1519,7 @@ ext4_try_to_allocate_with_rsv(struct super_block *sb, handle_t *handle,
|
|||||||
* or the file is not a regular file
|
* or the file is not a regular file
|
||||||
* or last attempt to allocate a block with reservation turned on failed
|
* or last attempt to allocate a block with reservation turned on failed
|
||||||
*/
|
*/
|
||||||
if (my_rsv == NULL ) {
|
if (my_rsv == NULL) {
|
||||||
ret = ext4_try_to_allocate(sb, handle, group, bitmap_bh,
|
ret = ext4_try_to_allocate(sb, handle, group, bitmap_bh,
|
||||||
grp_goal, count, NULL);
|
grp_goal, count, NULL);
|
||||||
goto out;
|
goto out;
|
||||||
@ -2184,7 +2184,7 @@ unsigned long ext4_bg_num_gdb(struct super_block *sb, ext4_group_t group)
|
|||||||
|
|
||||||
if (!EXT4_HAS_INCOMPAT_FEATURE(sb,EXT4_FEATURE_INCOMPAT_META_BG) ||
|
if (!EXT4_HAS_INCOMPAT_FEATURE(sb,EXT4_FEATURE_INCOMPAT_META_BG) ||
|
||||||
metagroup < first_meta_bg)
|
metagroup < first_meta_bg)
|
||||||
return ext4_bg_num_gdb_nometa(sb,group);
|
return ext4_bg_num_gdb_nometa(sb, group);
|
||||||
|
|
||||||
return ext4_bg_num_gdb_meta(sb,group);
|
return ext4_bg_num_gdb_meta(sb,group);
|
||||||
|
|
||||||
|
@ -15,17 +15,17 @@
|
|||||||
|
|
||||||
static const int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0};
|
static const int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0};
|
||||||
|
|
||||||
unsigned long ext4_count_free (struct buffer_head * map, unsigned int numchars)
|
unsigned long ext4_count_free(struct buffer_head *map, unsigned int numchars)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
unsigned long sum = 0;
|
unsigned long sum = 0;
|
||||||
|
|
||||||
if (!map)
|
if (!map)
|
||||||
return (0);
|
return 0;
|
||||||
for (i = 0; i < numchars; i++)
|
for (i = 0; i < numchars; i++)
|
||||||
sum += nibblemap[map->b_data[i] & 0xf] +
|
sum += nibblemap[map->b_data[i] & 0xf] +
|
||||||
nibblemap[(map->b_data[i] >> 4) & 0xf];
|
nibblemap[(map->b_data[i] >> 4) & 0xf];
|
||||||
return (sum);
|
return sum;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* EXT4FS_DEBUG */
|
#endif /* EXT4FS_DEBUG */
|
||||||
|
@ -33,10 +33,10 @@ static unsigned char ext4_filetype_table[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static int ext4_readdir(struct file *, void *, filldir_t);
|
static int ext4_readdir(struct file *, void *, filldir_t);
|
||||||
static int ext4_dx_readdir(struct file * filp,
|
static int ext4_dx_readdir(struct file *filp,
|
||||||
void * dirent, filldir_t filldir);
|
void *dirent, filldir_t filldir);
|
||||||
static int ext4_release_dir (struct inode * inode,
|
static int ext4_release_dir(struct inode *inode,
|
||||||
struct file * filp);
|
struct file *filp);
|
||||||
|
|
||||||
const struct file_operations ext4_dir_operations = {
|
const struct file_operations ext4_dir_operations = {
|
||||||
.llseek = generic_file_llseek,
|
.llseek = generic_file_llseek,
|
||||||
@ -61,12 +61,12 @@ static unsigned char get_dtype(struct super_block *sb, int filetype)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int ext4_check_dir_entry (const char * function, struct inode * dir,
|
int ext4_check_dir_entry(const char *function, struct inode *dir,
|
||||||
struct ext4_dir_entry_2 * de,
|
struct ext4_dir_entry_2 *de,
|
||||||
struct buffer_head * bh,
|
struct buffer_head *bh,
|
||||||
unsigned long offset)
|
unsigned long offset)
|
||||||
{
|
{
|
||||||
const char * error_msg = NULL;
|
const char *error_msg = NULL;
|
||||||
const int rlen = ext4_rec_len_from_disk(de->rec_len);
|
const int rlen = ext4_rec_len_from_disk(de->rec_len);
|
||||||
|
|
||||||
if (rlen < EXT4_DIR_REC_LEN(1))
|
if (rlen < EXT4_DIR_REC_LEN(1))
|
||||||
@ -82,7 +82,7 @@ int ext4_check_dir_entry (const char * function, struct inode * dir,
|
|||||||
error_msg = "inode out of bounds";
|
error_msg = "inode out of bounds";
|
||||||
|
|
||||||
if (error_msg != NULL)
|
if (error_msg != NULL)
|
||||||
ext4_error (dir->i_sb, function,
|
ext4_error(dir->i_sb, function,
|
||||||
"bad entry in directory #%lu: %s - "
|
"bad entry in directory #%lu: %s - "
|
||||||
"offset=%lu, inode=%lu, rec_len=%d, name_len=%d",
|
"offset=%lu, inode=%lu, rec_len=%d, name_len=%d",
|
||||||
dir->i_ino, error_msg, offset,
|
dir->i_ino, error_msg, offset,
|
||||||
@ -91,8 +91,8 @@ int ext4_check_dir_entry (const char * function, struct inode * dir,
|
|||||||
return error_msg == NULL ? 1 : 0;
|
return error_msg == NULL ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ext4_readdir(struct file * filp,
|
static int ext4_readdir(struct file *filp,
|
||||||
void * dirent, filldir_t filldir)
|
void *dirent, filldir_t filldir)
|
||||||
{
|
{
|
||||||
int error = 0;
|
int error = 0;
|
||||||
unsigned long offset;
|
unsigned long offset;
|
||||||
@ -148,7 +148,7 @@ static int ext4_readdir(struct file * filp,
|
|||||||
* of recovering data when there's a bad sector
|
* of recovering data when there's a bad sector
|
||||||
*/
|
*/
|
||||||
if (!bh) {
|
if (!bh) {
|
||||||
ext4_error (sb, "ext4_readdir",
|
ext4_error(sb, "ext4_readdir",
|
||||||
"directory #%lu contains a hole at offset %lu",
|
"directory #%lu contains a hole at offset %lu",
|
||||||
inode->i_ino, (unsigned long)filp->f_pos);
|
inode->i_ino, (unsigned long)filp->f_pos);
|
||||||
/* corrupt size? Maybe no more blocks to read */
|
/* corrupt size? Maybe no more blocks to read */
|
||||||
@ -187,14 +187,14 @@ revalidate:
|
|||||||
while (!error && filp->f_pos < inode->i_size
|
while (!error && filp->f_pos < inode->i_size
|
||||||
&& offset < sb->s_blocksize) {
|
&& offset < sb->s_blocksize) {
|
||||||
de = (struct ext4_dir_entry_2 *) (bh->b_data + offset);
|
de = (struct ext4_dir_entry_2 *) (bh->b_data + offset);
|
||||||
if (!ext4_check_dir_entry ("ext4_readdir", inode, de,
|
if (!ext4_check_dir_entry("ext4_readdir", inode, de,
|
||||||
bh, offset)) {
|
bh, offset)) {
|
||||||
/*
|
/*
|
||||||
* On error, skip the f_pos to the next block
|
* On error, skip the f_pos to the next block
|
||||||
*/
|
*/
|
||||||
filp->f_pos = (filp->f_pos |
|
filp->f_pos = (filp->f_pos |
|
||||||
(sb->s_blocksize - 1)) + 1;
|
(sb->s_blocksize - 1)) + 1;
|
||||||
brelse (bh);
|
brelse(bh);
|
||||||
ret = stored;
|
ret = stored;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@ -218,12 +218,12 @@ revalidate:
|
|||||||
break;
|
break;
|
||||||
if (version != filp->f_version)
|
if (version != filp->f_version)
|
||||||
goto revalidate;
|
goto revalidate;
|
||||||
stored ++;
|
stored++;
|
||||||
}
|
}
|
||||||
filp->f_pos += ext4_rec_len_from_disk(de->rec_len);
|
filp->f_pos += ext4_rec_len_from_disk(de->rec_len);
|
||||||
}
|
}
|
||||||
offset = 0;
|
offset = 0;
|
||||||
brelse (bh);
|
brelse(bh);
|
||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
return ret;
|
return ret;
|
||||||
@ -290,9 +290,9 @@ static void free_rb_tree_fname(struct rb_root *root)
|
|||||||
parent = rb_parent(n);
|
parent = rb_parent(n);
|
||||||
fname = rb_entry(n, struct fname, rb_hash);
|
fname = rb_entry(n, struct fname, rb_hash);
|
||||||
while (fname) {
|
while (fname) {
|
||||||
struct fname * old = fname;
|
struct fname *old = fname;
|
||||||
fname = fname->next;
|
fname = fname->next;
|
||||||
kfree (old);
|
kfree(old);
|
||||||
}
|
}
|
||||||
if (!parent)
|
if (!parent)
|
||||||
root->rb_node = NULL;
|
root->rb_node = NULL;
|
||||||
@ -331,7 +331,7 @@ int ext4_htree_store_dirent(struct file *dir_file, __u32 hash,
|
|||||||
struct ext4_dir_entry_2 *dirent)
|
struct ext4_dir_entry_2 *dirent)
|
||||||
{
|
{
|
||||||
struct rb_node **p, *parent = NULL;
|
struct rb_node **p, *parent = NULL;
|
||||||
struct fname * fname, *new_fn;
|
struct fname *fname, *new_fn;
|
||||||
struct dir_private_info *info;
|
struct dir_private_info *info;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
@ -388,13 +388,13 @@ int ext4_htree_store_dirent(struct file *dir_file, __u32 hash,
|
|||||||
* for all entres on the fname linked list. (Normally there is only
|
* for all entres on the fname linked list. (Normally there is only
|
||||||
* one entry on the linked list, unless there are 62 bit hash collisions.)
|
* one entry on the linked list, unless there are 62 bit hash collisions.)
|
||||||
*/
|
*/
|
||||||
static int call_filldir(struct file * filp, void * dirent,
|
static int call_filldir(struct file *filp, void *dirent,
|
||||||
filldir_t filldir, struct fname *fname)
|
filldir_t filldir, struct fname *fname)
|
||||||
{
|
{
|
||||||
struct dir_private_info *info = filp->private_data;
|
struct dir_private_info *info = filp->private_data;
|
||||||
loff_t curr_pos;
|
loff_t curr_pos;
|
||||||
struct inode *inode = filp->f_path.dentry->d_inode;
|
struct inode *inode = filp->f_path.dentry->d_inode;
|
||||||
struct super_block * sb;
|
struct super_block *sb;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
sb = inode->i_sb;
|
sb = inode->i_sb;
|
||||||
@ -420,8 +420,8 @@ static int call_filldir(struct file * filp, void * dirent,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ext4_dx_readdir(struct file * filp,
|
static int ext4_dx_readdir(struct file *filp,
|
||||||
void * dirent, filldir_t filldir)
|
void *dirent, filldir_t filldir)
|
||||||
{
|
{
|
||||||
struct dir_private_info *info = filp->private_data;
|
struct dir_private_info *info = filp->private_data;
|
||||||
struct inode *inode = filp->f_path.dentry->d_inode;
|
struct inode *inode = filp->f_path.dentry->d_inode;
|
||||||
@ -512,7 +512,7 @@ finished:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ext4_release_dir (struct inode * inode, struct file * filp)
|
static int ext4_release_dir(struct inode *inode, struct file *filp)
|
||||||
{
|
{
|
||||||
if (filp->private_data)
|
if (filp->private_data)
|
||||||
ext4_htree_free_dir_info(filp->private_data);
|
ext4_htree_free_dir_info(filp->private_data);
|
||||||
|
@ -44,9 +44,9 @@
|
|||||||
#ifdef EXT4FS_DEBUG
|
#ifdef EXT4FS_DEBUG
|
||||||
#define ext4_debug(f, a...) \
|
#define ext4_debug(f, a...) \
|
||||||
do { \
|
do { \
|
||||||
printk (KERN_DEBUG "EXT4-fs DEBUG (%s, %d): %s:", \
|
printk(KERN_DEBUG "EXT4-fs DEBUG (%s, %d): %s:", \
|
||||||
__FILE__, __LINE__, __func__); \
|
__FILE__, __LINE__, __func__); \
|
||||||
printk (KERN_DEBUG f, ## a); \
|
printk(KERN_DEBUG f, ## a); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#else
|
#else
|
||||||
#define ext4_debug(f, a...) do {} while (0)
|
#define ext4_debug(f, a...) do {} while (0)
|
||||||
@ -128,7 +128,7 @@ struct ext4_allocation_request {
|
|||||||
#else
|
#else
|
||||||
# define EXT4_BLOCK_SIZE(s) (EXT4_MIN_BLOCK_SIZE << (s)->s_log_block_size)
|
# define EXT4_BLOCK_SIZE(s) (EXT4_MIN_BLOCK_SIZE << (s)->s_log_block_size)
|
||||||
#endif
|
#endif
|
||||||
#define EXT4_ADDR_PER_BLOCK(s) (EXT4_BLOCK_SIZE(s) / sizeof (__u32))
|
#define EXT4_ADDR_PER_BLOCK(s) (EXT4_BLOCK_SIZE(s) / sizeof(__u32))
|
||||||
#ifdef __KERNEL__
|
#ifdef __KERNEL__
|
||||||
# define EXT4_BLOCK_SIZE_BITS(s) ((s)->s_blocksize_bits)
|
# define EXT4_BLOCK_SIZE_BITS(s) ((s)->s_blocksize_bits)
|
||||||
#else
|
#else
|
||||||
@ -292,7 +292,7 @@ struct ext4_new_group_data {
|
|||||||
#define EXT4_IOC_GETVERSION _IOR('f', 3, long)
|
#define EXT4_IOC_GETVERSION _IOR('f', 3, long)
|
||||||
#define EXT4_IOC_SETVERSION _IOW('f', 4, long)
|
#define EXT4_IOC_SETVERSION _IOW('f', 4, long)
|
||||||
#define EXT4_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long)
|
#define EXT4_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long)
|
||||||
#define EXT4_IOC_GROUP_ADD _IOW('f', 8,struct ext4_new_group_input)
|
#define EXT4_IOC_GROUP_ADD _IOW('f', 8, struct ext4_new_group_input)
|
||||||
#define EXT4_IOC_GETVERSION_OLD FS_IOC_GETVERSION
|
#define EXT4_IOC_GETVERSION_OLD FS_IOC_GETVERSION
|
||||||
#define EXT4_IOC_SETVERSION_OLD FS_IOC_SETVERSION
|
#define EXT4_IOC_SETVERSION_OLD FS_IOC_SETVERSION
|
||||||
#ifdef CONFIG_JBD2_DEBUG
|
#ifdef CONFIG_JBD2_DEBUG
|
||||||
@ -667,7 +667,7 @@ struct ext4_super_block {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
#ifdef __KERNEL__
|
||||||
static inline struct ext4_sb_info * EXT4_SB(struct super_block *sb)
|
static inline struct ext4_sb_info *EXT4_SB(struct super_block *sb)
|
||||||
{
|
{
|
||||||
return sb->s_fs_info;
|
return sb->s_fs_info;
|
||||||
}
|
}
|
||||||
@ -725,11 +725,11 @@ static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define EXT4_HAS_COMPAT_FEATURE(sb,mask) \
|
#define EXT4_HAS_COMPAT_FEATURE(sb,mask) \
|
||||||
( EXT4_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask) )
|
(EXT4_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask))
|
||||||
#define EXT4_HAS_RO_COMPAT_FEATURE(sb,mask) \
|
#define EXT4_HAS_RO_COMPAT_FEATURE(sb,mask) \
|
||||||
( EXT4_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le32(mask) )
|
(EXT4_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le32(mask))
|
||||||
#define EXT4_HAS_INCOMPAT_FEATURE(sb,mask) \
|
#define EXT4_HAS_INCOMPAT_FEATURE(sb,mask) \
|
||||||
( EXT4_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask) )
|
(EXT4_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask))
|
||||||
#define EXT4_SET_COMPAT_FEATURE(sb,mask) \
|
#define EXT4_SET_COMPAT_FEATURE(sb,mask) \
|
||||||
EXT4_SB(sb)->s_es->s_feature_compat |= cpu_to_le32(mask)
|
EXT4_SB(sb)->s_es->s_feature_compat |= cpu_to_le32(mask)
|
||||||
#define EXT4_SET_RO_COMPAT_FEATURE(sb,mask) \
|
#define EXT4_SET_RO_COMPAT_FEATURE(sb,mask) \
|
||||||
@ -985,13 +985,13 @@ extern ext4_fsblk_t ext4_old_new_blocks(handle_t *handle, struct inode *inode,
|
|||||||
ext4_fsblk_t goal, unsigned long *count, int *errp);
|
ext4_fsblk_t goal, unsigned long *count, int *errp);
|
||||||
extern ext4_fsblk_t ext4_has_free_blocks(struct ext4_sb_info *sbi,
|
extern ext4_fsblk_t ext4_has_free_blocks(struct ext4_sb_info *sbi,
|
||||||
ext4_fsblk_t nblocks);
|
ext4_fsblk_t nblocks);
|
||||||
extern void ext4_free_blocks (handle_t *handle, struct inode *inode,
|
extern void ext4_free_blocks(handle_t *handle, struct inode *inode,
|
||||||
ext4_fsblk_t block, unsigned long count, int metadata);
|
ext4_fsblk_t block, unsigned long count, int metadata);
|
||||||
extern void ext4_free_blocks_sb (handle_t *handle, struct super_block *sb,
|
extern void ext4_free_blocks_sb(handle_t *handle, struct super_block *sb,
|
||||||
ext4_fsblk_t block, unsigned long count,
|
ext4_fsblk_t block, unsigned long count,
|
||||||
unsigned long *pdquot_freed_blocks);
|
unsigned long *pdquot_freed_blocks);
|
||||||
extern ext4_fsblk_t ext4_count_free_blocks (struct super_block *);
|
extern ext4_fsblk_t ext4_count_free_blocks(struct super_block *);
|
||||||
extern void ext4_check_blocks_bitmap (struct super_block *);
|
extern void ext4_check_blocks_bitmap(struct super_block *);
|
||||||
extern struct ext4_group_desc * ext4_get_group_desc(struct super_block * sb,
|
extern struct ext4_group_desc * ext4_get_group_desc(struct super_block * sb,
|
||||||
ext4_group_t block_group,
|
ext4_group_t block_group,
|
||||||
struct buffer_head ** bh);
|
struct buffer_head ** bh);
|
||||||
@ -1009,20 +1009,20 @@ extern int ext4_htree_store_dirent(struct file *dir_file, __u32 hash,
|
|||||||
extern void ext4_htree_free_dir_info(struct dir_private_info *p);
|
extern void ext4_htree_free_dir_info(struct dir_private_info *p);
|
||||||
|
|
||||||
/* fsync.c */
|
/* fsync.c */
|
||||||
extern int ext4_sync_file (struct file *, struct dentry *, int);
|
extern int ext4_sync_file(struct file *, struct dentry *, int);
|
||||||
|
|
||||||
/* hash.c */
|
/* hash.c */
|
||||||
extern int ext4fs_dirhash(const char *name, int len, struct
|
extern int ext4fs_dirhash(const char *name, int len, struct
|
||||||
dx_hash_info *hinfo);
|
dx_hash_info *hinfo);
|
||||||
|
|
||||||
/* ialloc.c */
|
/* ialloc.c */
|
||||||
extern struct inode * ext4_new_inode (handle_t *, struct inode *, int);
|
extern struct inode * ext4_new_inode(handle_t *, struct inode *, int);
|
||||||
extern void ext4_free_inode (handle_t *, struct inode *);
|
extern void ext4_free_inode(handle_t *, struct inode *);
|
||||||
extern struct inode * ext4_orphan_get (struct super_block *, unsigned long);
|
extern struct inode * ext4_orphan_get(struct super_block *, unsigned long);
|
||||||
extern unsigned long ext4_count_free_inodes (struct super_block *);
|
extern unsigned long ext4_count_free_inodes(struct super_block *);
|
||||||
extern unsigned long ext4_count_dirs (struct super_block *);
|
extern unsigned long ext4_count_dirs(struct super_block *);
|
||||||
extern void ext4_check_inodes_bitmap (struct super_block *);
|
extern void ext4_check_inodes_bitmap(struct super_block *);
|
||||||
extern unsigned long ext4_count_free (struct buffer_head *, unsigned);
|
extern unsigned long ext4_count_free(struct buffer_head *, unsigned);
|
||||||
|
|
||||||
/* mballoc.c */
|
/* mballoc.c */
|
||||||
extern long ext4_mb_stats;
|
extern long ext4_mb_stats;
|
||||||
@ -1056,18 +1056,18 @@ int ext4_get_blocks_handle(handle_t *handle, struct inode *inode,
|
|||||||
int create, int extend_disksize);
|
int create, int extend_disksize);
|
||||||
|
|
||||||
extern struct inode *ext4_iget(struct super_block *, unsigned long);
|
extern struct inode *ext4_iget(struct super_block *, unsigned long);
|
||||||
extern int ext4_write_inode (struct inode *, int);
|
extern int ext4_write_inode(struct inode *, int);
|
||||||
extern int ext4_setattr (struct dentry *, struct iattr *);
|
extern int ext4_setattr(struct dentry *, struct iattr *);
|
||||||
extern int ext4_getattr(struct vfsmount *mnt, struct dentry *dentry,
|
extern int ext4_getattr(struct vfsmount *mnt, struct dentry *dentry,
|
||||||
struct kstat *stat);
|
struct kstat *stat);
|
||||||
extern void ext4_delete_inode (struct inode *);
|
extern void ext4_delete_inode(struct inode *);
|
||||||
extern int ext4_sync_inode (handle_t *, struct inode *);
|
extern int ext4_sync_inode(handle_t *, struct inode *);
|
||||||
extern void ext4_discard_reservation (struct inode *);
|
extern void ext4_discard_reservation(struct inode *);
|
||||||
extern void ext4_dirty_inode(struct inode *);
|
extern void ext4_dirty_inode(struct inode *);
|
||||||
extern int ext4_change_inode_journal_flag(struct inode *, int);
|
extern int ext4_change_inode_journal_flag(struct inode *, int);
|
||||||
extern int ext4_get_inode_loc(struct inode *, struct ext4_iloc *);
|
extern int ext4_get_inode_loc(struct inode *, struct ext4_iloc *);
|
||||||
extern int ext4_can_truncate(struct inode *inode);
|
extern int ext4_can_truncate(struct inode *inode);
|
||||||
extern void ext4_truncate (struct inode *);
|
extern void ext4_truncate(struct inode *);
|
||||||
extern void ext4_set_inode_flags(struct inode *);
|
extern void ext4_set_inode_flags(struct inode *);
|
||||||
extern void ext4_get_inode_flags(struct ext4_inode_info *);
|
extern void ext4_get_inode_flags(struct ext4_inode_info *);
|
||||||
extern void ext4_set_aops(struct inode *inode);
|
extern void ext4_set_aops(struct inode *inode);
|
||||||
@ -1080,7 +1080,7 @@ extern int ext4_page_mkwrite(struct vm_area_struct *vma, struct page *page);
|
|||||||
|
|
||||||
/* ioctl.c */
|
/* ioctl.c */
|
||||||
extern long ext4_ioctl(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);
|
extern long ext4_compat_ioctl(struct file *, unsigned int, unsigned long);
|
||||||
|
|
||||||
/* migrate.c */
|
/* migrate.c */
|
||||||
extern int ext4_ext_migrate(struct inode *, struct file *, unsigned int,
|
extern int ext4_ext_migrate(struct inode *, struct file *, unsigned int,
|
||||||
@ -1099,14 +1099,14 @@ extern int ext4_group_extend(struct super_block *sb,
|
|||||||
ext4_fsblk_t n_blocks_count);
|
ext4_fsblk_t n_blocks_count);
|
||||||
|
|
||||||
/* super.c */
|
/* super.c */
|
||||||
extern void ext4_error (struct super_block *, const char *, const char *, ...)
|
extern void ext4_error(struct super_block *, const char *, const char *, ...)
|
||||||
__attribute__ ((format (printf, 3, 4)));
|
__attribute__ ((format (printf, 3, 4)));
|
||||||
extern void __ext4_std_error (struct super_block *, const char *, int);
|
extern void __ext4_std_error(struct super_block *, const char *, int);
|
||||||
extern void ext4_abort (struct super_block *, const char *, const char *, ...)
|
extern void ext4_abort(struct super_block *, const char *, const char *, ...)
|
||||||
__attribute__ ((format (printf, 3, 4)));
|
__attribute__ ((format (printf, 3, 4)));
|
||||||
extern void ext4_warning (struct super_block *, const char *, const char *, ...)
|
extern void ext4_warning(struct super_block *, const char *, const char *, ...)
|
||||||
__attribute__ ((format (printf, 3, 4)));
|
__attribute__ ((format (printf, 3, 4)));
|
||||||
extern void ext4_update_dynamic_rev (struct super_block *sb);
|
extern void ext4_update_dynamic_rev(struct super_block *sb);
|
||||||
extern int ext4_update_compat_feature(handle_t *handle, struct super_block *sb,
|
extern int ext4_update_compat_feature(handle_t *handle, struct super_block *sb,
|
||||||
__u32 compat);
|
__u32 compat);
|
||||||
extern int ext4_update_rocompat_feature(handle_t *handle,
|
extern int ext4_update_rocompat_feature(handle_t *handle,
|
||||||
@ -1179,7 +1179,7 @@ static inline void ext4_isize_set(struct ext4_inode *raw_inode, loff_t i_size)
|
|||||||
|
|
||||||
static inline
|
static inline
|
||||||
struct ext4_group_info *ext4_get_group_info(struct super_block *sb,
|
struct ext4_group_info *ext4_get_group_info(struct super_block *sb,
|
||||||
ext4_group_t group)
|
ext4_group_t group)
|
||||||
{
|
{
|
||||||
struct ext4_group_info ***grp_info;
|
struct ext4_group_info ***grp_info;
|
||||||
long indexv, indexh;
|
long indexv, indexh;
|
||||||
|
@ -40,8 +40,8 @@ struct ext4_sb_info {
|
|||||||
unsigned long s_blocks_last; /* Last seen block count */
|
unsigned long s_blocks_last; /* Last seen block count */
|
||||||
loff_t s_bitmap_maxbytes; /* max bytes for bitmap files */
|
loff_t s_bitmap_maxbytes; /* max bytes for bitmap files */
|
||||||
struct buffer_head * s_sbh; /* Buffer containing the super block */
|
struct buffer_head * s_sbh; /* Buffer containing the super block */
|
||||||
struct ext4_super_block * s_es; /* Pointer to the super block in the buffer */
|
struct ext4_super_block *s_es; /* Pointer to the super block in the buffer */
|
||||||
struct buffer_head ** s_group_desc;
|
struct buffer_head **s_group_desc;
|
||||||
unsigned long s_mount_opt;
|
unsigned long s_mount_opt;
|
||||||
ext4_fsblk_t s_sb_block;
|
ext4_fsblk_t s_sb_block;
|
||||||
uid_t s_resuid;
|
uid_t s_resuid;
|
||||||
@ -67,8 +67,8 @@ struct ext4_sb_info {
|
|||||||
struct ext4_reserve_window_node s_rsv_window_head;
|
struct ext4_reserve_window_node s_rsv_window_head;
|
||||||
|
|
||||||
/* Journaling */
|
/* Journaling */
|
||||||
struct inode * s_journal_inode;
|
struct inode *s_journal_inode;
|
||||||
struct journal_s * s_journal;
|
struct journal_s *s_journal;
|
||||||
struct list_head s_orphan;
|
struct list_head s_orphan;
|
||||||
unsigned long s_commit_interval;
|
unsigned long s_commit_interval;
|
||||||
struct block_device *journal_bdev;
|
struct block_device *journal_bdev;
|
||||||
|
@ -383,8 +383,8 @@ static void ext4_ext_show_leaf(struct inode *inode, struct ext4_ext_path *path)
|
|||||||
ext_debug("\n");
|
ext_debug("\n");
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define ext4_ext_show_path(inode,path)
|
#define ext4_ext_show_path(inode, path)
|
||||||
#define ext4_ext_show_leaf(inode,path)
|
#define ext4_ext_show_leaf(inode, path)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void ext4_ext_drop_refs(struct ext4_ext_path *path)
|
void ext4_ext_drop_refs(struct ext4_ext_path *path)
|
||||||
@ -1476,7 +1476,7 @@ int ext4_ext_insert_extent(handle_t *handle, struct inode *inode,
|
|||||||
struct ext4_ext_path *path,
|
struct ext4_ext_path *path,
|
||||||
struct ext4_extent *newext)
|
struct ext4_extent *newext)
|
||||||
{
|
{
|
||||||
struct ext4_extent_header * eh;
|
struct ext4_extent_header *eh;
|
||||||
struct ext4_extent *ex, *fex;
|
struct ext4_extent *ex, *fex;
|
||||||
struct ext4_extent *nearex; /* nearest extent */
|
struct ext4_extent *nearex; /* nearest extent */
|
||||||
struct ext4_ext_path *npath = NULL;
|
struct ext4_ext_path *npath = NULL;
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
* from ext4_file_open: open gets called at every open, but release
|
* from ext4_file_open: open gets called at every open, but release
|
||||||
* gets called only when /all/ the files are closed.
|
* gets called only when /all/ the files are closed.
|
||||||
*/
|
*/
|
||||||
static int ext4_release_file (struct inode * inode, struct file * filp)
|
static int ext4_release_file(struct inode *inode, struct file *filp)
|
||||||
{
|
{
|
||||||
/* if we are the last writer on the inode, drop the block reservation */
|
/* if we are the last writer on the inode, drop the block reservation */
|
||||||
if ((filp->f_mode & FMODE_WRITE) &&
|
if ((filp->f_mode & FMODE_WRITE) &&
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
* inode to disk.
|
* inode to disk.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int ext4_sync_file(struct file * file, struct dentry *dentry, int datasync)
|
int ext4_sync_file(struct file *file, struct dentry *dentry, int datasync)
|
||||||
{
|
{
|
||||||
struct inode *inode = dentry->d_inode;
|
struct inode *inode = dentry->d_inode;
|
||||||
journal_t *journal = EXT4_SB(inode->i_sb)->s_journal;
|
journal_t *journal = EXT4_SB(inode->i_sb)->s_journal;
|
||||||
|
@ -27,7 +27,7 @@ static void TEA_transform(__u32 buf[4], __u32 const in[])
|
|||||||
sum += DELTA;
|
sum += DELTA;
|
||||||
b0 += ((b1 << 4)+a) ^ (b1+sum) ^ ((b1 >> 5)+b);
|
b0 += ((b1 << 4)+a) ^ (b1+sum) ^ ((b1 >> 5)+b);
|
||||||
b1 += ((b0 << 4)+c) ^ (b0+sum) ^ ((b0 >> 5)+d);
|
b1 += ((b0 << 4)+c) ^ (b0+sum) ^ ((b0 >> 5)+d);
|
||||||
} while(--n);
|
} while (--n);
|
||||||
|
|
||||||
buf[0] += b0;
|
buf[0] += b0;
|
||||||
buf[1] += b1;
|
buf[1] += b1;
|
||||||
@ -35,7 +35,7 @@ static void TEA_transform(__u32 buf[4], __u32 const in[])
|
|||||||
|
|
||||||
|
|
||||||
/* The old legacy hash */
|
/* The old legacy hash */
|
||||||
static __u32 dx_hack_hash (const char *name, int len)
|
static __u32 dx_hack_hash(const char *name, int len)
|
||||||
{
|
{
|
||||||
__u32 hash0 = 0x12a3fe2d, hash1 = 0x37abe8f9;
|
__u32 hash0 = 0x12a3fe2d, hash1 = 0x37abe8f9;
|
||||||
while (len--) {
|
while (len--) {
|
||||||
@ -59,7 +59,7 @@ static void str2hashbuf(const char *msg, int len, __u32 *buf, int num)
|
|||||||
val = pad;
|
val = pad;
|
||||||
if (len > num*4)
|
if (len > num*4)
|
||||||
len = num * 4;
|
len = num * 4;
|
||||||
for (i=0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
if ((i % 4) == 0)
|
if ((i % 4) == 0)
|
||||||
val = pad;
|
val = pad;
|
||||||
val = msg[i] + (val << 8);
|
val = msg[i] + (val << 8);
|
||||||
@ -104,7 +104,7 @@ int ext4fs_dirhash(const char *name, int len, struct dx_hash_info *hinfo)
|
|||||||
|
|
||||||
/* Check to see if the seed is all zero's */
|
/* Check to see if the seed is all zero's */
|
||||||
if (hinfo->seed) {
|
if (hinfo->seed) {
|
||||||
for (i=0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
if (hinfo->seed[i])
|
if (hinfo->seed[i])
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -154,17 +154,17 @@ ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
|
|||||||
* though), and then we'd have two inodes sharing the
|
* though), and then we'd have two inodes sharing the
|
||||||
* same inode number and space on the harddisk.
|
* same inode number and space on the harddisk.
|
||||||
*/
|
*/
|
||||||
void ext4_free_inode (handle_t *handle, struct inode * inode)
|
void ext4_free_inode(handle_t *handle, struct inode *inode)
|
||||||
{
|
{
|
||||||
struct super_block * sb = inode->i_sb;
|
struct super_block *sb = inode->i_sb;
|
||||||
int is_directory;
|
int is_directory;
|
||||||
unsigned long ino;
|
unsigned long ino;
|
||||||
struct buffer_head *bitmap_bh = NULL;
|
struct buffer_head *bitmap_bh = NULL;
|
||||||
struct buffer_head *bh2;
|
struct buffer_head *bh2;
|
||||||
ext4_group_t block_group;
|
ext4_group_t block_group;
|
||||||
unsigned long bit;
|
unsigned long bit;
|
||||||
struct ext4_group_desc * gdp;
|
struct ext4_group_desc *gdp;
|
||||||
struct ext4_super_block * es;
|
struct ext4_super_block *es;
|
||||||
struct ext4_sb_info *sbi;
|
struct ext4_sb_info *sbi;
|
||||||
int fatal = 0, err;
|
int fatal = 0, err;
|
||||||
ext4_group_t flex_group;
|
ext4_group_t flex_group;
|
||||||
@ -187,7 +187,7 @@ void ext4_free_inode (handle_t *handle, struct inode * inode)
|
|||||||
sbi = EXT4_SB(sb);
|
sbi = EXT4_SB(sb);
|
||||||
|
|
||||||
ino = inode->i_ino;
|
ino = inode->i_ino;
|
||||||
ext4_debug ("freeing inode %lu\n", ino);
|
ext4_debug("freeing inode %lu\n", ino);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Note: we must free any quota before locking the superblock,
|
* Note: we must free any quota before locking the superblock,
|
||||||
@ -201,12 +201,12 @@ void ext4_free_inode (handle_t *handle, struct inode * inode)
|
|||||||
is_directory = S_ISDIR(inode->i_mode);
|
is_directory = S_ISDIR(inode->i_mode);
|
||||||
|
|
||||||
/* Do this BEFORE marking the inode not in use or returning an error */
|
/* Do this BEFORE marking the inode not in use or returning an error */
|
||||||
clear_inode (inode);
|
clear_inode(inode);
|
||||||
|
|
||||||
es = EXT4_SB(sb)->s_es;
|
es = EXT4_SB(sb)->s_es;
|
||||||
if (ino < EXT4_FIRST_INO(sb) || ino > le32_to_cpu(es->s_inodes_count)) {
|
if (ino < EXT4_FIRST_INO(sb) || ino > le32_to_cpu(es->s_inodes_count)) {
|
||||||
ext4_error (sb, "ext4_free_inode",
|
ext4_error(sb, "ext4_free_inode",
|
||||||
"reserved or nonexistent inode %lu", ino);
|
"reserved or nonexistent inode %lu", ino);
|
||||||
goto error_return;
|
goto error_return;
|
||||||
}
|
}
|
||||||
block_group = (ino - 1) / EXT4_INODES_PER_GROUP(sb);
|
block_group = (ino - 1) / EXT4_INODES_PER_GROUP(sb);
|
||||||
@ -223,10 +223,10 @@ void ext4_free_inode (handle_t *handle, struct inode * inode)
|
|||||||
/* Ok, now we can actually update the inode bitmaps.. */
|
/* Ok, now we can actually update the inode bitmaps.. */
|
||||||
if (!ext4_clear_bit_atomic(sb_bgl_lock(sbi, block_group),
|
if (!ext4_clear_bit_atomic(sb_bgl_lock(sbi, block_group),
|
||||||
bit, bitmap_bh->b_data))
|
bit, bitmap_bh->b_data))
|
||||||
ext4_error (sb, "ext4_free_inode",
|
ext4_error(sb, "ext4_free_inode",
|
||||||
"bit already cleared for inode %lu", ino);
|
"bit already cleared for inode %lu", ino);
|
||||||
else {
|
else {
|
||||||
gdp = ext4_get_group_desc (sb, block_group, &bh2);
|
gdp = ext4_get_group_desc(sb, block_group, &bh2);
|
||||||
|
|
||||||
BUFFER_TRACE(bh2, "get_write_access");
|
BUFFER_TRACE(bh2, "get_write_access");
|
||||||
fatal = ext4_journal_get_write_access(handle, bh2);
|
fatal = ext4_journal_get_write_access(handle, bh2);
|
||||||
@ -288,7 +288,7 @@ static int find_group_dir(struct super_block *sb, struct inode *parent,
|
|||||||
avefreei = freei / ngroups;
|
avefreei = freei / ngroups;
|
||||||
|
|
||||||
for (group = 0; group < ngroups; group++) {
|
for (group = 0; group < ngroups; group++) {
|
||||||
desc = ext4_get_group_desc (sb, group, NULL);
|
desc = ext4_get_group_desc(sb, group, NULL);
|
||||||
if (!desc || !desc->bg_free_inodes_count)
|
if (!desc || !desc->bg_free_inodes_count)
|
||||||
continue;
|
continue;
|
||||||
if (le16_to_cpu(desc->bg_free_inodes_count) < avefreei)
|
if (le16_to_cpu(desc->bg_free_inodes_count) < avefreei)
|
||||||
@ -577,16 +577,16 @@ static int find_group_other(struct super_block *sb, struct inode *parent,
|
|||||||
* For other inodes, search forward from the parent directory's block
|
* For other inodes, search forward from the parent directory's block
|
||||||
* group to find a free inode.
|
* group to find a free inode.
|
||||||
*/
|
*/
|
||||||
struct inode *ext4_new_inode(handle_t *handle, struct inode * dir, int mode)
|
struct inode *ext4_new_inode(handle_t *handle, struct inode *dir, int mode)
|
||||||
{
|
{
|
||||||
struct super_block *sb;
|
struct super_block *sb;
|
||||||
struct buffer_head *bitmap_bh = NULL;
|
struct buffer_head *bitmap_bh = NULL;
|
||||||
struct buffer_head *bh2;
|
struct buffer_head *bh2;
|
||||||
ext4_group_t group = 0;
|
ext4_group_t group = 0;
|
||||||
unsigned long ino = 0;
|
unsigned long ino = 0;
|
||||||
struct inode * inode;
|
struct inode *inode;
|
||||||
struct ext4_group_desc * gdp = NULL;
|
struct ext4_group_desc *gdp = NULL;
|
||||||
struct ext4_super_block * es;
|
struct ext4_super_block *es;
|
||||||
struct ext4_inode_info *ei;
|
struct ext4_inode_info *ei;
|
||||||
struct ext4_sb_info *sbi;
|
struct ext4_sb_info *sbi;
|
||||||
int ret2, err = 0;
|
int ret2, err = 0;
|
||||||
@ -614,7 +614,7 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode * dir, int mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (S_ISDIR(mode)) {
|
if (S_ISDIR(mode)) {
|
||||||
if (test_opt (sb, OLDALLOC))
|
if (test_opt(sb, OLDALLOC))
|
||||||
ret2 = find_group_dir(sb, dir, &group);
|
ret2 = find_group_dir(sb, dir, &group);
|
||||||
else
|
else
|
||||||
ret2 = find_group_orlov(sb, dir, &group);
|
ret2 = find_group_orlov(sb, dir, &group);
|
||||||
@ -784,7 +784,7 @@ got:
|
|||||||
}
|
}
|
||||||
|
|
||||||
inode->i_uid = current->fsuid;
|
inode->i_uid = current->fsuid;
|
||||||
if (test_opt (sb, GRPID))
|
if (test_opt(sb, GRPID))
|
||||||
inode->i_gid = dir->i_gid;
|
inode->i_gid = dir->i_gid;
|
||||||
else if (dir->i_mode & S_ISGID) {
|
else if (dir->i_mode & S_ISGID) {
|
||||||
inode->i_gid = dir->i_gid;
|
inode->i_gid = dir->i_gid;
|
||||||
@ -833,7 +833,7 @@ got:
|
|||||||
ei->i_extra_isize = EXT4_SB(sb)->s_want_extra_isize;
|
ei->i_extra_isize = EXT4_SB(sb)->s_want_extra_isize;
|
||||||
|
|
||||||
ret = inode;
|
ret = inode;
|
||||||
if(DQUOT_ALLOC_INODE(inode)) {
|
if (DQUOT_ALLOC_INODE(inode)) {
|
||||||
err = -EDQUOT;
|
err = -EDQUOT;
|
||||||
goto fail_drop;
|
goto fail_drop;
|
||||||
}
|
}
|
||||||
@ -842,7 +842,7 @@ got:
|
|||||||
if (err)
|
if (err)
|
||||||
goto fail_free_drop;
|
goto fail_free_drop;
|
||||||
|
|
||||||
err = ext4_init_security(handle,inode, dir);
|
err = ext4_init_security(handle, inode, dir);
|
||||||
if (err)
|
if (err)
|
||||||
goto fail_free_drop;
|
goto fail_free_drop;
|
||||||
|
|
||||||
@ -960,7 +960,7 @@ error:
|
|||||||
return ERR_PTR(err);
|
return ERR_PTR(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long ext4_count_free_inodes (struct super_block * sb)
|
unsigned long ext4_count_free_inodes(struct super_block *sb)
|
||||||
{
|
{
|
||||||
unsigned long desc_count;
|
unsigned long desc_count;
|
||||||
struct ext4_group_desc *gdp;
|
struct ext4_group_desc *gdp;
|
||||||
@ -975,7 +975,7 @@ unsigned long ext4_count_free_inodes (struct super_block * sb)
|
|||||||
bitmap_count = 0;
|
bitmap_count = 0;
|
||||||
gdp = NULL;
|
gdp = NULL;
|
||||||
for (i = 0; i < EXT4_SB(sb)->s_groups_count; i++) {
|
for (i = 0; i < EXT4_SB(sb)->s_groups_count; i++) {
|
||||||
gdp = ext4_get_group_desc (sb, i, NULL);
|
gdp = ext4_get_group_desc(sb, i, NULL);
|
||||||
if (!gdp)
|
if (!gdp)
|
||||||
continue;
|
continue;
|
||||||
desc_count += le16_to_cpu(gdp->bg_free_inodes_count);
|
desc_count += le16_to_cpu(gdp->bg_free_inodes_count);
|
||||||
@ -997,7 +997,7 @@ unsigned long ext4_count_free_inodes (struct super_block * sb)
|
|||||||
#else
|
#else
|
||||||
desc_count = 0;
|
desc_count = 0;
|
||||||
for (i = 0; i < EXT4_SB(sb)->s_groups_count; i++) {
|
for (i = 0; i < EXT4_SB(sb)->s_groups_count; i++) {
|
||||||
gdp = ext4_get_group_desc (sb, i, NULL);
|
gdp = ext4_get_group_desc(sb, i, NULL);
|
||||||
if (!gdp)
|
if (!gdp)
|
||||||
continue;
|
continue;
|
||||||
desc_count += le16_to_cpu(gdp->bg_free_inodes_count);
|
desc_count += le16_to_cpu(gdp->bg_free_inodes_count);
|
||||||
@ -1008,13 +1008,13 @@ unsigned long ext4_count_free_inodes (struct super_block * sb)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Called at mount-time, super-block is locked */
|
/* Called at mount-time, super-block is locked */
|
||||||
unsigned long ext4_count_dirs (struct super_block * sb)
|
unsigned long ext4_count_dirs(struct super_block * sb)
|
||||||
{
|
{
|
||||||
unsigned long count = 0;
|
unsigned long count = 0;
|
||||||
ext4_group_t i;
|
ext4_group_t i;
|
||||||
|
|
||||||
for (i = 0; i < EXT4_SB(sb)->s_groups_count; i++) {
|
for (i = 0; i < EXT4_SB(sb)->s_groups_count; i++) {
|
||||||
struct ext4_group_desc *gdp = ext4_get_group_desc (sb, i, NULL);
|
struct ext4_group_desc *gdp = ext4_get_group_desc(sb, i, NULL);
|
||||||
if (!gdp)
|
if (!gdp)
|
||||||
continue;
|
continue;
|
||||||
count += le16_to_cpu(gdp->bg_used_dirs_count);
|
count += le16_to_cpu(gdp->bg_used_dirs_count);
|
||||||
|
@ -190,7 +190,7 @@ static int ext4_journal_test_restart(handle_t *handle, struct inode *inode)
|
|||||||
/*
|
/*
|
||||||
* Called at the last iput() if i_nlink is zero.
|
* Called at the last iput() if i_nlink is zero.
|
||||||
*/
|
*/
|
||||||
void ext4_delete_inode (struct inode * inode)
|
void ext4_delete_inode(struct inode *inode)
|
||||||
{
|
{
|
||||||
handle_t *handle;
|
handle_t *handle;
|
||||||
int err;
|
int err;
|
||||||
@ -330,11 +330,11 @@ static int ext4_block_to_path(struct inode *inode,
|
|||||||
int final = 0;
|
int final = 0;
|
||||||
|
|
||||||
if (i_block < 0) {
|
if (i_block < 0) {
|
||||||
ext4_warning (inode->i_sb, "ext4_block_to_path", "block < 0");
|
ext4_warning(inode->i_sb, "ext4_block_to_path", "block < 0");
|
||||||
} else if (i_block < direct_blocks) {
|
} else if (i_block < direct_blocks) {
|
||||||
offsets[n++] = i_block;
|
offsets[n++] = i_block;
|
||||||
final = direct_blocks;
|
final = direct_blocks;
|
||||||
} else if ( (i_block -= direct_blocks) < indirect_blocks) {
|
} else if ((i_block -= direct_blocks) < indirect_blocks) {
|
||||||
offsets[n++] = EXT4_IND_BLOCK;
|
offsets[n++] = EXT4_IND_BLOCK;
|
||||||
offsets[n++] = i_block;
|
offsets[n++] = i_block;
|
||||||
final = ptrs;
|
final = ptrs;
|
||||||
@ -400,14 +400,14 @@ static Indirect *ext4_get_branch(struct inode *inode, int depth,
|
|||||||
|
|
||||||
*err = 0;
|
*err = 0;
|
||||||
/* i_data is not going away, no lock needed */
|
/* i_data is not going away, no lock needed */
|
||||||
add_chain (chain, NULL, EXT4_I(inode)->i_data + *offsets);
|
add_chain(chain, NULL, EXT4_I(inode)->i_data + *offsets);
|
||||||
if (!p->key)
|
if (!p->key)
|
||||||
goto no_block;
|
goto no_block;
|
||||||
while (--depth) {
|
while (--depth) {
|
||||||
bh = sb_bread(sb, le32_to_cpu(p->key));
|
bh = sb_bread(sb, le32_to_cpu(p->key));
|
||||||
if (!bh)
|
if (!bh)
|
||||||
goto failure;
|
goto failure;
|
||||||
add_chain(++p, bh, (__le32*)bh->b_data + *++offsets);
|
add_chain(++p, bh, (__le32 *)bh->b_data + *++offsets);
|
||||||
/* Reader: end */
|
/* Reader: end */
|
||||||
if (!p->key)
|
if (!p->key)
|
||||||
goto no_block;
|
goto no_block;
|
||||||
@ -443,7 +443,7 @@ no_block:
|
|||||||
static ext4_fsblk_t ext4_find_near(struct inode *inode, Indirect *ind)
|
static ext4_fsblk_t ext4_find_near(struct inode *inode, Indirect *ind)
|
||||||
{
|
{
|
||||||
struct ext4_inode_info *ei = EXT4_I(inode);
|
struct ext4_inode_info *ei = EXT4_I(inode);
|
||||||
__le32 *start = ind->bh ? (__le32*) ind->bh->b_data : ei->i_data;
|
__le32 *start = ind->bh ? (__le32 *) ind->bh->b_data : ei->i_data;
|
||||||
__le32 *p;
|
__le32 *p;
|
||||||
ext4_fsblk_t bg_start;
|
ext4_fsblk_t bg_start;
|
||||||
ext4_fsblk_t last_block;
|
ext4_fsblk_t last_block;
|
||||||
@ -630,7 +630,7 @@ allocated:
|
|||||||
*err = 0;
|
*err = 0;
|
||||||
return ret;
|
return ret;
|
||||||
failed_out:
|
failed_out:
|
||||||
for (i = 0; i <index; i++)
|
for (i = 0; i < index; i++)
|
||||||
ext4_free_blocks(handle, inode, new_blocks[i], 1, 0);
|
ext4_free_blocks(handle, inode, new_blocks[i], 1, 0);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -703,7 +703,7 @@ static int ext4_alloc_branch(handle_t *handle, struct inode *inode,
|
|||||||
branch[n].p = (__le32 *) bh->b_data + offsets[n];
|
branch[n].p = (__le32 *) bh->b_data + offsets[n];
|
||||||
branch[n].key = cpu_to_le32(new_blocks[n]);
|
branch[n].key = cpu_to_le32(new_blocks[n]);
|
||||||
*branch[n].p = branch[n].key;
|
*branch[n].p = branch[n].key;
|
||||||
if ( n == indirect_blks) {
|
if (n == indirect_blks) {
|
||||||
current_block = new_blocks[n];
|
current_block = new_blocks[n];
|
||||||
/*
|
/*
|
||||||
* End of chain, update the last new metablock of
|
* End of chain, update the last new metablock of
|
||||||
@ -730,7 +730,7 @@ failed:
|
|||||||
BUFFER_TRACE(branch[i].bh, "call jbd2_journal_forget");
|
BUFFER_TRACE(branch[i].bh, "call jbd2_journal_forget");
|
||||||
ext4_journal_forget(handle, branch[i].bh);
|
ext4_journal_forget(handle, branch[i].bh);
|
||||||
}
|
}
|
||||||
for (i = 0; i <indirect_blks; i++)
|
for (i = 0; i < indirect_blks; i++)
|
||||||
ext4_free_blocks(handle, inode, new_blocks[i], 1, 0);
|
ext4_free_blocks(handle, inode, new_blocks[i], 1, 0);
|
||||||
|
|
||||||
ext4_free_blocks(handle, inode, new_blocks[i], num, 0);
|
ext4_free_blocks(handle, inode, new_blocks[i], num, 0);
|
||||||
@ -783,7 +783,7 @@ static int ext4_splice_branch(handle_t *handle, struct inode *inode,
|
|||||||
if (num == 0 && blks > 1) {
|
if (num == 0 && blks > 1) {
|
||||||
current_block = le32_to_cpu(where->key) + 1;
|
current_block = le32_to_cpu(where->key) + 1;
|
||||||
for (i = 1; i < blks; i++)
|
for (i = 1; i < blks; i++)
|
||||||
*(where->p + i ) = cpu_to_le32(current_block++);
|
*(where->p + i) = cpu_to_le32(current_block++);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1241,7 +1241,7 @@ struct buffer_head *ext4_getblk(handle_t *handle, struct inode *inode,
|
|||||||
BUFFER_TRACE(bh, "call get_create_access");
|
BUFFER_TRACE(bh, "call get_create_access");
|
||||||
fatal = ext4_journal_get_create_access(handle, bh);
|
fatal = ext4_journal_get_create_access(handle, bh);
|
||||||
if (!fatal && !buffer_uptodate(bh)) {
|
if (!fatal && !buffer_uptodate(bh)) {
|
||||||
memset(bh->b_data,0,inode->i_sb->s_blocksize);
|
memset(bh->b_data, 0, inode->i_sb->s_blocksize);
|
||||||
set_buffer_uptodate(bh);
|
set_buffer_uptodate(bh);
|
||||||
}
|
}
|
||||||
unlock_buffer(bh);
|
unlock_buffer(bh);
|
||||||
@ -1266,7 +1266,7 @@ err:
|
|||||||
struct buffer_head *ext4_bread(handle_t *handle, struct inode *inode,
|
struct buffer_head *ext4_bread(handle_t *handle, struct inode *inode,
|
||||||
ext4_lblk_t block, int create, int *err)
|
ext4_lblk_t block, int create, int *err)
|
||||||
{
|
{
|
||||||
struct buffer_head * bh;
|
struct buffer_head *bh;
|
||||||
|
|
||||||
bh = ext4_getblk(handle, inode, block, create, err);
|
bh = ext4_getblk(handle, inode, block, create, err);
|
||||||
if (!bh)
|
if (!bh)
|
||||||
@ -1282,13 +1282,13 @@ struct buffer_head *ext4_bread(handle_t *handle, struct inode *inode,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int walk_page_buffers( handle_t *handle,
|
static int walk_page_buffers(handle_t *handle,
|
||||||
struct buffer_head *head,
|
struct buffer_head *head,
|
||||||
unsigned from,
|
unsigned from,
|
||||||
unsigned to,
|
unsigned to,
|
||||||
int *partial,
|
int *partial,
|
||||||
int (*fn)( handle_t *handle,
|
int (*fn)(handle_t *handle,
|
||||||
struct buffer_head *bh))
|
struct buffer_head *bh))
|
||||||
{
|
{
|
||||||
struct buffer_head *bh;
|
struct buffer_head *bh;
|
||||||
unsigned block_start, block_end;
|
unsigned block_start, block_end;
|
||||||
@ -1296,9 +1296,9 @@ static int walk_page_buffers( handle_t *handle,
|
|||||||
int err, ret = 0;
|
int err, ret = 0;
|
||||||
struct buffer_head *next;
|
struct buffer_head *next;
|
||||||
|
|
||||||
for ( bh = head, block_start = 0;
|
for (bh = head, block_start = 0;
|
||||||
ret == 0 && (bh != head || !block_start);
|
ret == 0 && (bh != head || !block_start);
|
||||||
block_start = block_end, bh = next)
|
block_start = block_end, bh = next)
|
||||||
{
|
{
|
||||||
next = bh->b_this_page;
|
next = bh->b_this_page;
|
||||||
block_end = block_start + blocksize;
|
block_end = block_start + blocksize;
|
||||||
@ -1351,23 +1351,23 @@ static int ext4_write_begin(struct file *file, struct address_space *mapping,
|
|||||||
loff_t pos, unsigned len, unsigned flags,
|
loff_t pos, unsigned len, unsigned flags,
|
||||||
struct page **pagep, void **fsdata)
|
struct page **pagep, void **fsdata)
|
||||||
{
|
{
|
||||||
struct inode *inode = mapping->host;
|
struct inode *inode = mapping->host;
|
||||||
int ret, needed_blocks = ext4_writepage_trans_blocks(inode);
|
int ret, needed_blocks = ext4_writepage_trans_blocks(inode);
|
||||||
handle_t *handle;
|
handle_t *handle;
|
||||||
int retries = 0;
|
int retries = 0;
|
||||||
struct page *page;
|
struct page *page;
|
||||||
pgoff_t index;
|
pgoff_t index;
|
||||||
unsigned from, to;
|
unsigned from, to;
|
||||||
|
|
||||||
index = pos >> PAGE_CACHE_SHIFT;
|
index = pos >> PAGE_CACHE_SHIFT;
|
||||||
from = pos & (PAGE_CACHE_SIZE - 1);
|
from = pos & (PAGE_CACHE_SIZE - 1);
|
||||||
to = from + len;
|
to = from + len;
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
handle = ext4_journal_start(inode, needed_blocks);
|
handle = ext4_journal_start(inode, needed_blocks);
|
||||||
if (IS_ERR(handle)) {
|
if (IS_ERR(handle)) {
|
||||||
ret = PTR_ERR(handle);
|
ret = PTR_ERR(handle);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
page = __grab_cache_page(mapping, index);
|
page = __grab_cache_page(mapping, index);
|
||||||
@ -1387,9 +1387,9 @@ retry:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
unlock_page(page);
|
unlock_page(page);
|
||||||
ext4_journal_stop(handle);
|
ext4_journal_stop(handle);
|
||||||
page_cache_release(page);
|
page_cache_release(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries))
|
if (ret == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries))
|
||||||
@ -2456,7 +2456,7 @@ static int ext4_da_should_update_i_disksize(struct page *page,
|
|||||||
bh = page_buffers(page);
|
bh = page_buffers(page);
|
||||||
idx = offset >> inode->i_blkbits;
|
idx = offset >> inode->i_blkbits;
|
||||||
|
|
||||||
for (i=0; i < idx; i++)
|
for (i = 0; i < idx; i++)
|
||||||
bh = bh->b_this_page;
|
bh = bh->b_this_page;
|
||||||
|
|
||||||
if (!buffer_mapped(bh) || (buffer_delay(bh)))
|
if (!buffer_mapped(bh) || (buffer_delay(bh)))
|
||||||
@ -2476,7 +2476,7 @@ static int ext4_da_write_end(struct file *file,
|
|||||||
unsigned long start, end;
|
unsigned long start, end;
|
||||||
|
|
||||||
start = pos & (PAGE_CACHE_SIZE - 1);
|
start = pos & (PAGE_CACHE_SIZE - 1);
|
||||||
end = start + copied -1;
|
end = start + copied - 1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* generic_write_end() will run mark_inode_dirty() if i_size
|
* generic_write_end() will run mark_inode_dirty() if i_size
|
||||||
@ -2591,7 +2591,7 @@ static sector_t ext4_bmap(struct address_space *mapping, sector_t block)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return generic_block_bmap(mapping,block,ext4_get_block);
|
return generic_block_bmap(mapping, block, ext4_get_block);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int bget_one(handle_t *handle, struct buffer_head *bh)
|
static int bget_one(handle_t *handle, struct buffer_head *bh)
|
||||||
@ -3197,7 +3197,7 @@ static Indirect *ext4_find_shared(struct inode *inode, int depth,
|
|||||||
if (!partial->key && *partial->p)
|
if (!partial->key && *partial->p)
|
||||||
/* Writer: end */
|
/* Writer: end */
|
||||||
goto no_top;
|
goto no_top;
|
||||||
for (p=partial; p>chain && all_zeroes((__le32*)p->bh->b_data,p->p); p--)
|
for (p = partial; (p > chain) && all_zeroes((__le32 *) p->bh->b_data, p->p); p--)
|
||||||
;
|
;
|
||||||
/*
|
/*
|
||||||
* OK, we've found the last block that must survive. The rest of our
|
* OK, we've found the last block that must survive. The rest of our
|
||||||
@ -3216,7 +3216,7 @@ static Indirect *ext4_find_shared(struct inode *inode, int depth,
|
|||||||
}
|
}
|
||||||
/* Writer: end */
|
/* Writer: end */
|
||||||
|
|
||||||
while(partial > p) {
|
while (partial > p) {
|
||||||
brelse(partial->bh);
|
brelse(partial->bh);
|
||||||
partial--;
|
partial--;
|
||||||
}
|
}
|
||||||
@ -3408,9 +3408,9 @@ static void ext4_free_branches(handle_t *handle, struct inode *inode,
|
|||||||
/* This zaps the entire block. Bottom up. */
|
/* This zaps the entire block. Bottom up. */
|
||||||
BUFFER_TRACE(bh, "free child branches");
|
BUFFER_TRACE(bh, "free child branches");
|
||||||
ext4_free_branches(handle, inode, bh,
|
ext4_free_branches(handle, inode, bh,
|
||||||
(__le32*)bh->b_data,
|
(__le32 *) bh->b_data,
|
||||||
(__le32*)bh->b_data + addr_per_block,
|
(__le32 *) bh->b_data + addr_per_block,
|
||||||
depth);
|
depth);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We've probably journalled the indirect block several
|
* We've probably journalled the indirect block several
|
||||||
@ -3927,7 +3927,7 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino)
|
|||||||
inode->i_mode = le16_to_cpu(raw_inode->i_mode);
|
inode->i_mode = le16_to_cpu(raw_inode->i_mode);
|
||||||
inode->i_uid = (uid_t)le16_to_cpu(raw_inode->i_uid_low);
|
inode->i_uid = (uid_t)le16_to_cpu(raw_inode->i_uid_low);
|
||||||
inode->i_gid = (gid_t)le16_to_cpu(raw_inode->i_gid_low);
|
inode->i_gid = (gid_t)le16_to_cpu(raw_inode->i_gid_low);
|
||||||
if(!(test_opt (inode->i_sb, NO_UID32))) {
|
if (!(test_opt(inode->i_sb, NO_UID32))) {
|
||||||
inode->i_uid |= le16_to_cpu(raw_inode->i_uid_high) << 16;
|
inode->i_uid |= le16_to_cpu(raw_inode->i_uid_high) << 16;
|
||||||
inode->i_gid |= le16_to_cpu(raw_inode->i_gid_high) << 16;
|
inode->i_gid |= le16_to_cpu(raw_inode->i_gid_high) << 16;
|
||||||
}
|
}
|
||||||
@ -3945,7 +3945,7 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino)
|
|||||||
if (inode->i_mode == 0 ||
|
if (inode->i_mode == 0 ||
|
||||||
!(EXT4_SB(inode->i_sb)->s_mount_state & EXT4_ORPHAN_FS)) {
|
!(EXT4_SB(inode->i_sb)->s_mount_state & EXT4_ORPHAN_FS)) {
|
||||||
/* this inode is deleted */
|
/* this inode is deleted */
|
||||||
brelse (bh);
|
brelse(bh);
|
||||||
ret = -ESTALE;
|
ret = -ESTALE;
|
||||||
goto bad_inode;
|
goto bad_inode;
|
||||||
}
|
}
|
||||||
@ -3978,7 +3978,7 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino)
|
|||||||
ei->i_extra_isize = le16_to_cpu(raw_inode->i_extra_isize);
|
ei->i_extra_isize = le16_to_cpu(raw_inode->i_extra_isize);
|
||||||
if (EXT4_GOOD_OLD_INODE_SIZE + ei->i_extra_isize >
|
if (EXT4_GOOD_OLD_INODE_SIZE + ei->i_extra_isize >
|
||||||
EXT4_INODE_SIZE(inode->i_sb)) {
|
EXT4_INODE_SIZE(inode->i_sb)) {
|
||||||
brelse (bh);
|
brelse(bh);
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
goto bad_inode;
|
goto bad_inode;
|
||||||
}
|
}
|
||||||
@ -4031,7 +4031,7 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino)
|
|||||||
init_special_inode(inode, inode->i_mode,
|
init_special_inode(inode, inode->i_mode,
|
||||||
new_decode_dev(le32_to_cpu(raw_inode->i_block[1])));
|
new_decode_dev(le32_to_cpu(raw_inode->i_block[1])));
|
||||||
}
|
}
|
||||||
brelse (iloc.bh);
|
brelse(iloc.bh);
|
||||||
ext4_set_inode_flags(inode);
|
ext4_set_inode_flags(inode);
|
||||||
unlock_new_inode(inode);
|
unlock_new_inode(inode);
|
||||||
return inode;
|
return inode;
|
||||||
@ -4113,14 +4113,14 @@ static int ext4_do_update_inode(handle_t *handle,
|
|||||||
|
|
||||||
ext4_get_inode_flags(ei);
|
ext4_get_inode_flags(ei);
|
||||||
raw_inode->i_mode = cpu_to_le16(inode->i_mode);
|
raw_inode->i_mode = cpu_to_le16(inode->i_mode);
|
||||||
if(!(test_opt(inode->i_sb, NO_UID32))) {
|
if (!(test_opt(inode->i_sb, NO_UID32))) {
|
||||||
raw_inode->i_uid_low = cpu_to_le16(low_16_bits(inode->i_uid));
|
raw_inode->i_uid_low = cpu_to_le16(low_16_bits(inode->i_uid));
|
||||||
raw_inode->i_gid_low = cpu_to_le16(low_16_bits(inode->i_gid));
|
raw_inode->i_gid_low = cpu_to_le16(low_16_bits(inode->i_gid));
|
||||||
/*
|
/*
|
||||||
* Fix up interoperability with old kernels. Otherwise, old inodes get
|
* Fix up interoperability with old kernels. Otherwise, old inodes get
|
||||||
* re-used with the upper 16 bits of the uid/gid intact
|
* re-used with the upper 16 bits of the uid/gid intact
|
||||||
*/
|
*/
|
||||||
if(!ei->i_dtime) {
|
if (!ei->i_dtime) {
|
||||||
raw_inode->i_uid_high =
|
raw_inode->i_uid_high =
|
||||||
cpu_to_le16(high_16_bits(inode->i_uid));
|
cpu_to_le16(high_16_bits(inode->i_uid));
|
||||||
raw_inode->i_gid_high =
|
raw_inode->i_gid_high =
|
||||||
@ -4208,7 +4208,7 @@ static int ext4_do_update_inode(handle_t *handle,
|
|||||||
ei->i_state &= ~EXT4_STATE_NEW;
|
ei->i_state &= ~EXT4_STATE_NEW;
|
||||||
|
|
||||||
out_brelse:
|
out_brelse:
|
||||||
brelse (bh);
|
brelse(bh);
|
||||||
ext4_std_error(inode->i_sb, err);
|
ext4_std_error(inode->i_sb, err);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
|||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
unsigned short rsv_window_size;
|
unsigned short rsv_window_size;
|
||||||
|
|
||||||
ext4_debug ("cmd = %u, arg = %lu\n", cmd, arg);
|
ext4_debug("cmd = %u, arg = %lu\n", cmd, arg);
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case EXT4_IOC_GETFLAGS:
|
case EXT4_IOC_GETFLAGS:
|
||||||
@ -186,7 +186,7 @@ setversion_out:
|
|||||||
case EXT4_IOC_SETRSVSZ: {
|
case EXT4_IOC_SETRSVSZ: {
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (!test_opt(inode->i_sb, RESERVATION) ||!S_ISREG(inode->i_mode))
|
if (!test_opt(inode->i_sb, RESERVATION) || !S_ISREG(inode->i_mode))
|
||||||
return -ENOTTY;
|
return -ENOTTY;
|
||||||
|
|
||||||
if (!is_owner_or_cap(inode))
|
if (!is_owner_or_cap(inode))
|
||||||
|
302
fs/ext4/namei.c
302
fs/ext4/namei.c
@ -151,26 +151,26 @@ struct dx_map_entry
|
|||||||
|
|
||||||
static inline ext4_lblk_t dx_get_block(struct dx_entry *entry);
|
static inline ext4_lblk_t dx_get_block(struct dx_entry *entry);
|
||||||
static void dx_set_block(struct dx_entry *entry, ext4_lblk_t value);
|
static void dx_set_block(struct dx_entry *entry, ext4_lblk_t value);
|
||||||
static inline unsigned dx_get_hash (struct dx_entry *entry);
|
static inline unsigned dx_get_hash(struct dx_entry *entry);
|
||||||
static void dx_set_hash (struct dx_entry *entry, unsigned value);
|
static void dx_set_hash(struct dx_entry *entry, unsigned value);
|
||||||
static unsigned dx_get_count (struct dx_entry *entries);
|
static unsigned dx_get_count(struct dx_entry *entries);
|
||||||
static unsigned dx_get_limit (struct dx_entry *entries);
|
static unsigned dx_get_limit(struct dx_entry *entries);
|
||||||
static void dx_set_count (struct dx_entry *entries, unsigned value);
|
static void dx_set_count(struct dx_entry *entries, unsigned value);
|
||||||
static void dx_set_limit (struct dx_entry *entries, unsigned value);
|
static void dx_set_limit(struct dx_entry *entries, unsigned value);
|
||||||
static unsigned dx_root_limit (struct inode *dir, unsigned infosize);
|
static unsigned dx_root_limit(struct inode *dir, unsigned infosize);
|
||||||
static unsigned dx_node_limit (struct inode *dir);
|
static unsigned dx_node_limit(struct inode *dir);
|
||||||
static struct dx_frame *dx_probe(struct dentry *dentry,
|
static struct dx_frame *dx_probe(struct dentry *dentry,
|
||||||
struct inode *dir,
|
struct inode *dir,
|
||||||
struct dx_hash_info *hinfo,
|
struct dx_hash_info *hinfo,
|
||||||
struct dx_frame *frame,
|
struct dx_frame *frame,
|
||||||
int *err);
|
int *err);
|
||||||
static void dx_release (struct dx_frame *frames);
|
static void dx_release(struct dx_frame *frames);
|
||||||
static int dx_make_map (struct ext4_dir_entry_2 *de, int size,
|
static int dx_make_map(struct ext4_dir_entry_2 *de, int size,
|
||||||
struct dx_hash_info *hinfo, struct dx_map_entry map[]);
|
struct dx_hash_info *hinfo, struct dx_map_entry map[]);
|
||||||
static void dx_sort_map(struct dx_map_entry *map, unsigned count);
|
static void dx_sort_map(struct dx_map_entry *map, unsigned count);
|
||||||
static struct ext4_dir_entry_2 *dx_move_dirents (char *from, char *to,
|
static struct ext4_dir_entry_2 *dx_move_dirents(char *from, char *to,
|
||||||
struct dx_map_entry *offsets, int count);
|
struct dx_map_entry *offsets, int count);
|
||||||
static struct ext4_dir_entry_2* dx_pack_dirents (char *base, int size);
|
static struct ext4_dir_entry_2* dx_pack_dirents(char *base, int size);
|
||||||
static void dx_insert_block(struct dx_frame *frame,
|
static void dx_insert_block(struct dx_frame *frame,
|
||||||
u32 hash, ext4_lblk_t block);
|
u32 hash, ext4_lblk_t block);
|
||||||
static int ext4_htree_next_block(struct inode *dir, __u32 hash,
|
static int ext4_htree_next_block(struct inode *dir, __u32 hash,
|
||||||
@ -207,44 +207,44 @@ static inline void dx_set_block(struct dx_entry *entry, ext4_lblk_t value)
|
|||||||
entry->block = cpu_to_le32(value);
|
entry->block = cpu_to_le32(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned dx_get_hash (struct dx_entry *entry)
|
static inline unsigned dx_get_hash(struct dx_entry *entry)
|
||||||
{
|
{
|
||||||
return le32_to_cpu(entry->hash);
|
return le32_to_cpu(entry->hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void dx_set_hash (struct dx_entry *entry, unsigned value)
|
static inline void dx_set_hash(struct dx_entry *entry, unsigned value)
|
||||||
{
|
{
|
||||||
entry->hash = cpu_to_le32(value);
|
entry->hash = cpu_to_le32(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned dx_get_count (struct dx_entry *entries)
|
static inline unsigned dx_get_count(struct dx_entry *entries)
|
||||||
{
|
{
|
||||||
return le16_to_cpu(((struct dx_countlimit *) entries)->count);
|
return le16_to_cpu(((struct dx_countlimit *) entries)->count);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned dx_get_limit (struct dx_entry *entries)
|
static inline unsigned dx_get_limit(struct dx_entry *entries)
|
||||||
{
|
{
|
||||||
return le16_to_cpu(((struct dx_countlimit *) entries)->limit);
|
return le16_to_cpu(((struct dx_countlimit *) entries)->limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void dx_set_count (struct dx_entry *entries, unsigned value)
|
static inline void dx_set_count(struct dx_entry *entries, unsigned value)
|
||||||
{
|
{
|
||||||
((struct dx_countlimit *) entries)->count = cpu_to_le16(value);
|
((struct dx_countlimit *) entries)->count = cpu_to_le16(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void dx_set_limit (struct dx_entry *entries, unsigned value)
|
static inline void dx_set_limit(struct dx_entry *entries, unsigned value)
|
||||||
{
|
{
|
||||||
((struct dx_countlimit *) entries)->limit = cpu_to_le16(value);
|
((struct dx_countlimit *) entries)->limit = cpu_to_le16(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned dx_root_limit (struct inode *dir, unsigned infosize)
|
static inline unsigned dx_root_limit(struct inode *dir, unsigned infosize)
|
||||||
{
|
{
|
||||||
unsigned entry_space = dir->i_sb->s_blocksize - EXT4_DIR_REC_LEN(1) -
|
unsigned entry_space = dir->i_sb->s_blocksize - EXT4_DIR_REC_LEN(1) -
|
||||||
EXT4_DIR_REC_LEN(2) - infosize;
|
EXT4_DIR_REC_LEN(2) - infosize;
|
||||||
return entry_space / sizeof(struct dx_entry);
|
return entry_space / sizeof(struct dx_entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned dx_node_limit (struct inode *dir)
|
static inline unsigned dx_node_limit(struct inode *dir)
|
||||||
{
|
{
|
||||||
unsigned entry_space = dir->i_sb->s_blocksize - EXT4_DIR_REC_LEN(0);
|
unsigned entry_space = dir->i_sb->s_blocksize - EXT4_DIR_REC_LEN(0);
|
||||||
return entry_space / sizeof(struct dx_entry);
|
return entry_space / sizeof(struct dx_entry);
|
||||||
@ -306,7 +306,7 @@ struct stats dx_show_entries(struct dx_hash_info *hinfo, struct inode *dir,
|
|||||||
struct dx_entry *entries, int levels)
|
struct dx_entry *entries, int levels)
|
||||||
{
|
{
|
||||||
unsigned blocksize = dir->i_sb->s_blocksize;
|
unsigned blocksize = dir->i_sb->s_blocksize;
|
||||||
unsigned count = dx_get_count (entries), names = 0, space = 0, i;
|
unsigned count = dx_get_count(entries), names = 0, space = 0, i;
|
||||||
unsigned bcount = 0;
|
unsigned bcount = 0;
|
||||||
struct buffer_head *bh;
|
struct buffer_head *bh;
|
||||||
int err;
|
int err;
|
||||||
@ -325,7 +325,7 @@ struct stats dx_show_entries(struct dx_hash_info *hinfo, struct inode *dir,
|
|||||||
names += stats.names;
|
names += stats.names;
|
||||||
space += stats.space;
|
space += stats.space;
|
||||||
bcount += stats.bcount;
|
bcount += stats.bcount;
|
||||||
brelse (bh);
|
brelse(bh);
|
||||||
}
|
}
|
||||||
if (bcount)
|
if (bcount)
|
||||||
printk(KERN_DEBUG "%snames %u, fullness %u (%u%%)\n",
|
printk(KERN_DEBUG "%snames %u, fullness %u (%u%%)\n",
|
||||||
@ -407,7 +407,7 @@ dx_probe(struct dentry *dentry, struct inode *dir,
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
dxtrace (printk("Look up %x", hash));
|
dxtrace(printk("Look up %x", hash));
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
count = dx_get_count(entries);
|
count = dx_get_count(entries);
|
||||||
@ -556,7 +556,7 @@ static int ext4_htree_next_block(struct inode *dir, __u32 hash,
|
|||||||
0, &err)))
|
0, &err)))
|
||||||
return err; /* Failure */
|
return err; /* Failure */
|
||||||
p++;
|
p++;
|
||||||
brelse (p->bh);
|
brelse(p->bh);
|
||||||
p->bh = bh;
|
p->bh = bh;
|
||||||
p->at = p->entries = ((struct dx_node *) bh->b_data)->entries;
|
p->at = p->entries = ((struct dx_node *) bh->b_data)->entries;
|
||||||
}
|
}
|
||||||
@ -594,7 +594,7 @@ static int htree_dirblock_to_tree(struct file *dir_file,
|
|||||||
/* On error, skip the f_pos to the next block. */
|
/* On error, skip the f_pos to the next block. */
|
||||||
dir_file->f_pos = (dir_file->f_pos |
|
dir_file->f_pos = (dir_file->f_pos |
|
||||||
(dir->i_sb->s_blocksize - 1)) + 1;
|
(dir->i_sb->s_blocksize - 1)) + 1;
|
||||||
brelse (bh);
|
brelse(bh);
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
ext4fs_dirhash(de->name, de->name_len, hinfo);
|
ext4fs_dirhash(de->name, de->name_len, hinfo);
|
||||||
@ -803,7 +803,7 @@ static inline int ext4_match (int len, const char * const name,
|
|||||||
/*
|
/*
|
||||||
* Returns 0 if not found, -1 on failure, and 1 on success
|
* Returns 0 if not found, -1 on failure, and 1 on success
|
||||||
*/
|
*/
|
||||||
static inline int search_dirblock(struct buffer_head * bh,
|
static inline int search_dirblock(struct buffer_head *bh,
|
||||||
struct inode *dir,
|
struct inode *dir,
|
||||||
struct dentry *dentry,
|
struct dentry *dentry,
|
||||||
unsigned long offset,
|
unsigned long offset,
|
||||||
@ -855,9 +855,9 @@ static inline int search_dirblock(struct buffer_head * bh,
|
|||||||
static struct buffer_head * ext4_find_entry (struct dentry *dentry,
|
static struct buffer_head * ext4_find_entry (struct dentry *dentry,
|
||||||
struct ext4_dir_entry_2 ** res_dir)
|
struct ext4_dir_entry_2 ** res_dir)
|
||||||
{
|
{
|
||||||
struct super_block * sb;
|
struct super_block *sb;
|
||||||
struct buffer_head * bh_use[NAMEI_RA_SIZE];
|
struct buffer_head *bh_use[NAMEI_RA_SIZE];
|
||||||
struct buffer_head * bh, *ret = NULL;
|
struct buffer_head *bh, *ret = NULL;
|
||||||
ext4_lblk_t start, block, b;
|
ext4_lblk_t start, block, b;
|
||||||
int ra_max = 0; /* Number of bh's in the readahead
|
int ra_max = 0; /* Number of bh's in the readahead
|
||||||
buffer, bh_use[] */
|
buffer, bh_use[] */
|
||||||
@ -958,7 +958,7 @@ restart:
|
|||||||
cleanup_and_exit:
|
cleanup_and_exit:
|
||||||
/* Clean up the read-ahead blocks */
|
/* Clean up the read-ahead blocks */
|
||||||
for (; ra_ptr < ra_max; ra_ptr++)
|
for (; ra_ptr < ra_max; ra_ptr++)
|
||||||
brelse (bh_use[ra_ptr]);
|
brelse(bh_use[ra_ptr]);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1012,7 +1012,7 @@ static struct buffer_head * ext4_dx_find_entry(struct dentry *dentry,
|
|||||||
return bh;
|
return bh;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
brelse (bh);
|
brelse(bh);
|
||||||
/* Check to see if we should continue to search */
|
/* Check to see if we should continue to search */
|
||||||
retval = ext4_htree_next_block(dir, hash, frame,
|
retval = ext4_htree_next_block(dir, hash, frame,
|
||||||
frames, NULL);
|
frames, NULL);
|
||||||
@ -1032,11 +1032,11 @@ errout:
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct dentry *ext4_lookup(struct inode * dir, struct dentry *dentry, struct nameidata *nd)
|
static struct dentry *ext4_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
|
||||||
{
|
{
|
||||||
struct inode * inode;
|
struct inode *inode;
|
||||||
struct ext4_dir_entry_2 * de;
|
struct ext4_dir_entry_2 *de;
|
||||||
struct buffer_head * bh;
|
struct buffer_head *bh;
|
||||||
|
|
||||||
if (dentry->d_name.len > EXT4_NAME_LEN)
|
if (dentry->d_name.len > EXT4_NAME_LEN)
|
||||||
return ERR_PTR(-ENAMETOOLONG);
|
return ERR_PTR(-ENAMETOOLONG);
|
||||||
@ -1045,7 +1045,7 @@ static struct dentry *ext4_lookup(struct inode * dir, struct dentry *dentry, str
|
|||||||
inode = NULL;
|
inode = NULL;
|
||||||
if (bh) {
|
if (bh) {
|
||||||
unsigned long ino = le32_to_cpu(de->inode);
|
unsigned long ino = le32_to_cpu(de->inode);
|
||||||
brelse (bh);
|
brelse(bh);
|
||||||
if (!ext4_valid_inum(dir->i_sb, ino)) {
|
if (!ext4_valid_inum(dir->i_sb, ino)) {
|
||||||
ext4_error(dir->i_sb, "ext4_lookup",
|
ext4_error(dir->i_sb, "ext4_lookup",
|
||||||
"bad inode number: %lu", ino);
|
"bad inode number: %lu", ino);
|
||||||
@ -1203,10 +1203,10 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir,
|
|||||||
|
|
||||||
/* create map in the end of data2 block */
|
/* create map in the end of data2 block */
|
||||||
map = (struct dx_map_entry *) (data2 + blocksize);
|
map = (struct dx_map_entry *) (data2 + blocksize);
|
||||||
count = dx_make_map ((struct ext4_dir_entry_2 *) data1,
|
count = dx_make_map((struct ext4_dir_entry_2 *) data1,
|
||||||
blocksize, hinfo, map);
|
blocksize, hinfo, map);
|
||||||
map -= count;
|
map -= count;
|
||||||
dx_sort_map (map, count);
|
dx_sort_map(map, count);
|
||||||
/* Split the existing block in the middle, size-wise */
|
/* Split the existing block in the middle, size-wise */
|
||||||
size = 0;
|
size = 0;
|
||||||
move = 0;
|
move = 0;
|
||||||
@ -1227,7 +1227,7 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir,
|
|||||||
|
|
||||||
/* Fancy dance to stay within two buffers */
|
/* Fancy dance to stay within two buffers */
|
||||||
de2 = dx_move_dirents(data1, data2, map + split, count - split);
|
de2 = dx_move_dirents(data1, data2, map + split, count - split);
|
||||||
de = dx_pack_dirents(data1,blocksize);
|
de = dx_pack_dirents(data1, blocksize);
|
||||||
de->rec_len = ext4_rec_len_to_disk(data1 + blocksize - (char *) de);
|
de->rec_len = ext4_rec_len_to_disk(data1 + blocksize - (char *) de);
|
||||||
de2->rec_len = ext4_rec_len_to_disk(data2 + blocksize - (char *) de2);
|
de2->rec_len = ext4_rec_len_to_disk(data2 + blocksize - (char *) de2);
|
||||||
dxtrace(dx_show_leaf (hinfo, (struct ext4_dir_entry_2 *) data1, blocksize, 1));
|
dxtrace(dx_show_leaf (hinfo, (struct ext4_dir_entry_2 *) data1, blocksize, 1));
|
||||||
@ -1239,15 +1239,15 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir,
|
|||||||
swap(*bh, bh2);
|
swap(*bh, bh2);
|
||||||
de = de2;
|
de = de2;
|
||||||
}
|
}
|
||||||
dx_insert_block (frame, hash2 + continued, newblock);
|
dx_insert_block(frame, hash2 + continued, newblock);
|
||||||
err = ext4_journal_dirty_metadata (handle, bh2);
|
err = ext4_journal_dirty_metadata(handle, bh2);
|
||||||
if (err)
|
if (err)
|
||||||
goto journal_error;
|
goto journal_error;
|
||||||
err = ext4_journal_dirty_metadata (handle, frame->bh);
|
err = ext4_journal_dirty_metadata(handle, frame->bh);
|
||||||
if (err)
|
if (err)
|
||||||
goto journal_error;
|
goto journal_error;
|
||||||
brelse (bh2);
|
brelse(bh2);
|
||||||
dxtrace(dx_show_index ("frame", frame->entries));
|
dxtrace(dx_show_index("frame", frame->entries));
|
||||||
return de;
|
return de;
|
||||||
|
|
||||||
journal_error:
|
journal_error:
|
||||||
@ -1273,7 +1273,7 @@ errout:
|
|||||||
*/
|
*/
|
||||||
static int add_dirent_to_buf(handle_t *handle, struct dentry *dentry,
|
static int add_dirent_to_buf(handle_t *handle, struct dentry *dentry,
|
||||||
struct inode *inode, struct ext4_dir_entry_2 *de,
|
struct inode *inode, struct ext4_dir_entry_2 *de,
|
||||||
struct buffer_head * bh)
|
struct buffer_head *bh)
|
||||||
{
|
{
|
||||||
struct inode *dir = dentry->d_parent->d_inode;
|
struct inode *dir = dentry->d_parent->d_inode;
|
||||||
const char *name = dentry->d_name.name;
|
const char *name = dentry->d_name.name;
|
||||||
@ -1290,11 +1290,11 @@ static int add_dirent_to_buf(handle_t *handle, struct dentry *dentry,
|
|||||||
while ((char *) de <= top) {
|
while ((char *) de <= top) {
|
||||||
if (!ext4_check_dir_entry("ext4_add_entry", dir, de,
|
if (!ext4_check_dir_entry("ext4_add_entry", dir, de,
|
||||||
bh, offset)) {
|
bh, offset)) {
|
||||||
brelse (bh);
|
brelse(bh);
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
if (ext4_match (namelen, name, de)) {
|
if (ext4_match(namelen, name, de)) {
|
||||||
brelse (bh);
|
brelse(bh);
|
||||||
return -EEXIST;
|
return -EEXIST;
|
||||||
}
|
}
|
||||||
nlen = EXT4_DIR_REC_LEN(de->name_len);
|
nlen = EXT4_DIR_REC_LEN(de->name_len);
|
||||||
@ -1331,7 +1331,7 @@ static int add_dirent_to_buf(handle_t *handle, struct dentry *dentry,
|
|||||||
} else
|
} else
|
||||||
de->inode = 0;
|
de->inode = 0;
|
||||||
de->name_len = namelen;
|
de->name_len = namelen;
|
||||||
memcpy (de->name, name, namelen);
|
memcpy(de->name, name, namelen);
|
||||||
/*
|
/*
|
||||||
* XXX shouldn't update any times until successful
|
* XXX shouldn't update any times until successful
|
||||||
* completion of syscall, but too many callers depend
|
* completion of syscall, but too many callers depend
|
||||||
@ -1388,7 +1388,7 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
|
|||||||
}
|
}
|
||||||
root = (struct dx_root *) bh->b_data;
|
root = (struct dx_root *) bh->b_data;
|
||||||
|
|
||||||
bh2 = ext4_append (handle, dir, &block, &retval);
|
bh2 = ext4_append(handle, dir, &block, &retval);
|
||||||
if (!(bh2)) {
|
if (!(bh2)) {
|
||||||
brelse(bh);
|
brelse(bh);
|
||||||
return retval;
|
return retval;
|
||||||
@ -1414,9 +1414,9 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
|
|||||||
root->info.info_length = sizeof(root->info);
|
root->info.info_length = sizeof(root->info);
|
||||||
root->info.hash_version = EXT4_SB(dir->i_sb)->s_def_hash_version;
|
root->info.hash_version = EXT4_SB(dir->i_sb)->s_def_hash_version;
|
||||||
entries = root->entries;
|
entries = root->entries;
|
||||||
dx_set_block (entries, 1);
|
dx_set_block(entries, 1);
|
||||||
dx_set_count (entries, 1);
|
dx_set_count(entries, 1);
|
||||||
dx_set_limit (entries, dx_root_limit(dir, sizeof(root->info)));
|
dx_set_limit(entries, dx_root_limit(dir, sizeof(root->info)));
|
||||||
|
|
||||||
/* Initialize as for dx_probe */
|
/* Initialize as for dx_probe */
|
||||||
hinfo.hash_version = root->info.hash_version;
|
hinfo.hash_version = root->info.hash_version;
|
||||||
@ -1445,14 +1445,14 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
|
|||||||
* may not sleep between calling this and putting something into
|
* may not sleep between calling this and putting something into
|
||||||
* the entry, as someone else might have used it while you slept.
|
* the entry, as someone else might have used it while you slept.
|
||||||
*/
|
*/
|
||||||
static int ext4_add_entry (handle_t *handle, struct dentry *dentry,
|
static int ext4_add_entry(handle_t *handle, struct dentry *dentry,
|
||||||
struct inode *inode)
|
struct inode *inode)
|
||||||
{
|
{
|
||||||
struct inode *dir = dentry->d_parent->d_inode;
|
struct inode *dir = dentry->d_parent->d_inode;
|
||||||
unsigned long offset;
|
unsigned long offset;
|
||||||
struct buffer_head * bh;
|
struct buffer_head *bh;
|
||||||
struct ext4_dir_entry_2 *de;
|
struct ext4_dir_entry_2 *de;
|
||||||
struct super_block * sb;
|
struct super_block *sb;
|
||||||
int retval;
|
int retval;
|
||||||
int dx_fallback=0;
|
int dx_fallback=0;
|
||||||
unsigned blocksize;
|
unsigned blocksize;
|
||||||
@ -1502,9 +1502,9 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry,
|
|||||||
struct dx_frame frames[2], *frame;
|
struct dx_frame frames[2], *frame;
|
||||||
struct dx_entry *entries, *at;
|
struct dx_entry *entries, *at;
|
||||||
struct dx_hash_info hinfo;
|
struct dx_hash_info hinfo;
|
||||||
struct buffer_head * bh;
|
struct buffer_head *bh;
|
||||||
struct inode *dir = dentry->d_parent->d_inode;
|
struct inode *dir = dentry->d_parent->d_inode;
|
||||||
struct super_block * sb = dir->i_sb;
|
struct super_block *sb = dir->i_sb;
|
||||||
struct ext4_dir_entry_2 *de;
|
struct ext4_dir_entry_2 *de;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
@ -1570,11 +1570,11 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry,
|
|||||||
if (err)
|
if (err)
|
||||||
goto journal_error;
|
goto journal_error;
|
||||||
|
|
||||||
memcpy ((char *) entries2, (char *) (entries + icount1),
|
memcpy((char *) entries2, (char *) (entries + icount1),
|
||||||
icount2 * sizeof(struct dx_entry));
|
icount2 * sizeof(struct dx_entry));
|
||||||
dx_set_count (entries, icount1);
|
dx_set_count(entries, icount1);
|
||||||
dx_set_count (entries2, icount2);
|
dx_set_count(entries2, icount2);
|
||||||
dx_set_limit (entries2, dx_node_limit(dir));
|
dx_set_limit(entries2, dx_node_limit(dir));
|
||||||
|
|
||||||
/* Which index block gets the new entry? */
|
/* Which index block gets the new entry? */
|
||||||
if (at - entries >= icount1) {
|
if (at - entries >= icount1) {
|
||||||
@ -1582,9 +1582,9 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry,
|
|||||||
frame->entries = entries = entries2;
|
frame->entries = entries = entries2;
|
||||||
swap(frame->bh, bh2);
|
swap(frame->bh, bh2);
|
||||||
}
|
}
|
||||||
dx_insert_block (frames + 0, hash2, newblock);
|
dx_insert_block(frames + 0, hash2, newblock);
|
||||||
dxtrace(dx_show_index ("node", frames[1].entries));
|
dxtrace(dx_show_index("node", frames[1].entries));
|
||||||
dxtrace(dx_show_index ("node",
|
dxtrace(dx_show_index("node",
|
||||||
((struct dx_node *) bh2->b_data)->entries));
|
((struct dx_node *) bh2->b_data)->entries));
|
||||||
err = ext4_journal_dirty_metadata(handle, bh2);
|
err = ext4_journal_dirty_metadata(handle, bh2);
|
||||||
if (err)
|
if (err)
|
||||||
@ -1634,12 +1634,12 @@ cleanup:
|
|||||||
* ext4_delete_entry deletes a directory entry by merging it with the
|
* ext4_delete_entry deletes a directory entry by merging it with the
|
||||||
* previous entry
|
* previous entry
|
||||||
*/
|
*/
|
||||||
static int ext4_delete_entry (handle_t *handle,
|
static int ext4_delete_entry(handle_t *handle,
|
||||||
struct inode * dir,
|
struct inode *dir,
|
||||||
struct ext4_dir_entry_2 * de_del,
|
struct ext4_dir_entry_2 *de_del,
|
||||||
struct buffer_head * bh)
|
struct buffer_head *bh)
|
||||||
{
|
{
|
||||||
struct ext4_dir_entry_2 * de, * pde;
|
struct ext4_dir_entry_2 *de, *pde;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
@ -1720,11 +1720,11 @@ static int ext4_add_nondir(handle_t *handle,
|
|||||||
* If the create succeeds, we fill in the inode information
|
* If the create succeeds, we fill in the inode information
|
||||||
* with d_instantiate().
|
* with d_instantiate().
|
||||||
*/
|
*/
|
||||||
static int ext4_create (struct inode * dir, struct dentry * dentry, int mode,
|
static int ext4_create(struct inode *dir, struct dentry *dentry, int mode,
|
||||||
struct nameidata *nd)
|
struct nameidata *nd)
|
||||||
{
|
{
|
||||||
handle_t *handle;
|
handle_t *handle;
|
||||||
struct inode * inode;
|
struct inode *inode;
|
||||||
int err, retries = 0;
|
int err, retries = 0;
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
@ -1751,8 +1751,8 @@ retry:
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ext4_mknod (struct inode * dir, struct dentry *dentry,
|
static int ext4_mknod(struct inode *dir, struct dentry *dentry,
|
||||||
int mode, dev_t rdev)
|
int mode, dev_t rdev)
|
||||||
{
|
{
|
||||||
handle_t *handle;
|
handle_t *handle;
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
@ -1771,7 +1771,7 @@ retry:
|
|||||||
if (IS_DIRSYNC(dir))
|
if (IS_DIRSYNC(dir))
|
||||||
handle->h_sync = 1;
|
handle->h_sync = 1;
|
||||||
|
|
||||||
inode = ext4_new_inode (handle, dir, mode);
|
inode = ext4_new_inode(handle, dir, mode);
|
||||||
err = PTR_ERR(inode);
|
err = PTR_ERR(inode);
|
||||||
if (!IS_ERR(inode)) {
|
if (!IS_ERR(inode)) {
|
||||||
init_special_inode(inode, inode->i_mode, rdev);
|
init_special_inode(inode, inode->i_mode, rdev);
|
||||||
@ -1786,12 +1786,12 @@ retry:
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ext4_mkdir(struct inode * dir, struct dentry * dentry, int mode)
|
static int ext4_mkdir(struct inode *dir, struct dentry *dentry, int mode)
|
||||||
{
|
{
|
||||||
handle_t *handle;
|
handle_t *handle;
|
||||||
struct inode * inode;
|
struct inode *inode;
|
||||||
struct buffer_head * dir_block;
|
struct buffer_head *dir_block;
|
||||||
struct ext4_dir_entry_2 * de;
|
struct ext4_dir_entry_2 *de;
|
||||||
int err, retries = 0;
|
int err, retries = 0;
|
||||||
|
|
||||||
if (EXT4_DIR_LINK_MAX(dir))
|
if (EXT4_DIR_LINK_MAX(dir))
|
||||||
@ -1807,7 +1807,7 @@ retry:
|
|||||||
if (IS_DIRSYNC(dir))
|
if (IS_DIRSYNC(dir))
|
||||||
handle->h_sync = 1;
|
handle->h_sync = 1;
|
||||||
|
|
||||||
inode = ext4_new_inode (handle, dir, S_IFDIR | mode);
|
inode = ext4_new_inode(handle, dir, S_IFDIR | mode);
|
||||||
err = PTR_ERR(inode);
|
err = PTR_ERR(inode);
|
||||||
if (IS_ERR(inode))
|
if (IS_ERR(inode))
|
||||||
goto out_stop;
|
goto out_stop;
|
||||||
@ -1815,7 +1815,7 @@ retry:
|
|||||||
inode->i_op = &ext4_dir_inode_operations;
|
inode->i_op = &ext4_dir_inode_operations;
|
||||||
inode->i_fop = &ext4_dir_operations;
|
inode->i_fop = &ext4_dir_operations;
|
||||||
inode->i_size = EXT4_I(inode)->i_disksize = inode->i_sb->s_blocksize;
|
inode->i_size = EXT4_I(inode)->i_disksize = inode->i_sb->s_blocksize;
|
||||||
dir_block = ext4_bread (handle, inode, 0, 1, &err);
|
dir_block = ext4_bread(handle, inode, 0, 1, &err);
|
||||||
if (!dir_block)
|
if (!dir_block)
|
||||||
goto out_clear_inode;
|
goto out_clear_inode;
|
||||||
BUFFER_TRACE(dir_block, "get_write_access");
|
BUFFER_TRACE(dir_block, "get_write_access");
|
||||||
@ -1824,26 +1824,26 @@ retry:
|
|||||||
de->inode = cpu_to_le32(inode->i_ino);
|
de->inode = cpu_to_le32(inode->i_ino);
|
||||||
de->name_len = 1;
|
de->name_len = 1;
|
||||||
de->rec_len = ext4_rec_len_to_disk(EXT4_DIR_REC_LEN(de->name_len));
|
de->rec_len = ext4_rec_len_to_disk(EXT4_DIR_REC_LEN(de->name_len));
|
||||||
strcpy (de->name, ".");
|
strcpy(de->name, ".");
|
||||||
ext4_set_de_type(dir->i_sb, de, S_IFDIR);
|
ext4_set_de_type(dir->i_sb, de, S_IFDIR);
|
||||||
de = ext4_next_entry(de);
|
de = ext4_next_entry(de);
|
||||||
de->inode = cpu_to_le32(dir->i_ino);
|
de->inode = cpu_to_le32(dir->i_ino);
|
||||||
de->rec_len = ext4_rec_len_to_disk(inode->i_sb->s_blocksize -
|
de->rec_len = ext4_rec_len_to_disk(inode->i_sb->s_blocksize -
|
||||||
EXT4_DIR_REC_LEN(1));
|
EXT4_DIR_REC_LEN(1));
|
||||||
de->name_len = 2;
|
de->name_len = 2;
|
||||||
strcpy (de->name, "..");
|
strcpy(de->name, "..");
|
||||||
ext4_set_de_type(dir->i_sb, de, S_IFDIR);
|
ext4_set_de_type(dir->i_sb, de, S_IFDIR);
|
||||||
inode->i_nlink = 2;
|
inode->i_nlink = 2;
|
||||||
BUFFER_TRACE(dir_block, "call ext4_journal_dirty_metadata");
|
BUFFER_TRACE(dir_block, "call ext4_journal_dirty_metadata");
|
||||||
ext4_journal_dirty_metadata(handle, dir_block);
|
ext4_journal_dirty_metadata(handle, dir_block);
|
||||||
brelse (dir_block);
|
brelse(dir_block);
|
||||||
ext4_mark_inode_dirty(handle, inode);
|
ext4_mark_inode_dirty(handle, inode);
|
||||||
err = ext4_add_entry (handle, dentry, inode);
|
err = ext4_add_entry(handle, dentry, inode);
|
||||||
if (err) {
|
if (err) {
|
||||||
out_clear_inode:
|
out_clear_inode:
|
||||||
clear_nlink(inode);
|
clear_nlink(inode);
|
||||||
ext4_mark_inode_dirty(handle, inode);
|
ext4_mark_inode_dirty(handle, inode);
|
||||||
iput (inode);
|
iput(inode);
|
||||||
goto out_stop;
|
goto out_stop;
|
||||||
}
|
}
|
||||||
ext4_inc_count(handle, dir);
|
ext4_inc_count(handle, dir);
|
||||||
@ -1860,17 +1860,17 @@ out_stop:
|
|||||||
/*
|
/*
|
||||||
* routine to check that the specified directory is empty (for rmdir)
|
* routine to check that the specified directory is empty (for rmdir)
|
||||||
*/
|
*/
|
||||||
static int empty_dir (struct inode * inode)
|
static int empty_dir(struct inode *inode)
|
||||||
{
|
{
|
||||||
unsigned long offset;
|
unsigned long offset;
|
||||||
struct buffer_head * bh;
|
struct buffer_head *bh;
|
||||||
struct ext4_dir_entry_2 * de, * de1;
|
struct ext4_dir_entry_2 *de, *de1;
|
||||||
struct super_block * sb;
|
struct super_block *sb;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
sb = inode->i_sb;
|
sb = inode->i_sb;
|
||||||
if (inode->i_size < EXT4_DIR_REC_LEN(1) + EXT4_DIR_REC_LEN(2) ||
|
if (inode->i_size < EXT4_DIR_REC_LEN(1) + EXT4_DIR_REC_LEN(2) ||
|
||||||
!(bh = ext4_bread (NULL, inode, 0, 0, &err))) {
|
!(bh = ext4_bread(NULL, inode, 0, 0, &err))) {
|
||||||
if (err)
|
if (err)
|
||||||
ext4_error(inode->i_sb, __func__,
|
ext4_error(inode->i_sb, __func__,
|
||||||
"error %d reading directory #%lu offset 0",
|
"error %d reading directory #%lu offset 0",
|
||||||
@ -1885,23 +1885,23 @@ static int empty_dir (struct inode * inode)
|
|||||||
de1 = ext4_next_entry(de);
|
de1 = ext4_next_entry(de);
|
||||||
if (le32_to_cpu(de->inode) != inode->i_ino ||
|
if (le32_to_cpu(de->inode) != inode->i_ino ||
|
||||||
!le32_to_cpu(de1->inode) ||
|
!le32_to_cpu(de1->inode) ||
|
||||||
strcmp (".", de->name) ||
|
strcmp(".", de->name) ||
|
||||||
strcmp ("..", de1->name)) {
|
strcmp("..", de1->name)) {
|
||||||
ext4_warning (inode->i_sb, "empty_dir",
|
ext4_warning(inode->i_sb, "empty_dir",
|
||||||
"bad directory (dir #%lu) - no `.' or `..'",
|
"bad directory (dir #%lu) - no `.' or `..'",
|
||||||
inode->i_ino);
|
inode->i_ino);
|
||||||
brelse (bh);
|
brelse(bh);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
offset = ext4_rec_len_from_disk(de->rec_len) +
|
offset = ext4_rec_len_from_disk(de->rec_len) +
|
||||||
ext4_rec_len_from_disk(de1->rec_len);
|
ext4_rec_len_from_disk(de1->rec_len);
|
||||||
de = ext4_next_entry(de1);
|
de = ext4_next_entry(de1);
|
||||||
while (offset < inode->i_size ) {
|
while (offset < inode->i_size) {
|
||||||
if (!bh ||
|
if (!bh ||
|
||||||
(void *) de >= (void *) (bh->b_data+sb->s_blocksize)) {
|
(void *) de >= (void *) (bh->b_data+sb->s_blocksize)) {
|
||||||
err = 0;
|
err = 0;
|
||||||
brelse (bh);
|
brelse(bh);
|
||||||
bh = ext4_bread (NULL, inode,
|
bh = ext4_bread(NULL, inode,
|
||||||
offset >> EXT4_BLOCK_SIZE_BITS(sb), 0, &err);
|
offset >> EXT4_BLOCK_SIZE_BITS(sb), 0, &err);
|
||||||
if (!bh) {
|
if (!bh) {
|
||||||
if (err)
|
if (err)
|
||||||
@ -1921,13 +1921,13 @@ static int empty_dir (struct inode * inode)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (le32_to_cpu(de->inode)) {
|
if (le32_to_cpu(de->inode)) {
|
||||||
brelse (bh);
|
brelse(bh);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
offset += ext4_rec_len_from_disk(de->rec_len);
|
offset += ext4_rec_len_from_disk(de->rec_len);
|
||||||
de = ext4_next_entry(de);
|
de = ext4_next_entry(de);
|
||||||
}
|
}
|
||||||
brelse (bh);
|
brelse(bh);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1958,8 +1958,8 @@ int ext4_orphan_add(handle_t *handle, struct inode *inode)
|
|||||||
* ->i_nlink. For, say it, character device. Not a regular file,
|
* ->i_nlink. For, say it, character device. Not a regular file,
|
||||||
* not a directory, not a symlink and ->i_nlink > 0.
|
* not a directory, not a symlink and ->i_nlink > 0.
|
||||||
*/
|
*/
|
||||||
J_ASSERT ((S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
|
J_ASSERT((S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
|
||||||
S_ISLNK(inode->i_mode)) || inode->i_nlink == 0);
|
S_ISLNK(inode->i_mode)) || inode->i_nlink == 0);
|
||||||
|
|
||||||
BUFFER_TRACE(EXT4_SB(sb)->s_sbh, "get_write_access");
|
BUFFER_TRACE(EXT4_SB(sb)->s_sbh, "get_write_access");
|
||||||
err = ext4_journal_get_write_access(handle, EXT4_SB(sb)->s_sbh);
|
err = ext4_journal_get_write_access(handle, EXT4_SB(sb)->s_sbh);
|
||||||
@ -2073,12 +2073,12 @@ out_brelse:
|
|||||||
goto out_err;
|
goto out_err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ext4_rmdir (struct inode * dir, struct dentry *dentry)
|
static int ext4_rmdir(struct inode *dir, struct dentry *dentry)
|
||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
struct inode * inode;
|
struct inode *inode;
|
||||||
struct buffer_head * bh;
|
struct buffer_head *bh;
|
||||||
struct ext4_dir_entry_2 * de;
|
struct ext4_dir_entry_2 *de;
|
||||||
handle_t *handle;
|
handle_t *handle;
|
||||||
|
|
||||||
/* Initialize quotas before so that eventual writes go in
|
/* Initialize quotas before so that eventual writes go in
|
||||||
@ -2089,7 +2089,7 @@ static int ext4_rmdir (struct inode * dir, struct dentry *dentry)
|
|||||||
return PTR_ERR(handle);
|
return PTR_ERR(handle);
|
||||||
|
|
||||||
retval = -ENOENT;
|
retval = -ENOENT;
|
||||||
bh = ext4_find_entry (dentry, &de);
|
bh = ext4_find_entry(dentry, &de);
|
||||||
if (!bh)
|
if (!bh)
|
||||||
goto end_rmdir;
|
goto end_rmdir;
|
||||||
|
|
||||||
@ -2103,16 +2103,16 @@ static int ext4_rmdir (struct inode * dir, struct dentry *dentry)
|
|||||||
goto end_rmdir;
|
goto end_rmdir;
|
||||||
|
|
||||||
retval = -ENOTEMPTY;
|
retval = -ENOTEMPTY;
|
||||||
if (!empty_dir (inode))
|
if (!empty_dir(inode))
|
||||||
goto end_rmdir;
|
goto end_rmdir;
|
||||||
|
|
||||||
retval = ext4_delete_entry(handle, dir, de, bh);
|
retval = ext4_delete_entry(handle, dir, de, bh);
|
||||||
if (retval)
|
if (retval)
|
||||||
goto end_rmdir;
|
goto end_rmdir;
|
||||||
if (!EXT4_DIR_LINK_EMPTY(inode))
|
if (!EXT4_DIR_LINK_EMPTY(inode))
|
||||||
ext4_warning (inode->i_sb, "ext4_rmdir",
|
ext4_warning(inode->i_sb, "ext4_rmdir",
|
||||||
"empty directory has too many links (%d)",
|
"empty directory has too many links (%d)",
|
||||||
inode->i_nlink);
|
inode->i_nlink);
|
||||||
inode->i_version++;
|
inode->i_version++;
|
||||||
clear_nlink(inode);
|
clear_nlink(inode);
|
||||||
/* There's no need to set i_disksize: the fact that i_nlink is
|
/* There's no need to set i_disksize: the fact that i_nlink is
|
||||||
@ -2128,16 +2128,16 @@ static int ext4_rmdir (struct inode * dir, struct dentry *dentry)
|
|||||||
|
|
||||||
end_rmdir:
|
end_rmdir:
|
||||||
ext4_journal_stop(handle);
|
ext4_journal_stop(handle);
|
||||||
brelse (bh);
|
brelse(bh);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ext4_unlink(struct inode * dir, struct dentry *dentry)
|
static int ext4_unlink(struct inode *dir, struct dentry *dentry)
|
||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
struct inode * inode;
|
struct inode *inode;
|
||||||
struct buffer_head * bh;
|
struct buffer_head *bh;
|
||||||
struct ext4_dir_entry_2 * de;
|
struct ext4_dir_entry_2 *de;
|
||||||
handle_t *handle;
|
handle_t *handle;
|
||||||
|
|
||||||
/* Initialize quotas before so that eventual writes go
|
/* Initialize quotas before so that eventual writes go
|
||||||
@ -2151,7 +2151,7 @@ static int ext4_unlink(struct inode * dir, struct dentry *dentry)
|
|||||||
handle->h_sync = 1;
|
handle->h_sync = 1;
|
||||||
|
|
||||||
retval = -ENOENT;
|
retval = -ENOENT;
|
||||||
bh = ext4_find_entry (dentry, &de);
|
bh = ext4_find_entry(dentry, &de);
|
||||||
if (!bh)
|
if (!bh)
|
||||||
goto end_unlink;
|
goto end_unlink;
|
||||||
|
|
||||||
@ -2162,9 +2162,9 @@ static int ext4_unlink(struct inode * dir, struct dentry *dentry)
|
|||||||
goto end_unlink;
|
goto end_unlink;
|
||||||
|
|
||||||
if (!inode->i_nlink) {
|
if (!inode->i_nlink) {
|
||||||
ext4_warning (inode->i_sb, "ext4_unlink",
|
ext4_warning(inode->i_sb, "ext4_unlink",
|
||||||
"Deleting nonexistent file (%lu), %d",
|
"Deleting nonexistent file (%lu), %d",
|
||||||
inode->i_ino, inode->i_nlink);
|
inode->i_ino, inode->i_nlink);
|
||||||
inode->i_nlink = 1;
|
inode->i_nlink = 1;
|
||||||
}
|
}
|
||||||
retval = ext4_delete_entry(handle, dir, de, bh);
|
retval = ext4_delete_entry(handle, dir, de, bh);
|
||||||
@ -2182,15 +2182,15 @@ static int ext4_unlink(struct inode * dir, struct dentry *dentry)
|
|||||||
|
|
||||||
end_unlink:
|
end_unlink:
|
||||||
ext4_journal_stop(handle);
|
ext4_journal_stop(handle);
|
||||||
brelse (bh);
|
brelse(bh);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ext4_symlink (struct inode * dir,
|
static int ext4_symlink(struct inode *dir,
|
||||||
struct dentry *dentry, const char * symname)
|
struct dentry *dentry, const char *symname)
|
||||||
{
|
{
|
||||||
handle_t *handle;
|
handle_t *handle;
|
||||||
struct inode * inode;
|
struct inode *inode;
|
||||||
int l, err, retries = 0;
|
int l, err, retries = 0;
|
||||||
|
|
||||||
l = strlen(symname)+1;
|
l = strlen(symname)+1;
|
||||||
@ -2207,12 +2207,12 @@ retry:
|
|||||||
if (IS_DIRSYNC(dir))
|
if (IS_DIRSYNC(dir))
|
||||||
handle->h_sync = 1;
|
handle->h_sync = 1;
|
||||||
|
|
||||||
inode = ext4_new_inode (handle, dir, S_IFLNK|S_IRWXUGO);
|
inode = ext4_new_inode(handle, dir, S_IFLNK|S_IRWXUGO);
|
||||||
err = PTR_ERR(inode);
|
err = PTR_ERR(inode);
|
||||||
if (IS_ERR(inode))
|
if (IS_ERR(inode))
|
||||||
goto out_stop;
|
goto out_stop;
|
||||||
|
|
||||||
if (l > sizeof (EXT4_I(inode)->i_data)) {
|
if (l > sizeof(EXT4_I(inode)->i_data)) {
|
||||||
inode->i_op = &ext4_symlink_inode_operations;
|
inode->i_op = &ext4_symlink_inode_operations;
|
||||||
ext4_set_aops(inode);
|
ext4_set_aops(inode);
|
||||||
/*
|
/*
|
||||||
@ -2225,14 +2225,14 @@ retry:
|
|||||||
if (err) {
|
if (err) {
|
||||||
clear_nlink(inode);
|
clear_nlink(inode);
|
||||||
ext4_mark_inode_dirty(handle, inode);
|
ext4_mark_inode_dirty(handle, inode);
|
||||||
iput (inode);
|
iput(inode);
|
||||||
goto out_stop;
|
goto out_stop;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* clear the extent format for fast symlink */
|
/* clear the extent format for fast symlink */
|
||||||
EXT4_I(inode)->i_flags &= ~EXT4_EXTENTS_FL;
|
EXT4_I(inode)->i_flags &= ~EXT4_EXTENTS_FL;
|
||||||
inode->i_op = &ext4_fast_symlink_inode_operations;
|
inode->i_op = &ext4_fast_symlink_inode_operations;
|
||||||
memcpy((char*)&EXT4_I(inode)->i_data,symname,l);
|
memcpy((char *)&EXT4_I(inode)->i_data, symname, l);
|
||||||
inode->i_size = l-1;
|
inode->i_size = l-1;
|
||||||
}
|
}
|
||||||
EXT4_I(inode)->i_disksize = inode->i_size;
|
EXT4_I(inode)->i_disksize = inode->i_size;
|
||||||
@ -2244,8 +2244,8 @@ out_stop:
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ext4_link (struct dentry * old_dentry,
|
static int ext4_link(struct dentry *old_dentry,
|
||||||
struct inode * dir, struct dentry *dentry)
|
struct inode *dir, struct dentry *dentry)
|
||||||
{
|
{
|
||||||
handle_t *handle;
|
handle_t *handle;
|
||||||
struct inode *inode = old_dentry->d_inode;
|
struct inode *inode = old_dentry->d_inode;
|
||||||
@ -2288,13 +2288,13 @@ retry:
|
|||||||
* Anybody can rename anything with this: the permission checks are left to the
|
* Anybody can rename anything with this: the permission checks are left to the
|
||||||
* higher-level routines.
|
* higher-level routines.
|
||||||
*/
|
*/
|
||||||
static int ext4_rename (struct inode * old_dir, struct dentry *old_dentry,
|
static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||||
struct inode * new_dir,struct dentry *new_dentry)
|
struct inode *new_dir, struct dentry *new_dentry)
|
||||||
{
|
{
|
||||||
handle_t *handle;
|
handle_t *handle;
|
||||||
struct inode * old_inode, * new_inode;
|
struct inode *old_inode, *new_inode;
|
||||||
struct buffer_head * old_bh, * new_bh, * dir_bh;
|
struct buffer_head *old_bh, *new_bh, *dir_bh;
|
||||||
struct ext4_dir_entry_2 * old_de, * new_de;
|
struct ext4_dir_entry_2 *old_de, *new_de;
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
old_bh = new_bh = dir_bh = NULL;
|
old_bh = new_bh = dir_bh = NULL;
|
||||||
@ -2312,7 +2312,7 @@ static int ext4_rename (struct inode * old_dir, struct dentry *old_dentry,
|
|||||||
if (IS_DIRSYNC(old_dir) || IS_DIRSYNC(new_dir))
|
if (IS_DIRSYNC(old_dir) || IS_DIRSYNC(new_dir))
|
||||||
handle->h_sync = 1;
|
handle->h_sync = 1;
|
||||||
|
|
||||||
old_bh = ext4_find_entry (old_dentry, &old_de);
|
old_bh = ext4_find_entry(old_dentry, &old_de);
|
||||||
/*
|
/*
|
||||||
* Check for inode number is _not_ due to possible IO errors.
|
* Check for inode number is _not_ due to possible IO errors.
|
||||||
* We might rmdir the source, keep it as pwd of some process
|
* We might rmdir the source, keep it as pwd of some process
|
||||||
@ -2325,32 +2325,32 @@ static int ext4_rename (struct inode * old_dir, struct dentry *old_dentry,
|
|||||||
goto end_rename;
|
goto end_rename;
|
||||||
|
|
||||||
new_inode = new_dentry->d_inode;
|
new_inode = new_dentry->d_inode;
|
||||||
new_bh = ext4_find_entry (new_dentry, &new_de);
|
new_bh = ext4_find_entry(new_dentry, &new_de);
|
||||||
if (new_bh) {
|
if (new_bh) {
|
||||||
if (!new_inode) {
|
if (!new_inode) {
|
||||||
brelse (new_bh);
|
brelse(new_bh);
|
||||||
new_bh = NULL;
|
new_bh = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (S_ISDIR(old_inode->i_mode)) {
|
if (S_ISDIR(old_inode->i_mode)) {
|
||||||
if (new_inode) {
|
if (new_inode) {
|
||||||
retval = -ENOTEMPTY;
|
retval = -ENOTEMPTY;
|
||||||
if (!empty_dir (new_inode))
|
if (!empty_dir(new_inode))
|
||||||
goto end_rename;
|
goto end_rename;
|
||||||
}
|
}
|
||||||
retval = -EIO;
|
retval = -EIO;
|
||||||
dir_bh = ext4_bread (handle, old_inode, 0, 0, &retval);
|
dir_bh = ext4_bread(handle, old_inode, 0, 0, &retval);
|
||||||
if (!dir_bh)
|
if (!dir_bh)
|
||||||
goto end_rename;
|
goto end_rename;
|
||||||
if (le32_to_cpu(PARENT_INO(dir_bh->b_data)) != old_dir->i_ino)
|
if (le32_to_cpu(PARENT_INO(dir_bh->b_data)) != old_dir->i_ino)
|
||||||
goto end_rename;
|
goto end_rename;
|
||||||
retval = -EMLINK;
|
retval = -EMLINK;
|
||||||
if (!new_inode && new_dir!=old_dir &&
|
if (!new_inode && new_dir != old_dir &&
|
||||||
new_dir->i_nlink >= EXT4_LINK_MAX)
|
new_dir->i_nlink >= EXT4_LINK_MAX)
|
||||||
goto end_rename;
|
goto end_rename;
|
||||||
}
|
}
|
||||||
if (!new_bh) {
|
if (!new_bh) {
|
||||||
retval = ext4_add_entry (handle, new_dentry, old_inode);
|
retval = ext4_add_entry(handle, new_dentry, old_inode);
|
||||||
if (retval)
|
if (retval)
|
||||||
goto end_rename;
|
goto end_rename;
|
||||||
} else {
|
} else {
|
||||||
@ -2437,9 +2437,9 @@ static int ext4_rename (struct inode * old_dir, struct dentry *old_dentry,
|
|||||||
retval = 0;
|
retval = 0;
|
||||||
|
|
||||||
end_rename:
|
end_rename:
|
||||||
brelse (dir_bh);
|
brelse(dir_bh);
|
||||||
brelse (old_bh);
|
brelse(old_bh);
|
||||||
brelse (new_bh);
|
brelse(new_bh);
|
||||||
ext4_journal_stop(handle);
|
ext4_journal_stop(handle);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
@ -416,8 +416,8 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
|
|||||||
"EXT4-fs: ext4_add_new_gdb: adding group block %lu\n",
|
"EXT4-fs: ext4_add_new_gdb: adding group block %lu\n",
|
||||||
gdb_num);
|
gdb_num);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we are not using the primary superblock/GDT copy don't resize,
|
* If we are not using the primary superblock/GDT copy don't resize,
|
||||||
* because the user tools have no way of handling this. Probably a
|
* because the user tools have no way of handling this. Probably a
|
||||||
* bad time to do it anyways.
|
* bad time to do it anyways.
|
||||||
*/
|
*/
|
||||||
@ -964,7 +964,7 @@ int ext4_group_extend(struct super_block *sb, struct ext4_super_block *es,
|
|||||||
ext4_group_t o_groups_count;
|
ext4_group_t o_groups_count;
|
||||||
ext4_grpblk_t last;
|
ext4_grpblk_t last;
|
||||||
ext4_grpblk_t add;
|
ext4_grpblk_t add;
|
||||||
struct buffer_head * bh;
|
struct buffer_head *bh;
|
||||||
handle_t *handle;
|
handle_t *handle;
|
||||||
int err;
|
int err;
|
||||||
unsigned long freed_blocks;
|
unsigned long freed_blocks;
|
||||||
|
@ -654,7 +654,7 @@ static inline void ext4_show_quota_options(struct seq_file *seq,
|
|||||||
|
|
||||||
if (sbi->s_jquota_fmt)
|
if (sbi->s_jquota_fmt)
|
||||||
seq_printf(seq, ",jqfmt=%s",
|
seq_printf(seq, ",jqfmt=%s",
|
||||||
(sbi->s_jquota_fmt == QFMT_VFS_OLD) ? "vfsold": "vfsv0");
|
(sbi->s_jquota_fmt == QFMT_VFS_OLD) ? "vfsold" : "vfsv0");
|
||||||
|
|
||||||
if (sbi->s_qf_names[USRQUOTA])
|
if (sbi->s_qf_names[USRQUOTA])
|
||||||
seq_printf(seq, ",usrjquota=%s", sbi->s_qf_names[USRQUOTA]);
|
seq_printf(seq, ",usrjquota=%s", sbi->s_qf_names[USRQUOTA]);
|
||||||
@ -822,7 +822,7 @@ static struct dentry *ext4_fh_to_parent(struct super_block *sb, struct fid *fid,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_QUOTA
|
#ifdef CONFIG_QUOTA
|
||||||
#define QTYPE2NAME(t) ((t) == USRQUOTA?"user":"group")
|
#define QTYPE2NAME(t) ((t) == USRQUOTA ? "user" : "group")
|
||||||
#define QTYPE2MOPT(on, t) ((t) == USRQUOTA?((on)##USRJQUOTA):((on)##GRPJQUOTA))
|
#define QTYPE2MOPT(on, t) ((t) == USRQUOTA?((on)##USRJQUOTA):((on)##GRPJQUOTA))
|
||||||
|
|
||||||
static int ext4_dquot_initialize(struct inode *inode, int type);
|
static int ext4_dquot_initialize(struct inode *inode, int type);
|
||||||
@ -1586,7 +1586,7 @@ static int ext4_check_descriptors(struct super_block *sb)
|
|||||||
if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_FLEX_BG))
|
if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_FLEX_BG))
|
||||||
flexbg_flag = 1;
|
flexbg_flag = 1;
|
||||||
|
|
||||||
ext4_debug ("Checking group descriptors");
|
ext4_debug("Checking group descriptors");
|
||||||
|
|
||||||
for (i = 0; i < sbi->s_groups_count; i++) {
|
for (i = 0; i < sbi->s_groups_count; i++) {
|
||||||
struct ext4_group_desc *gdp = ext4_get_group_desc(sb, i, NULL);
|
struct ext4_group_desc *gdp = ext4_get_group_desc(sb, i, NULL);
|
||||||
|
@ -23,10 +23,10 @@
|
|||||||
#include "ext4.h"
|
#include "ext4.h"
|
||||||
#include "xattr.h"
|
#include "xattr.h"
|
||||||
|
|
||||||
static void * ext4_follow_link(struct dentry *dentry, struct nameidata *nd)
|
static void *ext4_follow_link(struct dentry *dentry, struct nameidata *nd)
|
||||||
{
|
{
|
||||||
struct ext4_inode_info *ei = EXT4_I(dentry->d_inode);
|
struct ext4_inode_info *ei = EXT4_I(dentry->d_inode);
|
||||||
nd_set_link(nd, (char*)ei->i_data);
|
nd_set_link(nd, (char *) ei->i_data);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,8 +51,8 @@ struct ext4_xattr_entry {
|
|||||||
(((name_len) + EXT4_XATTR_ROUND + \
|
(((name_len) + EXT4_XATTR_ROUND + \
|
||||||
sizeof(struct ext4_xattr_entry)) & ~EXT4_XATTR_ROUND)
|
sizeof(struct ext4_xattr_entry)) & ~EXT4_XATTR_ROUND)
|
||||||
#define EXT4_XATTR_NEXT(entry) \
|
#define EXT4_XATTR_NEXT(entry) \
|
||||||
( (struct ext4_xattr_entry *)( \
|
((struct ext4_xattr_entry *)( \
|
||||||
(char *)(entry) + EXT4_XATTR_LEN((entry)->e_name_len)) )
|
(char *)(entry) + EXT4_XATTR_LEN((entry)->e_name_len)))
|
||||||
#define EXT4_XATTR_SIZE(size) \
|
#define EXT4_XATTR_SIZE(size) \
|
||||||
(((size) + EXT4_XATTR_ROUND) & ~EXT4_XATTR_ROUND)
|
(((size) + EXT4_XATTR_ROUND) & ~EXT4_XATTR_ROUND)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user