Lines Matching refs:index
463 struct dentry *ovl_index_upper(struct ovl_fs *ofs, struct dentry *index) in ovl_index_upper() argument
468 if (!d_is_dir(index)) in ovl_index_upper()
469 return dget(index); in ovl_index_upper()
471 fh = ovl_get_fh(index, OVL_XATTR_UPPER); in ovl_index_upper()
483 index, upper); in ovl_index_upper()
492 static bool ovl_is_temp_index(struct dentry *index) in ovl_is_temp_index() argument
494 return index->d_name.name[0] == '#'; in ovl_is_temp_index()
502 int ovl_verify_index(struct ovl_fs *ofs, struct dentry *index) in ovl_verify_index() argument
511 if (!d_inode(index)) in ovl_verify_index()
516 if (ovl_is_temp_index(index)) in ovl_verify_index()
520 if (index->d_name.len < sizeof(struct ovl_fh)*2) in ovl_verify_index()
524 len = index->d_name.len / 2; in ovl_verify_index()
530 if (hex2bin((u8 *)fh, index->d_name.name, len)) in ovl_verify_index()
542 if (ovl_is_whiteout(index)) in ovl_verify_index()
549 if (d_is_dir(index) && !ofs->config.nfs_export) in ovl_verify_index()
559 upper = ovl_index_upper(ofs, index); in ovl_verify_index()
581 if (!d_is_dir(index) && d_inode(index)->i_nlink == 1) { in ovl_verify_index()
582 err = ovl_check_origin_fh(ofs, fh, false, index, &stack); in ovl_verify_index()
586 if (ovl_get_nlink(origin.dentry, index, 0) == 0) in ovl_verify_index()
597 index, d_inode(index)->i_mode & S_IFMT, err); in ovl_verify_index()
602 index, d_inode(index)->i_mode & S_IFMT, in ovl_verify_index()
603 d_inode(index)->i_nlink); in ovl_verify_index()
656 struct dentry *index; in ovl_get_index_fh() local
664 index = lookup_one_len_unlocked(name.name, ofs->indexdir, name.len); in ovl_get_index_fh()
666 if (IS_ERR(index)) { in ovl_get_index_fh()
667 if (PTR_ERR(index) == -ENOENT) in ovl_get_index_fh()
668 index = NULL; in ovl_get_index_fh()
669 return index; in ovl_get_index_fh()
672 if (d_is_negative(index)) in ovl_get_index_fh()
674 else if (ovl_is_whiteout(index)) in ovl_get_index_fh()
676 else if (ovl_dentry_weird(index)) in ovl_get_index_fh()
679 return index; in ovl_get_index_fh()
681 dput(index); in ovl_get_index_fh()
688 struct dentry *index; in ovl_lookup_index() local
698 index = lookup_one_len_unlocked(name.name, ofs->indexdir, name.len); in ovl_lookup_index()
699 if (IS_ERR(index)) { in ovl_lookup_index()
700 err = PTR_ERR(index); in ovl_lookup_index()
702 index = NULL; in ovl_lookup_index()
712 inode = d_inode(index); in ovl_lookup_index()
713 if (d_is_negative(index)) { in ovl_lookup_index()
715 } else if (ovl_is_whiteout(index) && !verify) { in ovl_lookup_index()
722 dput(index); in ovl_lookup_index()
723 index = ERR_PTR(-ESTALE); in ovl_lookup_index()
725 } else if (ovl_dentry_weird(index) || ovl_is_whiteout(index) || in ovl_lookup_index()
735 index, d_inode(index)->i_mode & S_IFMT, in ovl_lookup_index()
741 origin, index); in ovl_lookup_index()
746 err = ovl_verify_upper(index, upper, false); in ovl_lookup_index()
750 upper, origin, index); in ovl_lookup_index()
759 return index; in ovl_lookup_index()
762 dput(index); in ovl_lookup_index()
763 index = NULL; in ovl_lookup_index()
767 dput(index); in ovl_lookup_index()
768 index = ERR_PTR(-EIO); in ovl_lookup_index()
826 struct dentry *index = NULL; in ovl_lookup() local
940 (!d.is_dir && ofs->config.index && origin_path))) { in ovl_lookup()
1039 index = ovl_lookup_index(ofs, upperdentry, origin, true); in ovl_lookup()
1040 if (IS_ERR(index)) { in ovl_lookup()
1041 err = PTR_ERR(index); in ovl_lookup()
1042 index = NULL; in ovl_lookup()
1060 else if (index) { in ovl_lookup()
1061 upperdentry = dget(index); in ovl_lookup()
1074 .index = index, in ovl_lookup()
1092 dput(index); in ovl_lookup()
1101 dput(index); in ovl_lookup()