why ->delete_inode() instead of ->clear_inode()?
Al Viro
maintainerIs there any problem with simply doing
void sysfs_clear_inode(struct inode *inode)
{
struct sysfs_dirent *sd = inode->i_private;
sysfs_put(sd);
}instead of (mis)using ->delete_inode()? Note that clear_inode() is not going to be called on any inodes with positive i_count, that you are forcibly evicting them from icache on the final iput() anyway and that clear_inode() is never called twice on the same struct inode()...
Al, very unenthusiastic about ->delete_inode() instances in general - that sucker gets abused in the strangest ways by a lot of filesystems ;-/
Quoted 7 lines · Al Viro
Is there any problem with simply doing
void
sysfs_clear_inode(struct inode *inode){ struct sysfs_dirent *sd = inode->i_private; sysfs_put(sd); }
I can't see any problems with a quick review.
Given that drop_inode calls generic_delete_inode I don't see that changing that will make any difference in the case of sysfs.
I can't remember why I did it that way but I can say nothing terribly subtle is going on. We need a reference to the sysfs_dirent from the inode and when the inode goes away we need to clear the reference.
Quoted 1 line
From the look of things
proc_delete_inodecan also be changed to aclear_inode
method if that is preferred.
Eric
Al Viro
maintainerQuoted 2 lines · Eric W. Biederman
Quoted 1 line
From the look of things
proc_delete_inodecan also be changed to aclear_inodemethod if that is preferred.
Already that way in the local tree, along with quite a few other filesystems...
Quoted 6 lines · Al Viro
Quoted 2 lines · Eric W. Biederman
Quoted 1 line
From the look of things
proc_delete_inodecan also be changed to aclear_inodemethod if that is preferred.
Already that way in the local tree, along with quite a few other filesystems...
It has been my goal, to get sysfs looking roughly like other filesystems in the kernel. I'm glad to see that sysfs is finally looking enough like other filesystems it can participate in global cleanups.
Eric