[PATCH 12/21] fat: Kill d_invalidate() in vfat_lookup() - Kernel

This is a discussion on [PATCH 12/21] fat: Kill d_invalidate() in vfat_lookup() - Kernel ; d_invalidate() for positive dentry doesn't work in some cases (vfsmount, nfsd, and maybe others). shrink_dcache_parent() by d_invalidate() is pointless for vfat usage at all. So, this kills it, and intead of it uses d_move(). To save old behavior, this returns ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: [PATCH 12/21] fat: Kill d_invalidate() in vfat_lookup()

  1. [PATCH 12/21] fat: Kill d_invalidate() in vfat_lookup()


    d_invalidate() for positive dentry doesn't work in some cases
    (vfsmount, nfsd, and maybe others). shrink_dcache_parent() by
    d_invalidate() is pointless for vfat usage at all.

    So, this kills it, and intead of it uses d_move().

    To save old behavior, this returns alias simply for directory (don't
    change pwd, etc..). the directory lookup shouldn't be important for
    performance.

    Signed-off-by: OGAWA Hirofumi
    ---

    fs/fat/namei_vfat.c | 13 ++++++-------
    1 file changed, 6 insertions(+), 7 deletions(-)

    diff -puN fs/fat/namei_vfat.c~vfat-dcache-d_invalidate-fix fs/fat/namei_vfat.c
    --- linux-2.6/fs/fat/namei_vfat.c~vfat-dcache-d_invalidate-fix 2008-08-27 19:18:24.000000000 +0900
    +++ linux-2.6-hirofumi/fs/fat/namei_vfat.c 2008-08-27 19:18:24.000000000 +0900
    @@ -745,13 +745,12 @@ static struct dentry *vfat_lookup(struct
    *
    * Switch to new one for reason of locality if possible.
    */
    - if (d_invalidate(alias) == 0)
    - dput(alias);
    - else {
    - iput(inode);
    - unlock_super(sb);
    - return alias;
    - }
    + BUG_ON(d_unhashed(alias));
    + if (!S_ISDIR(inode->i_mode))
    + d_move(alias, dentry);
    + iput(inode);
    + unlock_super(sb);
    + return alias;
    }
    out:
    unlock_super(sb);
    _
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. [PATCH 18/21] fat: Add printf attribute to fat_fs_panic()



    Signed-off-by: OGAWA Hirofumi
    ---

    fs/fat/fat.h | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff -puN fs/fat/fat.h~fat-printk-attribute fs/fat/fat.h
    --- linux-2.6/fs/fat/fat.h~fat-printk-attribute 2008-09-29 10:26:20.000000000 +0900
    +++ linux-2.6-hirofumi/fs/fat/fat.h 2008-09-29 10:26:20.000000000 +0900
    @@ -308,7 +308,8 @@ extern int fat_fill_super(struct super_b
    extern int fat_flush_inodes(struct super_block *sb, struct inode *i1,
    struct inode *i2);
    /* fat/misc.c */
    -extern void fat_fs_panic(struct super_block *s, const char *fmt, ...);
    +extern void fat_fs_panic(struct super_block *s, const char *fmt, ...)
    + __attribute__ ((format (printf, 2, 3))) __cold;
    extern void fat_clusters_flush(struct super_block *sb);
    extern int fat_chain_add(struct inode *inode, int new_dclus, int nr_cluster);
    extern void fat_time_fat2unix(struct msdos_sb_info *sbi, struct timespec *ts,
    _
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread