bd_holder

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've been looking into reducing sb_lock and replacing it mostly with a
new file_system_type->fs_super_lock which would be a
per-file-system-type spinlock protecting fs_type->fs_supers.

With the changes in vfs.super bd_holder always stores the super_block
and so we should be able to get rid of get_super() and user_get_super()
completely. Am I right in this or is there something that would prevent
us from doing something like the following (completely untested sketch)?:

struct super_block *get_super(struct block_device *bdev)
{
        struct super_block *sb;

        if (!bdev)
                return NULL;

        spin_lock(&sb_lock);

        sb = bdev->bd_holder;
        if (!sb)
                goto out_unlock;

        if (hlist_unhashed(&sb->s_instances))
                goto out_unlock;

        sb->s_count++;
        spin_unlock(&sb_lock);
        down_read(&sb->s_umount);
        /* still alive? */
        if (sb->s_root && (sb->s_flags & SB_BORN))
                return sb;
        up_read(&sb->s_umount);
        /* nope, got unmounted */
        spin_lock(&sb_lock);
        __put_super(sb);

out_unlock:
        spin_unlock(&sb_lock);
        return NULL;
}

instead of looping through super_blocks? The only thing that irritates
me is the restart logic in the current helpers.



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux