summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-06-21 01:44:39 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-06-21 01:44:39 +0000
commit5205a16d8870cdd4cc524589de3e09ad176d129a (patch)
tree6deddf1269b9e6f13f2fa00529cd4674c3b2a3fa /fs
parente8b2e78e4f14d329f2cdfb8ef7ed3582c71454e5 (diff)
Merge with Linux 2.4.0-ac22-riel.
Diffstat (limited to 'fs')
-rw-r--r--fs/buffer.c40
-rw-r--r--fs/nfs/proc.c2
2 files changed, 15 insertions, 27 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index d4e5991d9..432877cdd 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -1451,46 +1451,34 @@ static void unmap_buffer(struct buffer_head * bh)
* any IO, we are not interested in the contents of the buffer. This
* function can block if the buffer is locked.
*/
-static struct buffer_head *discard_buffer(struct buffer_head * bh)
+static inline struct buffer_head *discard_buffer(struct buffer_head * bh)
{
- int index = BUFSIZE_INDEX(bh->b_size);
struct buffer_head *next;
- /* grab the lru lock here to block bdflush. */
- atomic_inc(&bh->b_count);
- lock_buffer(bh);
+ if (bh->b_dev == B_FREE)
+ BUG();
+
next = bh->b_this_page;
- clear_bit(BH_Uptodate, &bh->b_state);
- clear_bit(BH_Mapped, &bh->b_state);
- clear_bit(BH_Req, &bh->b_state);
- clear_bit(BH_New, &bh->b_state);
+
+ unmap_buffer(bh);
spin_lock(&lru_list_lock);
write_lock(&hash_table_lock);
- spin_lock(&free_list[index].lock);
spin_lock(&unused_list_lock);
- if (!atomic_dec_and_test(&bh->b_count))
+ if (atomic_read(&bh->b_count))
BUG();
__hash_unlink(bh);
- /* The bunffer can be either on the regular
- * queues or on the free list..
- */
- if (bh->b_dev != B_FREE) {
- remove_inode_queue(bh);
- __remove_from_queues(bh);
- }
- else
- __remove_from_free_list(bh, index);
- __put_unused_buffer_head(bh);
- spin_unlock(&unused_list_lock);
write_unlock(&hash_table_lock);
- spin_unlock(&free_list[index].lock);
+
+ remove_inode_queue(bh);
+ __remove_from_lru_list(bh, bh->b_list);
spin_unlock(&lru_list_lock);
- /* We can unlock the buffer, we have just returned it.
- * Ditto for the counter
- */
+
+ __put_unused_buffer_head(bh);
+ spin_unlock(&unused_list_lock);
+
return next;
}
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
index 59e4b0674..373d7296c 100644
--- a/fs/nfs/proc.c
+++ b/fs/nfs/proc.c
@@ -201,7 +201,7 @@ nfs_proc_mknod(struct dentry *dir, struct qstr *name, struct iattr *sattr,
if (S_ISFIFO(mode)) {
sattr->ia_mode = (mode & ~S_IFMT) | S_IFCHR;
sattr->ia_valid &= ~ATTR_SIZE;
- } else if (S_ISCHR(rdev) || S_ISBLK(rdev)) {
+ } else if (S_ISCHR(mode) || S_ISBLK(mode)) {
sattr->ia_valid |= ATTR_SIZE;
sattr->ia_size = rdev; /* get out your barf bag */
}