summaryrefslogtreecommitdiffstats
path: root/fs/reiserfs
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2001-03-09 20:33:35 +0000
committerRalf Baechle <ralf@linux-mips.org>2001-03-09 20:33:35 +0000
commit116674acc97ba75a720329996877077d988443a2 (patch)
tree6a3f2ff0b612ae2ee8a3f3509370c9e6333a53b3 /fs/reiserfs
parent71118c319fcae4a138f16e35b4f7e0a6d53ce2ca (diff)
Merge with Linux 2.4.2.
Diffstat (limited to 'fs/reiserfs')
-rw-r--r--fs/reiserfs/namei.c14
-rw-r--r--fs/reiserfs/tail_conversion.c14
2 files changed, 18 insertions, 10 deletions
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c
index ffb8920bd..27305305e 100644
--- a/fs/reiserfs/namei.c
+++ b/fs/reiserfs/namei.c
@@ -1,11 +1,21 @@
/*
* Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
+ *
+ * Trivial changes by Alan Cox to remove EHASHCOLLISION for compatibility
+ *
+ * Trivial Changes:
+ * Rights granted to Hans Reiser to redistribute under other terms providing
+ * he accepts all liability including but not limited to patent, fitness
+ * for purpose, and direct or indirect claims arising from failure to perform.
+ *
+ * NO WARRANTY
*/
#ifdef __KERNEL__
#include <linux/config.h>
#include <linux/sched.h>
+#include <linux/bitops.h>
#include <linux/reiserfs_fs.h>
#include <linux/smp_lock.h>
@@ -472,7 +482,7 @@ static int reiserfs_add_entry (struct reiserfs_transaction_handle *th, struct in
if (buffer != small_buf)
reiserfs_kfree (buffer, buflen, dir->i_sb);
pathrelse (&path);
- return -EHASHCOLLISION;//EBADSLT
+ return -EBUSY; //HASHCOLLISION;//EBADSLT
}
/* adjust offset of directory enrty */
deh->deh_offset = cpu_to_le32 (SET_GENERATION_NUMBER (deh_offset (deh), gen_number));
@@ -485,7 +495,7 @@ static int reiserfs_add_entry (struct reiserfs_transaction_handle *th, struct in
if (buffer != small_buf)
reiserfs_kfree (buffer, buflen, dir->i_sb);
pathrelse (&path);
- return -EHASHCOLLISION;
+ return -EBUSY;
}
} else {
deh->deh_offset = cpu_to_le32 (SET_GENERATION_NUMBER (le32_to_cpu (deh->deh_offset), 0));
diff --git a/fs/reiserfs/tail_conversion.c b/fs/reiserfs/tail_conversion.c
index 25da132b6..f8153be3b 100644
--- a/fs/reiserfs/tail_conversion.c
+++ b/fs/reiserfs/tail_conversion.c
@@ -92,7 +92,7 @@ int direct2indirect (struct reiserfs_transaction_handle *th, struct inode * inod
/* Move bytes from the direct items to the new unformatted node
and delete them. */
while (1) {
- int item_len, first_direct;
+ int tail_size;
/* end_key.k_offset is set so, that we will always have found
last item of the file */
@@ -103,13 +103,11 @@ int direct2indirect (struct reiserfs_transaction_handle *th, struct inode * inod
#ifdef CONFIG_REISERFS_CHECK
if (!is_direct_le_ih (p_le_ih))
reiserfs_panic (sb, "vs-14055: direct2indirect: "
- "direct item expected, found %h", p_le_ih);
+ "direct item expected(%k), found %h",
+ &end_key, p_le_ih);
#endif
- if ((le_ih_k_offset (p_le_ih) & (n_blk_size - 1)) == 1)
- first_direct = 1;
- else
- first_direct = 0;
- item_len = le16_to_cpu (p_le_ih->ih_item_len);
+ tail_size = (le_ih_k_offset (p_le_ih) & (n_blk_size - 1))
+ + ih_item_len(p_le_ih) - 1;
/* we only send the unbh pointer if the buffer is not up to date.
** this avoids overwriting good data from writepage() with old data
@@ -123,7 +121,7 @@ int direct2indirect (struct reiserfs_transaction_handle *th, struct inode * inod
n_retval = reiserfs_delete_item (th, path, &end_key, inode,
up_to_date_bh) ;
- if (first_direct && item_len == n_retval)
+ if (tail_size == n_retval)
// done: file does not have direct items anymore
break;