Lines Matching refs:ofs
34 struct ovl_fs *ofs = OVL_FS(d->sb); in ovl_check_redirect() local
36 buf = ovl_get_redirect_xattr(ofs, path, prelen + strlen(post)); in ovl_check_redirect()
109 static struct ovl_fh *ovl_get_fh(struct ovl_fs *ofs, struct dentry *upperdentry, in ovl_get_fh() argument
115 res = ovl_getxattr_upper(ofs, upperdentry, ox, NULL, 0); in ovl_get_fh()
129 res = ovl_getxattr_upper(ofs, upperdentry, ox, fh->buf, res); in ovl_get_fh()
154 struct dentry *ovl_decode_real_fh(struct ovl_fs *ofs, struct ovl_fh *fh, in ovl_decode_real_fh() argument
168 if (ofs->config.uuid ? !uuid_equal(&fh->fb.uuid, &mnt->mnt_sb->s_uuid) : in ovl_decode_real_fh()
197 static bool ovl_is_opaquedir(struct ovl_fs *ofs, const struct path *path) in ovl_is_opaquedir() argument
199 return ovl_path_check_dir_xattr(ofs, path, OVL_XATTR_OPAQUE); in ovl_is_opaquedir()
353 int ovl_check_origin_fh(struct ovl_fs *ofs, struct ovl_fh *fh, bool connected, in ovl_check_origin_fh() argument
359 for (i = 1; i < ofs->numlayer; i++) { in ovl_check_origin_fh()
364 if (ofs->layers[i].fsid && in ovl_check_origin_fh()
365 ofs->layers[i].fs->bad_uuid) in ovl_check_origin_fh()
368 origin = ovl_decode_real_fh(ofs, fh, ofs->layers[i].mnt, in ovl_check_origin_fh()
391 .layer = &ofs->layers[i] in ovl_check_origin_fh()
404 static int ovl_check_origin(struct ovl_fs *ofs, struct dentry *upperdentry, in ovl_check_origin() argument
407 struct ovl_fh *fh = ovl_get_fh(ofs, upperdentry, OVL_XATTR_ORIGIN); in ovl_check_origin()
413 err = ovl_check_origin_fh(ofs, fh, false, upperdentry, stackp); in ovl_check_origin()
429 static int ovl_verify_fh(struct ovl_fs *ofs, struct dentry *dentry, in ovl_verify_fh() argument
432 struct ovl_fh *ofh = ovl_get_fh(ofs, dentry, ox); in ovl_verify_fh()
456 int ovl_verify_set_fh(struct ovl_fs *ofs, struct dentry *dentry, in ovl_verify_set_fh() argument
464 fh = ovl_encode_real_fh(ofs, real, is_upper); in ovl_verify_set_fh()
471 err = ovl_verify_fh(ofs, dentry, ox, fh); in ovl_verify_set_fh()
473 err = ovl_setxattr(ofs, dentry, ox, fh->buf, fh->fb.len); in ovl_verify_set_fh()
490 struct dentry *ovl_index_upper(struct ovl_fs *ofs, struct dentry *index) in ovl_index_upper() argument
498 fh = ovl_get_fh(ofs, index, OVL_XATTR_UPPER); in ovl_index_upper()
502 upper = ovl_decode_real_fh(ofs, fh, ovl_upper_mnt(ofs), true); in ovl_index_upper()
523 int ovl_verify_index(struct ovl_fs *ofs, struct dentry *index) in ovl_verify_index() argument
565 if (d_is_dir(index) && !ofs->config.nfs_export) in ovl_verify_index()
575 upper = ovl_index_upper(ofs, index); in ovl_verify_index()
591 err = ovl_verify_fh(ofs, upper, OVL_XATTR_ORIGIN, fh); in ovl_verify_index()
598 err = ovl_check_origin_fh(ofs, fh, false, index, &stack); in ovl_verify_index()
602 if (ovl_get_nlink(ofs, origin.dentry, index, 0) == 0) in ovl_verify_index()
654 int ovl_get_index_name(struct ovl_fs *ofs, struct dentry *origin, in ovl_get_index_name() argument
660 fh = ovl_encode_real_fh(ofs, origin, false); in ovl_get_index_name()
671 struct dentry *ovl_get_index_fh(struct ovl_fs *ofs, struct ovl_fh *fh) in ovl_get_index_fh() argument
681 index = lookup_positive_unlocked(name.name, ofs->indexdir, name.len); in ovl_get_index_fh()
700 struct dentry *ovl_lookup_index(struct ovl_fs *ofs, struct dentry *upper, in ovl_lookup_index() argument
709 err = ovl_get_index_name(ofs, origin, &name); in ovl_lookup_index()
713 index = lookup_one_positive_unlocked(ovl_upper_mnt_userns(ofs), name.name, in ovl_lookup_index()
714 ofs->indexdir, name.len); in ovl_lookup_index()
760 err = ovl_verify_upper(ofs, index, upper, false); in ovl_lookup_index()
809 static int ovl_fix_origin(struct ovl_fs *ofs, struct dentry *dentry, in ovl_fix_origin() argument
814 if (ovl_check_origin_xattr(ofs, upper)) in ovl_fix_origin()
821 err = ovl_set_origin(ofs, lower, upper); in ovl_fix_origin()
834 struct ovl_fs *ofs = dentry->d_sb->s_fs_info; in ovl_lookup() local
855 .last = ofs->config.redirect_follow ? false : !poe->numlower, in ovl_lookup()
860 if (dentry->d_name.len > ofs->namelen) in ovl_lookup()
866 d.mnt = ovl_upper_mnt(ofs); in ovl_lookup()
887 err = ovl_check_origin(ofs, upperdentry, &origin_path); in ovl_lookup()
908 stack = kcalloc(ofs->numlayer - 1, sizeof(struct ovl_path), in ovl_lookup()
917 if (!ofs->config.redirect_follow) in ovl_lookup()
930 if ((uppermetacopy || d.metacopy) && !ofs->config.metacopy) { in ovl_lookup()
941 if (upperdentry && !ctr && !ofs->noxattr && d.is_dir) { in ovl_lookup()
942 err = ovl_fix_origin(ofs, dentry, this, upperdentry); in ovl_lookup()
960 (!d.is_dir && ofs->config.index && origin_path))) { in ovl_lookup()
961 err = ovl_verify_origin(ofs, upperdentry, this, false); in ovl_lookup()
997 if (d.redirect && !ofs->config.redirect_follow) { in ovl_lookup()
1061 index = ovl_lookup_index(ofs, upperdentry, origin, true); in ovl_lookup()
1085 .mnt = ovl_upper_mnt(ofs), in ovl_lookup()
1088 upperredirect = ovl_get_redirect_xattr(ofs, &upperpath, 0); in ovl_lookup()
1094 err = ovl_check_metacopy_xattr(ofs, &upperpath); in ovl_lookup()