Question about deleting inode / drop inode

Question about deleting inode / drop inode

Post by Anthony Che » Wed, 10 Apr 2002 12:00:15



I made some modification inode.c for my purpose. I defined myfunc() for my
own use

I modified write_inode as following. My purpose is to use a function to
determine such inode should pass to lower to lower file system (ext2, vfat,
etc) for writing on disk.

static inline void write_inode(struct inode *inode, int sync)
{
    if (myfunc() == 0) {
              if (inode->i_sb && inode->i_sb->s_op &&
inode->i_sb->s_op->write_inode && !is_bad_inode inode)) {
                    inode->i_sb->s_op->write_inode(inode, sync);

  } else {
            if (inode->i_sb && inode->i_sb->s_op &&
inode->i_sb->s_op->write_inode && !is_bad_inode(inode)) {
                    inode->i_sb->s_op->write_inode(inode, sync);
            die(inode);
  }
 }

Quote:}

static inline void die(inode) {
    iput(inode);

Quote:}

I used iput(inode) in this case. Is it right? I supposed the inode will
immediatly deleted after written on disk, and release the block used. But I
found that I still can see such file when I press "ls". I also tried to add
inode->i_nlink = 0 and atomic_set(&inode->i_count, 0) in die(inode) function
before iput(inode), but not success. It may also have input/output error on
that file after I reboot system and "ls".

Or any method to drop the inode (do not pass to lower file system layer,
just delete it in VFS layer) when myfunc() != 0?

Any one can give suggestion on it? Thanks for help. :D

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. I have filled up with inodes on /usr, can I change inode withour reinstall?

I have FreeBSD 4.5, a recent install. When trying to install Pine, and a couple of small apps, I
ran into inode trouble.
I am full of inodes in /usr and have searched everywhere for information about it.
The best so far is http://www.freebsddiary.org/inodes.php
However, I do not know if it is possible to change inode on /usr without corrupting what's there
already? Is it, and if so how?
Furthermore, if it isn't possible, how do I change the inode during sysinstall? I don't think I
have seen it anywhere.

Another inode question. when using the pc, will the inodes slowly increase until I have filled it
again?
I am concerned that after xx months of use, I decide to install another application, and i run
into the same problem again.
If I delete an application, will the inodes connected with that app. disappear, and will it be
available for the next app?

So many questions and hopefully so many answers.
Please cc: me if replying.
Thanks in advance for all help.

kolsen
a fresh, and interested new FreeBSD user

2. Can't install 3.0

3. grow inodes: inode-max limit reached error.

4. How to create DNS on AIX4.3.3?

5. Bad blocks, inodes and .badblocks -> Make root inode 2

6. FreeBSD 2.1.7 & PCMCIA

7. directory inode from file inode?

8. KFM not accepting cookies

9. grow-inodes: inode-max limit reached

10. BSD inodes vs. SYSV inodes?

11. how to access inode structure based on inode number ?

12. fs/inode.c sync fix and fs/ext2/inode.c tidy

13. Ext2 zeros inode in directory entry when deleting files.