• Alexander Viro's avatar
    [PATCH] i_cdev/i_cindex · 9bda5f68
    Alexander Viro authored
    new fields in struct inode - i_cdev and i_cindex.  When we do open() on
    a character device we cache result of cdev lookup in inode and put the
    inode on a cyclic list anchored in cdev.  If we already have that done,
    we don't bother with any lookups.  When inode disappears it's removed
    from the list.  When cdev gets unregistered we remove all cached
    references to it (and remove such inodes from the list).  cdev is held
    until final fput() now.
    9bda5f68
char_dev.c 9.59 KB