diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-01-27 01:05:20 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-01-27 01:05:20 +0000 |
commit | 546db14ee74118296f425f3b91634fb767d67290 (patch) | |
tree | 22b613a3da8d4bf663eec5e155af01b87fdf9094 /fs/inode.c | |
parent | 1e25e41c4f5474e14452094492dbc169b800e4c8 (diff) |
Merge with Linux 2.3.23. The new bootmem stuff has broken various
platforms. At this time I've only verified that IP22 support compiles
and IP27 actually works.
Diffstat (limited to 'fs/inode.c')
-rw-r--r-- | fs/inode.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/fs/inode.c b/fs/inode.c index 55eddfde8..f03295d5c 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -89,6 +89,7 @@ static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags) memset(inode, 0, sizeof(*inode)); init_waitqueue_head(&inode->i_wait); INIT_LIST_HEAD(&inode->i_hash); + INIT_LIST_HEAD(&inode->i_pages); INIT_LIST_HEAD(&inode->i_dentry); sema_init(&inode->i_sem, 1); spin_lock_init(&inode->i_shared_lock); @@ -401,7 +402,7 @@ int shrink_icache_memory(int priority, int gfp_mask) prune_icache(count); /* FIXME: kmem_cache_shrink here should tell us the number of pages freed, and it should - work in a __GFP_DMA/__GFP_BIGMEM behaviour + work in a __GFP_DMA/__GFP_HIGHMEM behaviour to free only the interesting pages in function of the needs of the current allocation. */ kmem_cache_shrink(inode_cachep); @@ -429,7 +430,7 @@ static inline void __iget(struct inode * inode) * by hand after calling find_inode now! This simplify iunique and won't * add any additional branch in the common code. */ -static struct inode * find_inode(struct super_block * sb, unsigned long ino, struct list_head *head) +static struct inode * find_inode(struct super_block * sb, unsigned long ino, struct list_head *head, find_inode_t find_actor, void *opaque) { struct list_head *tmp; struct inode * inode; @@ -445,6 +446,8 @@ static struct inode * find_inode(struct super_block * sb, unsigned long ino, str continue; if (inode->i_ino != ino) continue; + if (find_actor && !find_actor(inode, ino, opaque)) + continue; break; } return inode; @@ -504,7 +507,7 @@ struct inode * get_empty_inode(void) * We no longer cache the sb_flags in i_flags - see fs.h * -- rmk@arm.uk.linux.org */ -static struct inode * get_new_inode(struct super_block *sb, unsigned long ino, struct list_head *head) +static struct inode * get_new_inode(struct super_block *sb, unsigned long ino, struct list_head *head, find_inode_t find_actor, void *opaque) { struct inode * inode; @@ -514,7 +517,7 @@ static struct inode * get_new_inode(struct super_block *sb, unsigned long ino, s spin_lock(&inode_lock); /* We released the lock, so.. */ - old = find_inode(sb, ino, head); + old = find_inode(sb, ino, head, find_actor, opaque); if (!old) { list_add(&inode->i_list, &inode_in_use); @@ -570,7 +573,7 @@ ino_t iunique(struct super_block *sb, ino_t max_reserved) retry: if (counter > max_reserved) { head = inode_hashtable + hash(sb,counter); - inode = find_inode(sb, res = counter++, head); + inode = find_inode(sb, res = counter++, head, NULL, NULL); if (!inode) { spin_unlock(&inode_lock); return res; @@ -595,13 +598,13 @@ struct inode *igrab(struct inode *inode) return inode; } -struct inode *iget(struct super_block *sb, unsigned long ino) +struct inode *iget4(struct super_block *sb, unsigned long ino, find_inode_t find_actor, void *opaque) { struct list_head * head = inode_hashtable + hash(sb,ino); struct inode * inode; spin_lock(&inode_lock); - inode = find_inode(sb, ino, head); + inode = find_inode(sb, ino, head, find_actor, opaque); if (inode) { __iget(inode); spin_unlock(&inode_lock); @@ -614,7 +617,7 @@ struct inode *iget(struct super_block *sb, unsigned long ino) * get_new_inode() will do the right thing, re-trying the search * in case it had to block at any point. */ - return get_new_inode(sb, ino, head); + return get_new_inode(sb, ino, head, find_actor, opaque); } void insert_inode_hash(struct inode *inode) |