dir.c (8c57a5e7b2820f349c95b8c8393fec1e0f4070d2) | dir.c (70246286e94c335b5bea0cbc68a17a96dd620281) |
---|---|
1/* 2 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. 3 * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. 4 * 5 * This copyrighted material is made available to anyone wishing to use, 6 * modify, copy, or redistribute it subject to the terms and conditions 7 * of the GNU General Public License version 2. 8 */ --- 769 unchanged lines hidden (view full) --- 778 * 779 * Returns: 0 on success, error code otherwise 780 */ 781 782static int get_leaf_nr(struct gfs2_inode *dip, u32 index, 783 u64 *leaf_out) 784{ 785 __be64 *hash; | 1/* 2 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. 3 * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. 4 * 5 * This copyrighted material is made available to anyone wishing to use, 6 * modify, copy, or redistribute it subject to the terms and conditions 7 * of the GNU General Public License version 2. 8 */ --- 769 unchanged lines hidden (view full) --- 778 * 779 * Returns: 0 on success, error code otherwise 780 */ 781 782static int get_leaf_nr(struct gfs2_inode *dip, u32 index, 783 u64 *leaf_out) 784{ 785 __be64 *hash; |
786 int error; |
|
786 787 hash = gfs2_dir_get_hash_table(dip); | 787 788 hash = gfs2_dir_get_hash_table(dip); |
788 if (IS_ERR(hash)) 789 return PTR_ERR(hash); 790 *leaf_out = be64_to_cpu(*(hash + index)); 791 return 0; | 789 error = PTR_ERR_OR_ZERO(hash); 790 791 if (!error) 792 *leaf_out = be64_to_cpu(*(hash + index)); 793 794 return error; |
792} 793 794static int get_first_leaf(struct gfs2_inode *dip, u32 index, 795 struct buffer_head **bh_out) 796{ 797 u64 leaf_no; 798 int error; 799 800 error = get_leaf_nr(dip, index, &leaf_no); | 795} 796 797static int get_first_leaf(struct gfs2_inode *dip, u32 index, 798 struct buffer_head **bh_out) 799{ 800 u64 leaf_no; 801 int error; 802 803 error = get_leaf_nr(dip, index, &leaf_no); |
801 if (!IS_ERR_VALUE(error)) | 804 if (!error) |
802 error = get_leaf(dip, leaf_no, bh_out); 803 804 return error; 805} 806 807static struct gfs2_dirent *gfs2_dirent_search(struct inode *inode, 808 const struct qstr *name, 809 gfs2_dscan_t scan, --- 199 unchanged lines hidden (view full) --- 1009 u64 bn, leaf_no; 1010 __be64 *lp; 1011 u32 index; 1012 int x, moved = 0; 1013 int error; 1014 1015 index = name->hash >> (32 - dip->i_depth); 1016 error = get_leaf_nr(dip, index, &leaf_no); | 805 error = get_leaf(dip, leaf_no, bh_out); 806 807 return error; 808} 809 810static struct gfs2_dirent *gfs2_dirent_search(struct inode *inode, 811 const struct qstr *name, 812 gfs2_dscan_t scan, --- 199 unchanged lines hidden (view full) --- 1012 u64 bn, leaf_no; 1013 __be64 *lp; 1014 u32 index; 1015 int x, moved = 0; 1016 int error; 1017 1018 index = name->hash >> (32 - dip->i_depth); 1019 error = get_leaf_nr(dip, index, &leaf_no); |
1017 if (IS_ERR_VALUE(error)) | 1020 if (error) |
1018 return error; 1019 1020 /* Get the old leaf block */ 1021 error = get_leaf(dip, leaf_no, &obh); 1022 if (error) 1023 return error; 1024 1025 oleaf = (struct gfs2_leaf *)obh->b_data; --- 479 unchanged lines hidden (view full) --- 1505 bh = gfs2_getbuf(gl, blocknr, 1); 1506 if (trylock_buffer(bh)) { 1507 if (buffer_uptodate(bh)) { 1508 unlock_buffer(bh); 1509 brelse(bh); 1510 continue; 1511 } 1512 bh->b_end_io = end_buffer_read_sync; | 1021 return error; 1022 1023 /* Get the old leaf block */ 1024 error = get_leaf(dip, leaf_no, &obh); 1025 if (error) 1026 return error; 1027 1028 oleaf = (struct gfs2_leaf *)obh->b_data; --- 479 unchanged lines hidden (view full) --- 1508 bh = gfs2_getbuf(gl, blocknr, 1); 1509 if (trylock_buffer(bh)) { 1510 if (buffer_uptodate(bh)) { 1511 unlock_buffer(bh); 1512 brelse(bh); 1513 continue; 1514 } 1515 bh->b_end_io = end_buffer_read_sync; |
1513 submit_bh(READA | REQ_META, bh); | 1516 submit_bh(REQ_OP_READ, REQ_RAHEAD | REQ_META, bh); |
1514 continue; 1515 } 1516 brelse(bh); 1517 } 1518} 1519 1520/** 1521 * dir_e_read - Reads the entries from a directory into a filldir buffer --- 669 unchanged lines hidden --- | 1517 continue; 1518 } 1519 brelse(bh); 1520 } 1521} 1522 1523/** 1524 * dir_e_read - Reads the entries from a directory into a filldir buffer --- 669 unchanged lines hidden --- |