函数源码

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source File:fs\namei.c Create Date:2022-07-29 10:34:51
首页 Copyright©Brick

800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
static void set_root(struct nameidata *nd)
{
    struct fs_struct *fs = current->fs;
 
    if (nd->flags & LOOKUP_RCU) {
        unsigned seq;
 
        do {
            seq = read_seqcount_begin(&fs->seq);
            nd->root = fs->root;
            nd->root_seq = __read_seqcount_begin(&nd->root.dentry->d_seq);
        } while (read_seqcount_retry(&fs->seq, seq));
    } else {
        get_fs_root(fs, &nd->root);
        nd->flags |= LOOKUP_ROOT_GRABBED;
    }
}