aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/reiserfs')
-rw-r--r--fs/reiserfs/bitmap.c2
-rw-r--r--fs/reiserfs/dir.c4
-rw-r--r--fs/reiserfs/file.c65
-rw-r--r--fs/reiserfs/fix_node.c6
-rw-r--r--fs/reiserfs/inode.c22
-rw-r--r--fs/reiserfs/ioctl.c2
-rw-r--r--fs/reiserfs/journal.c18
-rw-r--r--fs/reiserfs/namei.c6
-rw-r--r--fs/reiserfs/procfs.c2
-rw-r--r--fs/reiserfs/stree.c44
-rw-r--r--fs/reiserfs/super.c11
-rw-r--r--fs/reiserfs/tail_conversion.c4
-rw-r--r--fs/reiserfs/xattr.c12
-rw-r--r--fs/reiserfs/xattr_acl.c2
14 files changed, 78 insertions, 122 deletions
diff --git a/fs/reiserfs/bitmap.c b/fs/reiserfs/bitmap.c
index e3d466a228d4..b286ccb08587 100644
--- a/fs/reiserfs/bitmap.c
+++ b/fs/reiserfs/bitmap.c
@@ -708,7 +708,7 @@ static void oid_groups(reiserfs_blocknr_hint_t * hint)
708 */ 708 */
709static int get_left_neighbor(reiserfs_blocknr_hint_t * hint) 709static int get_left_neighbor(reiserfs_blocknr_hint_t * hint)
710{ 710{
711 struct path *path; 711 struct treepath *path;
712 struct buffer_head *bh; 712 struct buffer_head *bh;
713 struct item_head *ih; 713 struct item_head *ih;
714 int pos_in_item; 714 int pos_in_item;
diff --git a/fs/reiserfs/dir.c b/fs/reiserfs/dir.c
index 657050ad7430..96a2f8889da3 100644
--- a/fs/reiserfs/dir.c
+++ b/fs/reiserfs/dir.c
@@ -45,7 +45,7 @@ static int reiserfs_dir_fsync(struct file *filp, struct dentry *dentry,
45// 45//
46static int reiserfs_readdir(struct file *filp, void *dirent, filldir_t filldir) 46static int reiserfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
47{ 47{
48 struct inode *inode = filp->f_dentry->d_inode; 48 struct inode *inode = filp->f_path.dentry->d_inode;
49 struct cpu_key pos_key; /* key of current position in the directory (key of directory entry) */ 49 struct cpu_key pos_key; /* key of current position in the directory (key of directory entry) */
50 INITIALIZE_PATH(path_to_entry); 50 INITIALIZE_PATH(path_to_entry);
51 struct buffer_head *bh; 51 struct buffer_head *bh;
@@ -135,7 +135,7 @@ static int reiserfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
135 /* Ignore the .reiserfs_priv entry */ 135 /* Ignore the .reiserfs_priv entry */
136 if (reiserfs_xattrs(inode->i_sb) && 136 if (reiserfs_xattrs(inode->i_sb) &&
137 !old_format_only(inode->i_sb) && 137 !old_format_only(inode->i_sb) &&
138 filp->f_dentry == inode->i_sb->s_root && 138 filp->f_path.dentry == inode->i_sb->s_root &&
139 REISERFS_SB(inode->i_sb)->priv_root && 139 REISERFS_SB(inode->i_sb)->priv_root &&
140 REISERFS_SB(inode->i_sb)->priv_root->d_inode 140 REISERFS_SB(inode->i_sb)->priv_root->d_inode
141 && deh_objectid(deh) == 141 && deh_objectid(deh) ==
diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c
index ac14318c81ba..99b6f329ba23 100644
--- a/fs/reiserfs/file.c
+++ b/fs/reiserfs/file.c
@@ -317,12 +317,11 @@ static int reiserfs_allocate_blocks_for_region(struct reiserfs_transaction_handl
317 /* area filled with zeroes, to supply as list of zero blocknumbers 317 /* area filled with zeroes, to supply as list of zero blocknumbers
318 We allocate it outside of loop just in case loop would spin for 318 We allocate it outside of loop just in case loop would spin for
319 several iterations. */ 319 several iterations. */
320 char *zeros = kmalloc(to_paste * UNFM_P_SIZE, GFP_ATOMIC); // We cannot insert more than MAX_ITEM_LEN bytes anyway. 320 char *zeros = kzalloc(to_paste * UNFM_P_SIZE, GFP_ATOMIC); // We cannot insert more than MAX_ITEM_LEN bytes anyway.
321 if (!zeros) { 321 if (!zeros) {
322 res = -ENOMEM; 322 res = -ENOMEM;
323 goto error_exit_free_blocks; 323 goto error_exit_free_blocks;
324 } 324 }
325 memset(zeros, 0, to_paste * UNFM_P_SIZE);
326 do { 325 do {
327 to_paste = 326 to_paste =
328 min_t(__u64, hole_size, 327 min_t(__u64, hole_size,
@@ -407,6 +406,8 @@ static int reiserfs_allocate_blocks_for_region(struct reiserfs_transaction_handl
407 we restart it. This will also free the path. */ 406 we restart it. This will also free the path. */
408 if (journal_transaction_should_end 407 if (journal_transaction_should_end
409 (th, th->t_blocks_allocated)) { 408 (th, th->t_blocks_allocated)) {
409 inode->i_size = cpu_key_k_offset(&key) +
410 (to_paste << inode->i_blkbits);
410 res = 411 res =
411 restart_transaction(th, inode, 412 restart_transaction(th, inode,
412 &path); 413 &path);
@@ -1045,6 +1046,7 @@ static int reiserfs_prepare_file_region_for_write(struct inode *inode
1045 char *kaddr = kmap_atomic(prepared_pages[0], KM_USER0); 1046 char *kaddr = kmap_atomic(prepared_pages[0], KM_USER0);
1046 memset(kaddr, 0, from); 1047 memset(kaddr, 0, from);
1047 kunmap_atomic(kaddr, KM_USER0); 1048 kunmap_atomic(kaddr, KM_USER0);
1049 flush_dcache_page(prepared_pages[0]);
1048 } 1050 }
1049 if (to != PAGE_CACHE_SIZE) { /* Last page needs to be partially zeroed */ 1051 if (to != PAGE_CACHE_SIZE) { /* Last page needs to be partially zeroed */
1050 char *kaddr = 1052 char *kaddr =
@@ -1052,6 +1054,7 @@ static int reiserfs_prepare_file_region_for_write(struct inode *inode
1052 KM_USER0); 1054 KM_USER0);
1053 memset(kaddr + to, 0, PAGE_CACHE_SIZE - to); 1055 memset(kaddr + to, 0, PAGE_CACHE_SIZE - to);
1054 kunmap_atomic(kaddr, KM_USER0); 1056 kunmap_atomic(kaddr, KM_USER0);
1057 flush_dcache_page(prepared_pages[num_pages - 1]);
1055 } 1058 }
1056 1059
1057 /* Since all blocks are new - use already calculated value */ 1060 /* Since all blocks are new - use already calculated value */
@@ -1185,6 +1188,7 @@ static int reiserfs_prepare_file_region_for_write(struct inode *inode
1185 memset(kaddr + block_start, 0, 1188 memset(kaddr + block_start, 0,
1186 from - block_start); 1189 from - block_start);
1187 kunmap_atomic(kaddr, KM_USER0); 1190 kunmap_atomic(kaddr, KM_USER0);
1191 flush_dcache_page(prepared_pages[0]);
1188 set_buffer_uptodate(bh); 1192 set_buffer_uptodate(bh);
1189 } 1193 }
1190 } 1194 }
@@ -1222,6 +1226,7 @@ static int reiserfs_prepare_file_region_for_write(struct inode *inode
1222 KM_USER0); 1226 KM_USER0);
1223 memset(kaddr + to, 0, block_end - to); 1227 memset(kaddr + to, 0, block_end - to);
1224 kunmap_atomic(kaddr, KM_USER0); 1228 kunmap_atomic(kaddr, KM_USER0);
1229 flush_dcache_page(prepared_pages[num_pages - 1]);
1225 set_buffer_uptodate(bh); 1230 set_buffer_uptodate(bh);
1226 } 1231 }
1227 } 1232 }
@@ -1283,7 +1288,7 @@ static ssize_t reiserfs_file_write(struct file *file, /* the file we are going t
1283 loff_t pos; // Current position in the file. 1288 loff_t pos; // Current position in the file.
1284 ssize_t res; // return value of various functions that we call. 1289 ssize_t res; // return value of various functions that we call.
1285 int err = 0; 1290 int err = 0;
1286 struct inode *inode = file->f_dentry->d_inode; // Inode of the file that we are writing to. 1291 struct inode *inode = file->f_path.dentry->d_inode; // Inode of the file that we are writing to.
1287 /* To simplify coding at this time, we store 1292 /* To simplify coding at this time, we store
1288 locked pages in array for now */ 1293 locked pages in array for now */
1289 struct page *prepared_pages[REISERFS_WRITE_PAGES_AT_A_TIME]; 1294 struct page *prepared_pages[REISERFS_WRITE_PAGES_AT_A_TIME];
@@ -1307,56 +1312,8 @@ static ssize_t reiserfs_file_write(struct file *file, /* the file we are going t
1307 count = MAX_NON_LFS - (unsigned long)*ppos; 1312 count = MAX_NON_LFS - (unsigned long)*ppos;
1308 } 1313 }
1309 1314
1310 if (file->f_flags & O_DIRECT) { // Direct IO needs treatment 1315 if (file->f_flags & O_DIRECT)
1311 ssize_t result, after_file_end = 0; 1316 return do_sync_write(file, buf, count, ppos);
1312 if ((*ppos + count >= inode->i_size)
1313 || (file->f_flags & O_APPEND)) {
1314 /* If we are appending a file, we need to put this savelink in here.
1315 If we will crash while doing direct io, finish_unfinished will
1316 cut the garbage from the file end. */
1317 reiserfs_write_lock(inode->i_sb);
1318 err =
1319 journal_begin(&th, inode->i_sb,
1320 JOURNAL_PER_BALANCE_CNT);
1321 if (err) {
1322 reiserfs_write_unlock(inode->i_sb);
1323 return err;
1324 }
1325 reiserfs_update_inode_transaction(inode);
1326 add_save_link(&th, inode, 1 /* Truncate */ );
1327 after_file_end = 1;
1328 err =
1329 journal_end(&th, inode->i_sb,
1330 JOURNAL_PER_BALANCE_CNT);
1331 reiserfs_write_unlock(inode->i_sb);
1332 if (err)
1333 return err;
1334 }
1335 result = do_sync_write(file, buf, count, ppos);
1336
1337 if (after_file_end) { /* Now update i_size and remove the savelink */
1338 struct reiserfs_transaction_handle th;
1339 reiserfs_write_lock(inode->i_sb);
1340 err = journal_begin(&th, inode->i_sb, 1);
1341 if (err) {
1342 reiserfs_write_unlock(inode->i_sb);
1343 return err;
1344 }
1345 reiserfs_update_inode_transaction(inode);
1346 mark_inode_dirty(inode);
1347 err = journal_end(&th, inode->i_sb, 1);
1348 if (err) {
1349 reiserfs_write_unlock(inode->i_sb);
1350 return err;
1351 }
1352 err = remove_save_link(inode, 1 /* truncate */ );
1353 reiserfs_write_unlock(inode->i_sb);
1354 if (err)
1355 return err;
1356 }
1357
1358 return result;
1359 }
1360 1317
1361 if (unlikely((ssize_t) count < 0)) 1318 if (unlikely((ssize_t) count < 0))
1362 return -EINVAL; 1319 return -EINVAL;
@@ -1378,7 +1335,7 @@ static ssize_t reiserfs_file_write(struct file *file, /* the file we are going t
1378 if (count == 0) 1335 if (count == 0)
1379 goto out; 1336 goto out;
1380 1337
1381 res = remove_suid(file->f_dentry); 1338 res = remove_suid(file->f_path.dentry);
1382 if (res) 1339 if (res)
1383 goto out; 1340 goto out;
1384 1341
diff --git a/fs/reiserfs/fix_node.c b/fs/reiserfs/fix_node.c
index 6d0e554daa9d..0ee35c6c9b72 100644
--- a/fs/reiserfs/fix_node.c
+++ b/fs/reiserfs/fix_node.c
@@ -957,7 +957,7 @@ static int get_far_parent(struct tree_balance *p_s_tb,
957{ 957{
958 struct buffer_head *p_s_parent; 958 struct buffer_head *p_s_parent;
959 INITIALIZE_PATH(s_path_to_neighbor_father); 959 INITIALIZE_PATH(s_path_to_neighbor_father);
960 struct path *p_s_path = p_s_tb->tb_path; 960 struct treepath *p_s_path = p_s_tb->tb_path;
961 struct cpu_key s_lr_father_key; 961 struct cpu_key s_lr_father_key;
962 int n_counter, 962 int n_counter,
963 n_position = INT_MAX, 963 n_position = INT_MAX,
@@ -1074,7 +1074,7 @@ static int get_far_parent(struct tree_balance *p_s_tb,
1074 */ 1074 */
1075static int get_parents(struct tree_balance *p_s_tb, int n_h) 1075static int get_parents(struct tree_balance *p_s_tb, int n_h)
1076{ 1076{
1077 struct path *p_s_path = p_s_tb->tb_path; 1077 struct treepath *p_s_path = p_s_tb->tb_path;
1078 int n_position, 1078 int n_position,
1079 n_ret_value, 1079 n_ret_value,
1080 n_path_offset = PATH_H_PATH_OFFSET(p_s_tb->tb_path, n_h); 1080 n_path_offset = PATH_H_PATH_OFFSET(p_s_tb->tb_path, n_h);
@@ -1885,7 +1885,7 @@ static int check_balance(int mode,
1885static int get_direct_parent(struct tree_balance *p_s_tb, int n_h) 1885static int get_direct_parent(struct tree_balance *p_s_tb, int n_h)
1886{ 1886{
1887 struct buffer_head *p_s_bh; 1887 struct buffer_head *p_s_bh;
1888 struct path *p_s_path = p_s_tb->tb_path; 1888 struct treepath *p_s_path = p_s_tb->tb_path;
1889 int n_position, 1889 int n_position,
1890 n_path_offset = PATH_H_PATH_OFFSET(p_s_tb->tb_path, n_h); 1890 n_path_offset = PATH_H_PATH_OFFSET(p_s_tb->tb_path, n_h);
1891 1891
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index 9c69bcacad22..f3d1c4a77979 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -207,7 +207,7 @@ static int file_capable(struct inode *inode, long block)
207} 207}
208 208
209/*static*/ int restart_transaction(struct reiserfs_transaction_handle *th, 209/*static*/ int restart_transaction(struct reiserfs_transaction_handle *th,
210 struct inode *inode, struct path *path) 210 struct inode *inode, struct treepath *path)
211{ 211{
212 struct super_block *s = th->t_super; 212 struct super_block *s = th->t_super;
213 int len = th->t_blocks_allocated; 213 int len = th->t_blocks_allocated;
@@ -216,11 +216,12 @@ static int file_capable(struct inode *inode, long block)
216 BUG_ON(!th->t_trans_id); 216 BUG_ON(!th->t_trans_id);
217 BUG_ON(!th->t_refcount); 217 BUG_ON(!th->t_refcount);
218 218
219 pathrelse(path);
220
219 /* we cannot restart while nested */ 221 /* we cannot restart while nested */
220 if (th->t_refcount > 1) { 222 if (th->t_refcount > 1) {
221 return 0; 223 return 0;
222 } 224 }
223 pathrelse(path);
224 reiserfs_update_sd(th, inode); 225 reiserfs_update_sd(th, inode);
225 err = journal_end(th, s, len); 226 err = journal_end(th, s, len);
226 if (!err) { 227 if (!err) {
@@ -569,7 +570,7 @@ static inline int _allocate_block(struct reiserfs_transaction_handle *th,
569 long block, 570 long block,
570 struct inode *inode, 571 struct inode *inode,
571 b_blocknr_t * allocated_block_nr, 572 b_blocknr_t * allocated_block_nr,
572 struct path *path, int flags) 573 struct treepath *path, int flags)
573{ 574{
574 BUG_ON(!th->t_trans_id); 575 BUG_ON(!th->t_trans_id);
575 576
@@ -928,15 +929,12 @@ int reiserfs_get_block(struct inode *inode, sector_t block,
928 if (blocks_needed == 1) { 929 if (blocks_needed == 1) {
929 un = &unf_single; 930 un = &unf_single;
930 } else { 931 } else {
931 un = kmalloc(min(blocks_needed, max_to_insert) * UNFM_P_SIZE, GFP_ATOMIC); // We need to avoid scheduling. 932 un = kzalloc(min(blocks_needed, max_to_insert) * UNFM_P_SIZE, GFP_ATOMIC); // We need to avoid scheduling.
932 if (!un) { 933 if (!un) {
933 un = &unf_single; 934 un = &unf_single;
934 blocks_needed = 1; 935 blocks_needed = 1;
935 max_to_insert = 0; 936 max_to_insert = 0;
936 } else 937 }
937 memset(un, 0,
938 UNFM_P_SIZE * min(blocks_needed,
939 max_to_insert));
940 } 938 }
941 if (blocks_needed <= max_to_insert) { 939 if (blocks_needed <= max_to_insert) {
942 /* we are going to add target block to the file. Use allocated 940 /* we are going to add target block to the file. Use allocated
@@ -1109,7 +1107,7 @@ static inline ulong to_fake_used_blocks(struct inode *inode, int sd_size)
1109// 1107//
1110 1108
1111// called by read_locked_inode 1109// called by read_locked_inode
1112static void init_inode(struct inode *inode, struct path *path) 1110static void init_inode(struct inode *inode, struct treepath *path)
1113{ 1111{
1114 struct buffer_head *bh; 1112 struct buffer_head *bh;
1115 struct item_head *ih; 1113 struct item_head *ih;
@@ -1286,7 +1284,7 @@ static void inode2sd_v1(void *sd, struct inode *inode, loff_t size)
1286/* NOTE, you must prepare the buffer head before sending it here, 1284/* NOTE, you must prepare the buffer head before sending it here,
1287** and then log it after the call 1285** and then log it after the call
1288*/ 1286*/
1289static void update_stat_data(struct path *path, struct inode *inode, 1287static void update_stat_data(struct treepath *path, struct inode *inode,
1290 loff_t size) 1288 loff_t size)
1291{ 1289{
1292 struct buffer_head *bh; 1290 struct buffer_head *bh;
@@ -1655,7 +1653,7 @@ int reiserfs_write_inode(struct inode *inode, int do_sync)
1655 containing "." and ".." entries */ 1653 containing "." and ".." entries */
1656static int reiserfs_new_directory(struct reiserfs_transaction_handle *th, 1654static int reiserfs_new_directory(struct reiserfs_transaction_handle *th,
1657 struct inode *inode, 1655 struct inode *inode,
1658 struct item_head *ih, struct path *path, 1656 struct item_head *ih, struct treepath *path,
1659 struct inode *dir) 1657 struct inode *dir)
1660{ 1658{
1661 struct super_block *sb = th->t_super; 1659 struct super_block *sb = th->t_super;
@@ -1714,7 +1712,7 @@ static int reiserfs_new_directory(struct reiserfs_transaction_handle *th,
1714 containing the body of symlink */ 1712 containing the body of symlink */
1715static int reiserfs_new_symlink(struct reiserfs_transaction_handle *th, struct inode *inode, /* Inode of symlink */ 1713static int reiserfs_new_symlink(struct reiserfs_transaction_handle *th, struct inode *inode, /* Inode of symlink */
1716 struct item_head *ih, 1714 struct item_head *ih,
1717 struct path *path, const char *symname, 1715 struct treepath *path, const char *symname,
1718 int item_len) 1716 int item_len)
1719{ 1717{
1720 struct super_block *sb = th->t_super; 1718 struct super_block *sb = th->t_super;
diff --git a/fs/reiserfs/ioctl.c b/fs/reiserfs/ioctl.c
index 9c57578cb831..b484d2913c0d 100644
--- a/fs/reiserfs/ioctl.c
+++ b/fs/reiserfs/ioctl.c
@@ -99,7 +99,7 @@ int reiserfs_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
99long reiserfs_compat_ioctl(struct file *file, unsigned int cmd, 99long reiserfs_compat_ioctl(struct file *file, unsigned int cmd,
100 unsigned long arg) 100 unsigned long arg)
101{ 101{
102 struct inode *inode = file->f_dentry->d_inode; 102 struct inode *inode = file->f_path.dentry->d_inode;
103 int ret; 103 int ret;
104 104
105 /* These are just misnamed, they actually get/put from/to user an int */ 105 /* These are just misnamed, they actually get/put from/to user an int */
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index 85ce23268302..7280a23ef344 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -104,7 +104,7 @@ static int release_journal_dev(struct super_block *super,
104 struct reiserfs_journal *journal); 104 struct reiserfs_journal *journal);
105static int dirty_one_transaction(struct super_block *s, 105static int dirty_one_transaction(struct super_block *s,
106 struct reiserfs_journal_list *jl); 106 struct reiserfs_journal_list *jl);
107static void flush_async_commits(void *p); 107static void flush_async_commits(struct work_struct *work);
108static void queue_log_writer(struct super_block *s); 108static void queue_log_writer(struct super_block *s);
109 109
110/* values for join in do_journal_begin_r */ 110/* values for join in do_journal_begin_r */
@@ -1464,7 +1464,7 @@ static int flush_journal_list(struct super_block *s,
1464 } 1464 }
1465 1465
1466 /* if someone has this block in a newer transaction, just make 1466 /* if someone has this block in a newer transaction, just make
1467 ** sure they are commited, and don't try writing it to disk 1467 ** sure they are committed, and don't try writing it to disk
1468 */ 1468 */
1469 if (pjl) { 1469 if (pjl) {
1470 if (atomic_read(&pjl->j_commit_left)) 1470 if (atomic_read(&pjl->j_commit_left))
@@ -2836,7 +2836,8 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
2836 if (reiserfs_mounted_fs_count <= 1) 2836 if (reiserfs_mounted_fs_count <= 1)
2837 commit_wq = create_workqueue("reiserfs"); 2837 commit_wq = create_workqueue("reiserfs");
2838 2838
2839 INIT_WORK(&journal->j_work, flush_async_commits, p_s_sb); 2839 INIT_DELAYED_WORK(&journal->j_work, flush_async_commits);
2840 journal->j_work_sb = p_s_sb;
2840 return 0; 2841 return 0;
2841 free_and_return: 2842 free_and_return:
2842 free_journal_ram(p_s_sb); 2843 free_journal_ram(p_s_sb);
@@ -3384,7 +3385,7 @@ static int remove_from_transaction(struct super_block *p_s_sb,
3384 3385
3385/* 3386/*
3386** for any cnode in a journal list, it can only be dirtied of all the 3387** for any cnode in a journal list, it can only be dirtied of all the
3387** transactions that include it are commited to disk. 3388** transactions that include it are committed to disk.
3388** this checks through each transaction, and returns 1 if you are allowed to dirty, 3389** this checks through each transaction, and returns 1 if you are allowed to dirty,
3389** and 0 if you aren't 3390** and 0 if you aren't
3390** 3391**
@@ -3426,7 +3427,7 @@ static int can_dirty(struct reiserfs_journal_cnode *cn)
3426} 3427}
3427 3428
3428/* syncs the commit blocks, but does not force the real buffers to disk 3429/* syncs the commit blocks, but does not force the real buffers to disk
3429** will wait until the current transaction is done/commited before returning 3430** will wait until the current transaction is done/committed before returning
3430*/ 3431*/
3431int journal_end_sync(struct reiserfs_transaction_handle *th, 3432int journal_end_sync(struct reiserfs_transaction_handle *th,
3432 struct super_block *p_s_sb, unsigned long nblocks) 3433 struct super_block *p_s_sb, unsigned long nblocks)
@@ -3447,10 +3448,11 @@ int journal_end_sync(struct reiserfs_transaction_handle *th,
3447/* 3448/*
3448** writeback the pending async commits to disk 3449** writeback the pending async commits to disk
3449*/ 3450*/
3450static void flush_async_commits(void *p) 3451static void flush_async_commits(struct work_struct *work)
3451{ 3452{
3452 struct super_block *p_s_sb = p; 3453 struct reiserfs_journal *journal =
3453 struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); 3454 container_of(work, struct reiserfs_journal, j_work.work);
3455 struct super_block *p_s_sb = journal->j_work_sb;
3454 struct reiserfs_journal_list *jl; 3456 struct reiserfs_journal_list *jl;
3455 struct list_head *entry; 3457 struct list_head *entry;
3456 3458
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c
index abde1edc2235..23f5cd5bbf56 100644
--- a/fs/reiserfs/namei.c
+++ b/fs/reiserfs/namei.c
@@ -54,7 +54,7 @@ static int bin_search_in_dir_item(struct reiserfs_dir_entry *de, loff_t off)
54 54
55// comment? maybe something like set de to point to what the path points to? 55// comment? maybe something like set de to point to what the path points to?
56static inline void set_de_item_location(struct reiserfs_dir_entry *de, 56static inline void set_de_item_location(struct reiserfs_dir_entry *de,
57 struct path *path) 57 struct treepath *path)
58{ 58{
59 de->de_bh = get_last_bh(path); 59 de->de_bh = get_last_bh(path);
60 de->de_ih = get_ih(path); 60 de->de_ih = get_ih(path);
@@ -113,7 +113,7 @@ entry position in the item
113 113
114/* The function is NOT SCHEDULE-SAFE! */ 114/* The function is NOT SCHEDULE-SAFE! */
115int search_by_entry_key(struct super_block *sb, const struct cpu_key *key, 115int search_by_entry_key(struct super_block *sb, const struct cpu_key *key,
116 struct path *path, struct reiserfs_dir_entry *de) 116 struct treepath *path, struct reiserfs_dir_entry *de)
117{ 117{
118 int retval; 118 int retval;
119 119
@@ -282,7 +282,7 @@ static int linear_search_in_dir_item(struct cpu_key *key,
282// may return NAME_FOUND, NAME_FOUND_INVISIBLE, NAME_NOT_FOUND 282// may return NAME_FOUND, NAME_FOUND_INVISIBLE, NAME_NOT_FOUND
283// FIXME: should add something like IOERROR 283// FIXME: should add something like IOERROR
284static int reiserfs_find_entry(struct inode *dir, const char *name, int namelen, 284static int reiserfs_find_entry(struct inode *dir, const char *name, int namelen,
285 struct path *path_to_entry, 285 struct treepath *path_to_entry,
286 struct reiserfs_dir_entry *de) 286 struct reiserfs_dir_entry *de)
287{ 287{
288 struct cpu_key key_to_search; 288 struct cpu_key key_to_search;
diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c
index c533ec1bcaec..ecc9943202fc 100644
--- a/fs/reiserfs/procfs.c
+++ b/fs/reiserfs/procfs.c
@@ -295,7 +295,7 @@ static int show_oidmap(struct seq_file *m, struct super_block *sb)
295 } 295 }
296#if defined( REISERFS_USE_OIDMAPF ) 296#if defined( REISERFS_USE_OIDMAPF )
297 if (sb_info->oidmap.use_file && (sb_info->oidmap.mapf != NULL)) { 297 if (sb_info->oidmap.use_file && (sb_info->oidmap.mapf != NULL)) {
298 loff_t size = sb_info->oidmap.mapf->f_dentry->d_inode->i_size; 298 loff_t size = sb_info->oidmap.mapf->f_path.dentry->d_inode->i_size;
299 total_used += size / sizeof(reiserfs_oidinterval_d_t); 299 total_used += size / sizeof(reiserfs_oidinterval_d_t);
300 } 300 }
301#endif 301#endif
diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c
index 5240abe1a709..afb21ea45302 100644
--- a/fs/reiserfs/stree.c
+++ b/fs/reiserfs/stree.c
@@ -244,7 +244,7 @@ static const struct reiserfs_key MAX_KEY = {
244 of the path, and going upwards. We must check the path's validity at each step. If the key is not in 244 of the path, and going upwards. We must check the path's validity at each step. If the key is not in
245 the path, there is no delimiting key in the tree (buffer is first or last buffer in tree), and in this 245 the path, there is no delimiting key in the tree (buffer is first or last buffer in tree), and in this
246 case we return a special key, either MIN_KEY or MAX_KEY. */ 246 case we return a special key, either MIN_KEY or MAX_KEY. */
247static inline const struct reiserfs_key *get_lkey(const struct path 247static inline const struct reiserfs_key *get_lkey(const struct treepath
248 *p_s_chk_path, 248 *p_s_chk_path,
249 const struct super_block 249 const struct super_block
250 *p_s_sb) 250 *p_s_sb)
@@ -290,7 +290,7 @@ static inline const struct reiserfs_key *get_lkey(const struct path
290} 290}
291 291
292/* Get delimiting key of the buffer at the path and its right neighbor. */ 292/* Get delimiting key of the buffer at the path and its right neighbor. */
293inline const struct reiserfs_key *get_rkey(const struct path *p_s_chk_path, 293inline const struct reiserfs_key *get_rkey(const struct treepath *p_s_chk_path,
294 const struct super_block *p_s_sb) 294 const struct super_block *p_s_sb)
295{ 295{
296 int n_position, n_path_offset = p_s_chk_path->path_length; 296 int n_position, n_path_offset = p_s_chk_path->path_length;
@@ -337,7 +337,7 @@ inline const struct reiserfs_key *get_rkey(const struct path *p_s_chk_path,
337 the path. These delimiting keys are stored at least one level above that buffer in the tree. If the 337 the path. These delimiting keys are stored at least one level above that buffer in the tree. If the
338 buffer is the first or last node in the tree order then one of the delimiting keys may be absent, and in 338 buffer is the first or last node in the tree order then one of the delimiting keys may be absent, and in
339 this case get_lkey and get_rkey return a special key which is MIN_KEY or MAX_KEY. */ 339 this case get_lkey and get_rkey return a special key which is MIN_KEY or MAX_KEY. */
340static inline int key_in_buffer(struct path *p_s_chk_path, /* Path which should be checked. */ 340static inline int key_in_buffer(struct treepath *p_s_chk_path, /* Path which should be checked. */
341 const struct cpu_key *p_s_key, /* Key which should be checked. */ 341 const struct cpu_key *p_s_key, /* Key which should be checked. */
342 struct super_block *p_s_sb /* Super block pointer. */ 342 struct super_block *p_s_sb /* Super block pointer. */
343 ) 343 )
@@ -374,7 +374,7 @@ inline void decrement_bcount(struct buffer_head *p_s_bh)
374} 374}
375 375
376/* Decrement b_count field of the all buffers in the path. */ 376/* Decrement b_count field of the all buffers in the path. */
377void decrement_counters_in_path(struct path *p_s_search_path) 377void decrement_counters_in_path(struct treepath *p_s_search_path)
378{ 378{
379 int n_path_offset = p_s_search_path->path_length; 379 int n_path_offset = p_s_search_path->path_length;
380 380
@@ -391,7 +391,7 @@ void decrement_counters_in_path(struct path *p_s_search_path)
391 p_s_search_path->path_length = ILLEGAL_PATH_ELEMENT_OFFSET; 391 p_s_search_path->path_length = ILLEGAL_PATH_ELEMENT_OFFSET;
392} 392}
393 393
394int reiserfs_check_path(struct path *p) 394int reiserfs_check_path(struct treepath *p)
395{ 395{
396 RFALSE(p->path_length != ILLEGAL_PATH_ELEMENT_OFFSET, 396 RFALSE(p->path_length != ILLEGAL_PATH_ELEMENT_OFFSET,
397 "path not properly relsed"); 397 "path not properly relsed");
@@ -403,7 +403,7 @@ int reiserfs_check_path(struct path *p)
403** 403**
404** only called from fix_nodes() 404** only called from fix_nodes()
405*/ 405*/
406void pathrelse_and_restore(struct super_block *s, struct path *p_s_search_path) 406void pathrelse_and_restore(struct super_block *s, struct treepath *p_s_search_path)
407{ 407{
408 int n_path_offset = p_s_search_path->path_length; 408 int n_path_offset = p_s_search_path->path_length;
409 409
@@ -421,7 +421,7 @@ void pathrelse_and_restore(struct super_block *s, struct path *p_s_search_path)
421} 421}
422 422
423/* Release all buffers in the path. */ 423/* Release all buffers in the path. */
424void pathrelse(struct path *p_s_search_path) 424void pathrelse(struct treepath *p_s_search_path)
425{ 425{
426 int n_path_offset = p_s_search_path->path_length; 426 int n_path_offset = p_s_search_path->path_length;
427 427
@@ -602,7 +602,7 @@ static void search_by_key_reada(struct super_block *s,
602 correctness of the bottom of the path */ 602 correctness of the bottom of the path */
603/* The function is NOT SCHEDULE-SAFE! */ 603/* The function is NOT SCHEDULE-SAFE! */
604int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /* Key to search. */ 604int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /* Key to search. */
605 struct path *p_s_search_path, /* This structure was 605 struct treepath *p_s_search_path,/* This structure was
606 allocated and initialized 606 allocated and initialized
607 by the calling 607 by the calling
608 function. It is filled up 608 function. It is filled up
@@ -813,7 +813,7 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /*
813/* The function is NOT SCHEDULE-SAFE! */ 813/* The function is NOT SCHEDULE-SAFE! */
814int search_for_position_by_key(struct super_block *p_s_sb, /* Pointer to the super block. */ 814int search_for_position_by_key(struct super_block *p_s_sb, /* Pointer to the super block. */
815 const struct cpu_key *p_cpu_key, /* Key to search (cpu variable) */ 815 const struct cpu_key *p_cpu_key, /* Key to search (cpu variable) */
816 struct path *p_s_search_path /* Filled up by this function. */ 816 struct treepath *p_s_search_path /* Filled up by this function. */
817 ) 817 )
818{ 818{
819 struct item_head *p_le_ih; /* pointer to on-disk structure */ 819 struct item_head *p_le_ih; /* pointer to on-disk structure */
@@ -884,7 +884,7 @@ int search_for_position_by_key(struct super_block *p_s_sb, /* Pointer to the sup
884} 884}
885 885
886/* Compare given item and item pointed to by the path. */ 886/* Compare given item and item pointed to by the path. */
887int comp_items(const struct item_head *stored_ih, const struct path *p_s_path) 887int comp_items(const struct item_head *stored_ih, const struct treepath *p_s_path)
888{ 888{
889 struct buffer_head *p_s_bh; 889 struct buffer_head *p_s_bh;
890 struct item_head *ih; 890 struct item_head *ih;
@@ -911,7 +911,7 @@ int comp_items(const struct item_head *stored_ih, const struct path *p_s_path)
911#define block_in_use(bh) (buffer_locked(bh) || (held_by_others(bh))) 911#define block_in_use(bh) (buffer_locked(bh) || (held_by_others(bh)))
912 912
913// prepare for delete or cut of direct item 913// prepare for delete or cut of direct item
914static inline int prepare_for_direct_item(struct path *path, 914static inline int prepare_for_direct_item(struct treepath *path,
915 struct item_head *le_ih, 915 struct item_head *le_ih,
916 struct inode *inode, 916 struct inode *inode,
917 loff_t new_file_length, int *cut_size) 917 loff_t new_file_length, int *cut_size)
@@ -952,7 +952,7 @@ static inline int prepare_for_direct_item(struct path *path,
952 return M_CUT; /* Cut from this item. */ 952 return M_CUT; /* Cut from this item. */
953} 953}
954 954
955static inline int prepare_for_direntry_item(struct path *path, 955static inline int prepare_for_direntry_item(struct treepath *path,
956 struct item_head *le_ih, 956 struct item_head *le_ih,
957 struct inode *inode, 957 struct inode *inode,
958 loff_t new_file_length, 958 loff_t new_file_length,
@@ -987,7 +987,7 @@ static inline int prepare_for_direntry_item(struct path *path,
987 In case of file truncate calculate whether this item must be deleted/truncated or last 987 In case of file truncate calculate whether this item must be deleted/truncated or last
988 unformatted node of this item will be converted to a direct item. 988 unformatted node of this item will be converted to a direct item.
989 This function returns a determination of what balance mode the calling function should employ. */ 989 This function returns a determination of what balance mode the calling function should employ. */
990static char prepare_for_delete_or_cut(struct reiserfs_transaction_handle *th, struct inode *inode, struct path *p_s_path, const struct cpu_key *p_s_item_key, int *p_n_removed, /* Number of unformatted nodes which were removed 990static char prepare_for_delete_or_cut(struct reiserfs_transaction_handle *th, struct inode *inode, struct treepath *p_s_path, const struct cpu_key *p_s_item_key, int *p_n_removed, /* Number of unformatted nodes which were removed
991 from end of the file. */ 991 from end of the file. */
992 int *p_n_cut_size, unsigned long long n_new_file_length /* MAX_KEY_OFFSET in case of delete. */ 992 int *p_n_cut_size, unsigned long long n_new_file_length /* MAX_KEY_OFFSET in case of delete. */
993 ) 993 )
@@ -1125,7 +1125,7 @@ static int calc_deleted_bytes_number(struct tree_balance *p_s_tb, char c_mode)
1125static void init_tb_struct(struct reiserfs_transaction_handle *th, 1125static void init_tb_struct(struct reiserfs_transaction_handle *th,
1126 struct tree_balance *p_s_tb, 1126 struct tree_balance *p_s_tb,
1127 struct super_block *p_s_sb, 1127 struct super_block *p_s_sb,
1128 struct path *p_s_path, int n_size) 1128 struct treepath *p_s_path, int n_size)
1129{ 1129{
1130 1130
1131 BUG_ON(!th->t_trans_id); 1131 BUG_ON(!th->t_trans_id);
@@ -1176,7 +1176,7 @@ char head2type(struct item_head *ih)
1176#endif 1176#endif
1177 1177
1178/* Delete object item. */ 1178/* Delete object item. */
1179int reiserfs_delete_item(struct reiserfs_transaction_handle *th, struct path *p_s_path, /* Path to the deleted item. */ 1179int reiserfs_delete_item(struct reiserfs_transaction_handle *th, struct treepath *p_s_path, /* Path to the deleted item. */
1180 const struct cpu_key *p_s_item_key, /* Key to search for the deleted item. */ 1180 const struct cpu_key *p_s_item_key, /* Key to search for the deleted item. */
1181 struct inode *p_s_inode, /* inode is here just to update i_blocks and quotas */ 1181 struct inode *p_s_inode, /* inode is here just to update i_blocks and quotas */
1182 struct buffer_head *p_s_un_bh) 1182 struct buffer_head *p_s_un_bh)
@@ -1459,7 +1459,7 @@ static void unmap_buffers(struct page *page, loff_t pos)
1459 bh = next; 1459 bh = next;
1460 } while (bh != head); 1460 } while (bh != head);
1461 if (PAGE_SIZE == bh->b_size) { 1461 if (PAGE_SIZE == bh->b_size) {
1462 clear_page_dirty(page); 1462 cancel_dirty_page(page, PAGE_CACHE_SIZE);
1463 } 1463 }
1464 } 1464 }
1465 } 1465 }
@@ -1468,7 +1468,7 @@ static void unmap_buffers(struct page *page, loff_t pos)
1468static int maybe_indirect_to_direct(struct reiserfs_transaction_handle *th, 1468static int maybe_indirect_to_direct(struct reiserfs_transaction_handle *th,
1469 struct inode *p_s_inode, 1469 struct inode *p_s_inode,
1470 struct page *page, 1470 struct page *page,
1471 struct path *p_s_path, 1471 struct treepath *p_s_path,
1472 const struct cpu_key *p_s_item_key, 1472 const struct cpu_key *p_s_item_key,
1473 loff_t n_new_file_size, char *p_c_mode) 1473 loff_t n_new_file_size, char *p_c_mode)
1474{ 1474{
@@ -1503,7 +1503,7 @@ static int maybe_indirect_to_direct(struct reiserfs_transaction_handle *th,
1503 pointer being converted. Therefore we have to delete inserted 1503 pointer being converted. Therefore we have to delete inserted
1504 direct item(s) */ 1504 direct item(s) */
1505static void indirect_to_direct_roll_back(struct reiserfs_transaction_handle *th, 1505static void indirect_to_direct_roll_back(struct reiserfs_transaction_handle *th,
1506 struct inode *inode, struct path *path) 1506 struct inode *inode, struct treepath *path)
1507{ 1507{
1508 struct cpu_key tail_key; 1508 struct cpu_key tail_key;
1509 int tail_len; 1509 int tail_len;
@@ -1545,7 +1545,7 @@ static void indirect_to_direct_roll_back(struct reiserfs_transaction_handle *th,
1545 1545
1546/* (Truncate or cut entry) or delete object item. Returns < 0 on failure */ 1546/* (Truncate or cut entry) or delete object item. Returns < 0 on failure */
1547int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, 1547int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th,
1548 struct path *p_s_path, 1548 struct treepath *p_s_path,
1549 struct cpu_key *p_s_item_key, 1549 struct cpu_key *p_s_item_key,
1550 struct inode *p_s_inode, 1550 struct inode *p_s_inode,
1551 struct page *page, loff_t n_new_file_size) 1551 struct page *page, loff_t n_new_file_size)
@@ -1920,7 +1920,7 @@ int reiserfs_do_truncate(struct reiserfs_transaction_handle *th, struct inode *p
1920 1920
1921#ifdef CONFIG_REISERFS_CHECK 1921#ifdef CONFIG_REISERFS_CHECK
1922// this makes sure, that we __append__, not overwrite or add holes 1922// this makes sure, that we __append__, not overwrite or add holes
1923static void check_research_for_paste(struct path *path, 1923static void check_research_for_paste(struct treepath *path,
1924 const struct cpu_key *p_s_key) 1924 const struct cpu_key *p_s_key)
1925{ 1925{
1926 struct item_head *found_ih = get_ih(path); 1926 struct item_head *found_ih = get_ih(path);
@@ -1954,7 +1954,7 @@ static void check_research_for_paste(struct path *path,
1954#endif /* config reiserfs check */ 1954#endif /* config reiserfs check */
1955 1955
1956/* Paste bytes to the existing item. Returns bytes number pasted into the item. */ 1956/* Paste bytes to the existing item. Returns bytes number pasted into the item. */
1957int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct path *p_s_search_path, /* Path to the pasted item. */ 1957int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct treepath *p_s_search_path, /* Path to the pasted item. */
1958 const struct cpu_key *p_s_key, /* Key to search for the needed item. */ 1958 const struct cpu_key *p_s_key, /* Key to search for the needed item. */
1959 struct inode *inode, /* Inode item belongs to */ 1959 struct inode *inode, /* Inode item belongs to */
1960 const char *p_c_body, /* Pointer to the bytes to paste. */ 1960 const char *p_c_body, /* Pointer to the bytes to paste. */
@@ -2036,7 +2036,7 @@ int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct path
2036} 2036}
2037 2037
2038/* Insert new item into the buffer at the path. */ 2038/* Insert new item into the buffer at the path. */
2039int reiserfs_insert_item(struct reiserfs_transaction_handle *th, struct path *p_s_path, /* Path to the inserteded item. */ 2039int reiserfs_insert_item(struct reiserfs_transaction_handle *th, struct treepath *p_s_path, /* Path to the inserteded item. */
2040 const struct cpu_key *key, struct item_head *p_s_ih, /* Pointer to the item header to insert. */ 2040 const struct cpu_key *key, struct item_head *p_s_ih, /* Pointer to the item header to insert. */
2041 struct inode *inode, const char *p_c_body) 2041 struct inode *inode, const char *p_c_body)
2042{ /* Pointer to the bytes to insert. */ 2042{ /* Pointer to the bytes to insert. */
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 17249994110f..58ad4551a7c1 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -23,7 +23,7 @@
23#include <linux/blkdev.h> 23#include <linux/blkdev.h>
24#include <linux/buffer_head.h> 24#include <linux/buffer_head.h>
25#include <linux/vfs.h> 25#include <linux/vfs.h>
26#include <linux/namespace.h> 26#include <linux/mnt_namespace.h>
27#include <linux/mount.h> 27#include <linux/mount.h>
28#include <linux/namei.h> 28#include <linux/namei.h>
29#include <linux/quotaops.h> 29#include <linux/quotaops.h>
@@ -490,13 +490,13 @@ static void reiserfs_put_super(struct super_block *s)
490 return; 490 return;
491} 491}
492 492
493static kmem_cache_t *reiserfs_inode_cachep; 493static struct kmem_cache *reiserfs_inode_cachep;
494 494
495static struct inode *reiserfs_alloc_inode(struct super_block *sb) 495static struct inode *reiserfs_alloc_inode(struct super_block *sb)
496{ 496{
497 struct reiserfs_inode_info *ei; 497 struct reiserfs_inode_info *ei;
498 ei = (struct reiserfs_inode_info *) 498 ei = (struct reiserfs_inode_info *)
499 kmem_cache_alloc(reiserfs_inode_cachep, SLAB_KERNEL); 499 kmem_cache_alloc(reiserfs_inode_cachep, GFP_KERNEL);
500 if (!ei) 500 if (!ei)
501 return NULL; 501 return NULL;
502 return &ei->vfs_inode; 502 return &ei->vfs_inode;
@@ -507,7 +507,7 @@ static void reiserfs_destroy_inode(struct inode *inode)
507 kmem_cache_free(reiserfs_inode_cachep, REISERFS_I(inode)); 507 kmem_cache_free(reiserfs_inode_cachep, REISERFS_I(inode));
508} 508}
509 509
510static void init_once(void *foo, kmem_cache_t * cachep, unsigned long flags) 510static void init_once(void *foo, struct kmem_cache * cachep, unsigned long flags)
511{ 511{
512 struct reiserfs_inode_info *ei = (struct reiserfs_inode_info *)foo; 512 struct reiserfs_inode_info *ei = (struct reiserfs_inode_info *)foo;
513 513
@@ -1549,13 +1549,12 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
1549 struct reiserfs_sb_info *sbi; 1549 struct reiserfs_sb_info *sbi;
1550 int errval = -EINVAL; 1550 int errval = -EINVAL;
1551 1551
1552 sbi = kmalloc(sizeof(struct reiserfs_sb_info), GFP_KERNEL); 1552 sbi = kzalloc(sizeof(struct reiserfs_sb_info), GFP_KERNEL);
1553 if (!sbi) { 1553 if (!sbi) {
1554 errval = -ENOMEM; 1554 errval = -ENOMEM;
1555 goto error; 1555 goto error;
1556 } 1556 }
1557 s->s_fs_info = sbi; 1557 s->s_fs_info = sbi;
1558 memset(sbi, 0, sizeof(struct reiserfs_sb_info));
1559 /* Set default values for options: non-aggressive tails, RO on errors */ 1558 /* Set default values for options: non-aggressive tails, RO on errors */
1560 REISERFS_SB(s)->s_mount_opt |= (1 << REISERFS_SMALLTAIL); 1559 REISERFS_SB(s)->s_mount_opt |= (1 << REISERFS_SMALLTAIL);
1561 REISERFS_SB(s)->s_mount_opt |= (1 << REISERFS_ERROR_RO); 1560 REISERFS_SB(s)->s_mount_opt |= (1 << REISERFS_ERROR_RO);
diff --git a/fs/reiserfs/tail_conversion.c b/fs/reiserfs/tail_conversion.c
index 36f108fc1cf5..f8121a1147e8 100644
--- a/fs/reiserfs/tail_conversion.c
+++ b/fs/reiserfs/tail_conversion.c
@@ -15,7 +15,7 @@
15/* path points to first direct item of the file regarless of how many of 15/* path points to first direct item of the file regarless of how many of
16 them are there */ 16 them are there */
17int direct2indirect(struct reiserfs_transaction_handle *th, struct inode *inode, 17int direct2indirect(struct reiserfs_transaction_handle *th, struct inode *inode,
18 struct path *path, struct buffer_head *unbh, 18 struct treepath *path, struct buffer_head *unbh,
19 loff_t tail_offset) 19 loff_t tail_offset)
20{ 20{
21 struct super_block *sb = inode->i_sb; 21 struct super_block *sb = inode->i_sb;
@@ -171,7 +171,7 @@ void reiserfs_unmap_buffer(struct buffer_head *bh)
171 what we expect from it (number of cut bytes). But when tail remains 171 what we expect from it (number of cut bytes). But when tail remains
172 in the unformatted node, we set mode to SKIP_BALANCING and unlock 172 in the unformatted node, we set mode to SKIP_BALANCING and unlock
173 inode */ 173 inode */
174int indirect2direct(struct reiserfs_transaction_handle *th, struct inode *p_s_inode, struct page *page, struct path *p_s_path, /* path to the indirect item. */ 174int indirect2direct(struct reiserfs_transaction_handle *th, struct inode *p_s_inode, struct page *page, struct treepath *p_s_path, /* path to the indirect item. */
175 const struct cpu_key *p_s_item_key, /* Key to look for unformatted node pointer to be cut. */ 175 const struct cpu_key *p_s_item_key, /* Key to look for unformatted node pointer to be cut. */
176 loff_t n_new_file_size, /* New file size. */ 176 loff_t n_new_file_size, /* New file size. */
177 char *p_c_mode) 177 char *p_c_mode)
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
index 7bdb0ed443e1..f01389fd162e 100644
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -41,7 +41,7 @@
41#include <linux/reiserfs_xattr.h> 41#include <linux/reiserfs_xattr.h>
42#include <linux/reiserfs_acl.h> 42#include <linux/reiserfs_acl.h>
43#include <asm/uaccess.h> 43#include <asm/uaccess.h>
44#include <asm/checksum.h> 44#include <net/checksum.h>
45#include <linux/smp_lock.h> 45#include <linux/smp_lock.h>
46#include <linux/stat.h> 46#include <linux/stat.h>
47#include <asm/semaphore.h> 47#include <asm/semaphore.h>
@@ -274,7 +274,7 @@ static struct file *open_xa_file(const struct inode *inode, const char *name,
274 */ 274 */
275static int __xattr_readdir(struct file *filp, void *dirent, filldir_t filldir) 275static int __xattr_readdir(struct file *filp, void *dirent, filldir_t filldir)
276{ 276{
277 struct inode *inode = filp->f_dentry->d_inode; 277 struct inode *inode = filp->f_path.dentry->d_inode;
278 struct cpu_key pos_key; /* key of current position in the directory (key of directory entry) */ 278 struct cpu_key pos_key; /* key of current position in the directory (key of directory entry) */
279 INITIALIZE_PATH(path_to_entry); 279 INITIALIZE_PATH(path_to_entry);
280 struct buffer_head *bh; 280 struct buffer_head *bh;
@@ -420,7 +420,7 @@ static int __xattr_readdir(struct file *filp, void *dirent, filldir_t filldir)
420static 420static
421int xattr_readdir(struct file *file, filldir_t filler, void *buf) 421int xattr_readdir(struct file *file, filldir_t filler, void *buf)
422{ 422{
423 struct inode *inode = file->f_dentry->d_inode; 423 struct inode *inode = file->f_path.dentry->d_inode;
424 int res = -ENOTDIR; 424 int res = -ENOTDIR;
425 if (!file->f_op || !file->f_op->readdir) 425 if (!file->f_op || !file->f_op->readdir)
426 goto out; 426 goto out;
@@ -508,7 +508,7 @@ reiserfs_xattr_set(struct inode *inode, const char *name, const void *buffer,
508 goto out; 508 goto out;
509 } 509 }
510 510
511 xinode = fp->f_dentry->d_inode; 511 xinode = fp->f_path.dentry->d_inode;
512 REISERFS_I(inode)->i_flags |= i_has_xattr_dir; 512 REISERFS_I(inode)->i_flags |= i_has_xattr_dir;
513 513
514 /* we need to copy it off.. */ 514 /* we need to copy it off.. */
@@ -527,7 +527,7 @@ reiserfs_xattr_set(struct inode *inode, const char *name, const void *buffer,
527 newattrs.ia_size = buffer_size; 527 newattrs.ia_size = buffer_size;
528 newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME; 528 newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;
529 mutex_lock(&xinode->i_mutex); 529 mutex_lock(&xinode->i_mutex);
530 err = notify_change(fp->f_dentry, &newattrs); 530 err = notify_change(fp->f_path.dentry, &newattrs);
531 if (err) 531 if (err)
532 goto out_filp; 532 goto out_filp;
533 533
@@ -626,7 +626,7 @@ reiserfs_xattr_get(const struct inode *inode, const char *name, void *buffer,
626 goto out; 626 goto out;
627 } 627 }
628 628
629 xinode = fp->f_dentry->d_inode; 629 xinode = fp->f_path.dentry->d_inode;
630 isize = xinode->i_size; 630 isize = xinode->i_size;
631 REISERFS_I(inode)->i_flags |= i_has_xattr_dir; 631 REISERFS_I(inode)->i_flags |= i_has_xattr_dir;
632 632
diff --git a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c
index 97ae1b92bc47..5296a29cc5eb 100644
--- a/fs/reiserfs/xattr_acl.c
+++ b/fs/reiserfs/xattr_acl.c
@@ -135,7 +135,7 @@ static void *posix_acl_to_disk(const struct posix_acl *acl, size_t * size)
135 int n; 135 int n;
136 136
137 *size = reiserfs_acl_size(acl->a_count); 137 *size = reiserfs_acl_size(acl->a_count);
138 ext_acl = (reiserfs_acl_header *) kmalloc(sizeof(reiserfs_acl_header) + 138 ext_acl = kmalloc(sizeof(reiserfs_acl_header) +
139 acl->a_count * 139 acl->a_count *
140 sizeof(reiserfs_acl_entry), 140 sizeof(reiserfs_acl_entry),
141 GFP_NOFS); 141 GFP_NOFS);