Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 757
b: refs/heads/master
c: 3e8962b
h: refs/heads/master
i:
  755: b5b4773
v: v3
  • Loading branch information
Al Viro authored and Linus Torvalds committed May 1, 2005
1 parent 459d94d commit 21b748d
Show file tree
Hide file tree
Showing 13 changed files with 139 additions and 131 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6a3a16f2ef6f335286e2b2bf8284b0ab4ff38ec0
refs/heads/master: 3e8962be915bacc1d70e4849a075041838d60a3f
7 changes: 4 additions & 3 deletions trunk/fs/reiserfs/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,9 @@ static inline int block_group_used(struct super_block *s, u32 id) {
/*
* the packing is returned in disk byte order
*/
u32 reiserfs_choose_packing(struct inode *dir) {
u32 packing;
__le32 reiserfs_choose_packing(struct inode *dir)
{
__le32 packing;
if (TEST_OPTION(packing_groups, dir->i_sb)) {
u32 parent_dir = le32_to_cpu(INODE_PKEY(dir)->k_dir_id);
/*
Expand Down Expand Up @@ -655,7 +656,7 @@ static int get_left_neighbor(reiserfs_blocknr_hint_t *hint)
struct buffer_head * bh;
struct item_head * ih;
int pos_in_item;
__u32 * item;
__le32 * item;
int ret = 0;

if (!hint->path) /* reiserfs code can call this function w/o pointer to path
Expand Down
8 changes: 4 additions & 4 deletions trunk/fs/reiserfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ static int reiserfs_readdir (struct file * filp, void * dirent, filldir_t filldi
/* compose directory item containing "." and ".." entries (entries are
not aligned to 4 byte boundary) */
/* the last four params are LE */
void make_empty_dir_item_v1 (char * body, __u32 dirid, __u32 objid,
__u32 par_dirid, __u32 par_objid)
void make_empty_dir_item_v1 (char * body, __le32 dirid, __le32 objid,
__le32 par_dirid, __le32 par_objid)
{
struct reiserfs_de_head * deh;

Expand Down Expand Up @@ -242,8 +242,8 @@ void make_empty_dir_item_v1 (char * body, __u32 dirid, __u32 objid,
}

/* compose directory item containing "." and ".." entries */
void make_empty_dir_item (char * body, __u32 dirid, __u32 objid,
__u32 par_dirid, __u32 par_objid)
void make_empty_dir_item (char * body, __le32 dirid, __le32 objid,
__le32 par_dirid, __le32 par_objid)
{
struct reiserfs_de_head * deh;

Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/reiserfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ static int reiserfs_allocate_blocks_for_region(
struct cpu_key key; // cpu key of item that we are going to deal with
struct item_head *ih; // pointer to item head that we are going to deal with
struct buffer_head *bh; // Buffer head that contains items that we are going to deal with
__u32 * item; // pointer to item we are going to deal with
__le32 * item; // pointer to item we are going to deal with
INITIALIZE_PATH(path); // path to item, that we are going to deal with.
b_blocknr_t *allocated_blocks; // Pointer to a place where allocated blocknumbers would be stored.
reiserfs_blocknr_hint_t hint; // hint structure for block allocator.
Expand Down Expand Up @@ -891,7 +891,7 @@ static int reiserfs_prepare_file_region_for_write(
struct item_head *ih = NULL; // pointer to item head that we are going to deal with
struct buffer_head *itembuf=NULL; // Buffer head that contains items that we are going to deal with
INITIALIZE_PATH(path); // path to item, that we are going to deal with.
__u32 * item=NULL; // pointer to item we are going to deal with
__le32 * item=NULL; // pointer to item we are going to deal with
int item_pos=-1; /* Position in indirect item */


Expand Down
10 changes: 5 additions & 5 deletions trunk/fs/reiserfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static inline void fix_tail_page_for_writing(struct page *page) {
done already or non-hole position has been found in the indirect item */
static inline int allocation_needed (int retval, b_blocknr_t allocated,
struct item_head * ih,
__u32 * item, int pos_in_item)
__le32 * item, int pos_in_item)
{
if (allocated)
return 0;
Expand Down Expand Up @@ -278,7 +278,7 @@ static int _get_block_create_0 (struct inode * inode, long block,
bh = get_last_bh (&path);
ih = get_ih (&path);
if (is_indirect_le_ih (ih)) {
__u32 * ind_item = (__u32 *)B_I_PITEM (bh, ih);
__le32 * ind_item = (__le32 *)B_I_PITEM (bh, ih);

/* FIXME: here we could cache indirect item or part of it in
the inode to avoid search_by_key in case of subsequent
Expand Down Expand Up @@ -581,7 +581,7 @@ int reiserfs_get_block (struct inode * inode, sector_t block,
struct cpu_key key;
struct buffer_head * bh, * unbh = NULL;
struct item_head * ih, tmp_ih;
__u32 * item;
__le32 * item;
int done;
int fs_gen;
struct reiserfs_transaction_handle *th = NULL;
Expand Down Expand Up @@ -746,7 +746,7 @@ int reiserfs_get_block (struct inode * inode, sector_t block,
done = 0;
do {
if (is_statdata_le_ih (ih)) {
__u32 unp = 0;
__le32 unp = 0;
struct cpu_key tmp_key;

/* indirect item has to be inserted */
Expand Down Expand Up @@ -2067,7 +2067,7 @@ static int map_block_for_writepage(struct inode *inode,
struct item_head tmp_ih ;
struct item_head *ih ;
struct buffer_head *bh ;
__u32 *item ;
__le32 *item ;
struct cpu_key key ;
INITIALIZE_PATH(path) ;
int pos_in_item ;
Expand Down
5 changes: 3 additions & 2 deletions trunk/fs/reiserfs/item_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,11 @@ static void print_sequence (__u32 start, int len)
static void indirect_print_item (struct item_head * ih, char * item)
{
int j;
__u32 * unp, prev = INT_MAX;
__le32 * unp;
__u32 prev = INT_MAX;
int num;

unp = (__u32 *)item;
unp = (__le32 *)item;

if (ih_item_len(ih) % UNFM_P_SIZE)
reiserfs_warning (NULL, "indirect_print_item: invalid item len");
Expand Down
18 changes: 9 additions & 9 deletions trunk/fs/reiserfs/objectid.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

// find where objectid map starts
#define objectid_map(s,rs) (old_format_only (s) ? \
(__u32 *)((struct reiserfs_super_block_v1 *)(rs) + 1) :\
(__u32 *)((rs) + 1))
(__le32 *)((struct reiserfs_super_block_v1 *)(rs) + 1) :\
(__le32 *)((rs) + 1))


#ifdef CONFIG_REISERFS_CHECK

static void check_objectid_map (struct super_block * s, __u32 * map)
static void check_objectid_map (struct super_block * s, __le32 * map)
{
if (le32_to_cpu (map[0]) != 1)
reiserfs_panic (s, "vs-15010: check_objectid_map: map corrupted: %lx",
Expand All @@ -27,7 +27,7 @@ static void check_objectid_map (struct super_block * s, __u32 * map)
}

#else
static void check_objectid_map (struct super_block * s, __u32 * map)
static void check_objectid_map (struct super_block * s, __le32 * map)
{;}
#endif

Expand All @@ -52,7 +52,7 @@ __u32 reiserfs_get_unused_objectid (struct reiserfs_transaction_handle *th)
{
struct super_block * s = th->t_super;
struct reiserfs_super_block * rs = SB_DISK_SUPER_BLOCK (s);
__u32 * map = objectid_map (s, rs);
__le32 * map = objectid_map (s, rs);
__u32 unused_objectid;

BUG_ON (!th->t_trans_id);
Expand Down Expand Up @@ -97,7 +97,7 @@ void reiserfs_release_objectid (struct reiserfs_transaction_handle *th,
{
struct super_block * s = th->t_super;
struct reiserfs_super_block * rs = SB_DISK_SUPER_BLOCK (s);
__u32 * map = objectid_map (s, rs);
__le32 * map = objectid_map (s, rs);
int i = 0;

BUG_ON (!th->t_trans_id);
Expand Down Expand Up @@ -172,12 +172,12 @@ int reiserfs_convert_objectid_map_v1(struct super_block *s) {
int new_size = (s->s_blocksize - SB_SIZE) / sizeof(__u32) / 2 * 2 ;
int old_max = sb_oid_maxsize(disk_sb);
struct reiserfs_super_block_v1 *disk_sb_v1 ;
__u32 *objectid_map, *new_objectid_map ;
__le32 *objectid_map, *new_objectid_map ;
int i ;

disk_sb_v1=(struct reiserfs_super_block_v1 *)(SB_BUFFER_WITH_SB(s)->b_data);
objectid_map = (__u32 *)(disk_sb_v1 + 1) ;
new_objectid_map = (__u32 *)(disk_sb + 1) ;
objectid_map = (__le32 *)(disk_sb_v1 + 1) ;
new_objectid_map = (__le32 *)(disk_sb + 1) ;

if (cur_size > new_size) {
/* mark everyone used that was listed as free at the end of the objectid
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/reiserfs/procfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ int reiserfs_global_version_in_proc( char *buffer, char **start, off_t offset,
#define DFL( x ) D4C( rs -> s_v1.x )

#define objectid_map( s, rs ) (old_format_only (s) ? \
(__u32 *)((struct reiserfs_super_block_v1 *)rs + 1) : \
(__u32 *)(rs + 1))
(__le32 *)((struct reiserfs_super_block_v1 *)rs + 1) : \
(__le32 *)(rs + 1))
#define MAP( i ) D4C( objectid_map( sb, rs )[ i ] )

#define DJF( x ) le32_to_cpu( rs -> x )
Expand Down
22 changes: 14 additions & 8 deletions trunk/fs/reiserfs/stree.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,11 @@ inline void copy_item_head(struct item_head * p_v_to,
inline int comp_short_keys (const struct reiserfs_key * le_key,
const struct cpu_key * cpu_key)
{
__u32 * p_s_le_u32, * p_s_cpu_u32;
__le32 * p_s_le_u32;
__u32 * p_s_cpu_u32;
int n_key_length = REISERFS_SHORT_KEY_LEN;

p_s_le_u32 = (__u32 *)le_key;
p_s_le_u32 = (__le32 *)le_key;
p_s_cpu_u32 = (__u32 *)&cpu_key->on_disk_key;
for( ; n_key_length--; ++p_s_le_u32, ++p_s_cpu_u32 ) {
if ( le32_to_cpu (*p_s_le_u32) < *p_s_cpu_u32 )
Expand Down Expand Up @@ -228,7 +229,12 @@ extern struct tree_balance * cur_tb;
const struct reiserfs_key MIN_KEY = {0, 0, {{0, 0},}};

/* Maximal possible key. It is never in the tree. */
const struct reiserfs_key MAX_KEY = {0xffffffff, 0xffffffff, {{0xffffffff, 0xffffffff},}};
const struct reiserfs_key MAX_KEY = {
__constant_cpu_to_le32(0xffffffff),
__constant_cpu_to_le32(0xffffffff),
{{__constant_cpu_to_le32(0xffffffff),
__constant_cpu_to_le32(0xffffffff)},}
};
const struct in_core_key MAX_IN_CORE_KEY = {0xffffffff, 0xffffffff, {{0xffffffff, 0xffffffff},}};


Expand Down Expand Up @@ -998,7 +1004,7 @@ static char prepare_for_delete_or_cut(
int n_unfm_number, /* Number of the item unformatted nodes. */
n_counter,
n_blk_size;
__u32 * p_n_unfm_pointer; /* Pointer to the unformatted node number. */
__le32 * p_n_unfm_pointer; /* Pointer to the unformatted node number. */
__u32 tmp;
struct item_head s_ih; /* Item header. */
char c_mode; /* Returned mode of the balance. */
Expand Down Expand Up @@ -1060,7 +1066,7 @@ static char prepare_for_delete_or_cut(
/* pointers to be cut */
n_unfm_number -= pos_in_item (p_s_path);
/* Set pointer to the last unformatted node pointer that is to be cut. */
p_n_unfm_pointer = (__u32 *)B_I_PITEM(p_s_bh, &s_ih) + I_UNFM_NUM(&s_ih) - 1 - *p_n_removed;
p_n_unfm_pointer = (__le32 *)B_I_PITEM(p_s_bh, &s_ih) + I_UNFM_NUM(&s_ih) - 1 - *p_n_removed;


/* We go through the unformatted nodes pointers of the indirect
Expand All @@ -1082,8 +1088,8 @@ static char prepare_for_delete_or_cut(
need_research = 1 ;
break;
}
RFALSE( p_n_unfm_pointer < (__u32 *)B_I_PITEM(p_s_bh, &s_ih) ||
p_n_unfm_pointer > (__u32 *)B_I_PITEM(p_s_bh, &s_ih) + I_UNFM_NUM(&s_ih) - 1,
RFALSE( p_n_unfm_pointer < (__le32 *)B_I_PITEM(p_s_bh, &s_ih) ||
p_n_unfm_pointer > (__le32 *)B_I_PITEM(p_s_bh, &s_ih) + I_UNFM_NUM(&s_ih) - 1,
"vs-5265: pointer out of range");

/* Hole, nothing to remove. */
Expand Down Expand Up @@ -1432,7 +1438,7 @@ int reiserfs_delete_object (struct reiserfs_transaction_handle *th, struct inode
#if defined( USE_INODE_GENERATION_COUNTER )
if( !old_format_only ( th -> t_super ) )
{
__u32 *inode_generation;
__le32 *inode_generation;

inode_generation =
&REISERFS_SB(th -> t_super) -> s_rs -> s_inode_generation;
Expand Down
6 changes: 3 additions & 3 deletions trunk/fs/reiserfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ static int finish_unfinished (struct super_block * s)

/* reiserfs_iget needs k_dirid and k_objectid only */
item = B_I_PITEM (bh, ih);
obj_key.on_disk_key.k_dir_id = le32_to_cpu (*(__u32 *)item);
obj_key.on_disk_key.k_dir_id = le32_to_cpu (*(__le32 *)item);
obj_key.on_disk_key.k_objectid = le32_to_cpu (ih->ih_key.k_objectid);
obj_key.on_disk_key.u.k_offset_v1.k_offset = 0;
obj_key.on_disk_key.u.k_offset_v1.k_uniqueness = 0;
Expand Down Expand Up @@ -304,7 +304,7 @@ void add_save_link (struct reiserfs_transaction_handle * th,
int retval;
struct cpu_key key;
struct item_head ih;
__u32 link;
__le32 link;

BUG_ON (!th->t_trans_id);

Expand Down Expand Up @@ -1336,7 +1336,7 @@ static int read_super_block (struct super_block * s, int offset)
return 1;
}

if ( rs->s_v1.s_root_block == -1 ) {
if ( rs->s_v1.s_root_block == cpu_to_le32(-1) ) {
brelse(bh) ;
reiserfs_warning (s, "Unfinished reiserfsck --rebuild-tree run detected. Please run\n"
"reiserfsck --rebuild-tree and wait for a completion. If that fails\n"
Expand Down
12 changes: 6 additions & 6 deletions trunk/include/linux/reiserfs_acl.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
#define REISERFS_ACL_VERSION 0x0001

typedef struct {
__u16 e_tag;
__u16 e_perm;
__u32 e_id;
__le16 e_tag;
__le16 e_perm;
__le32 e_id;
} reiserfs_acl_entry;

typedef struct {
__u16 e_tag;
__u16 e_perm;
__le16 e_tag;
__le16 e_perm;
} reiserfs_acl_entry_short;

typedef struct {
__u32 a_version;
__le32 a_version;
} reiserfs_acl_header;

static inline size_t reiserfs_acl_size(int count)
Expand Down
Loading

0 comments on commit 21b748d

Please sign in to comment.