Commit 3e8962be authored by Al Viro's avatar Al Viro Committed by Linus Torvalds
Browse files

[PATCH] reiserfs endianness: annotate little-endian objects



little-endian objects annotated as such; again, obviously no changes of
resulting code, we only replace __u16 with __le16, etc.  in relevant places.

Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
Cc: <reiserfs-dev@namesys.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 6a3a16f2
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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);
	/*
@@ -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
+4 −4
Original line number Diff line number Diff line
@@ -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;

@@ -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;

+2 −2
Original line number Diff line number Diff line
@@ -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.
@@ -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 */


+5 −5
Original line number Diff line number Diff line
@@ -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;
@@ -278,7 +278,7 @@ research:
    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
@@ -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;
@@ -746,7 +746,7 @@ start_trans:
    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 */
@@ -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 ;
+3 −2
Original line number Diff line number Diff line
@@ -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");
Loading