Lines Matching refs:fh
113 struct ovl_fh *fh = NULL; in ovl_get_fh() local
125 fh = kzalloc(res + OVL_FH_WIRE_OFFSET, GFP_KERNEL); in ovl_get_fh()
126 if (!fh) in ovl_get_fh()
129 res = ovl_getxattr_upper(ofs, upperdentry, ox, fh->buf, res); in ovl_get_fh()
133 err = ovl_check_fb_len(&fh->fb, res); in ovl_get_fh()
140 return fh; in ovl_get_fh()
143 kfree(fh); in ovl_get_fh()
150 pr_warn_ratelimited("invalid origin (%*phN)\n", res, fh); 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()
169 !uuid_is_null(&fh->fb.uuid)) in ovl_decode_real_fh()
172 bytes = (fh->fb.len - offsetof(struct ovl_fb, fid)); in ovl_decode_real_fh()
173 real = exportfs_decode_fh(mnt, (struct fid *)fh->fb.fid, in ovl_decode_real_fh()
174 bytes >> 2, (int)fh->fb.type, in ovl_decode_real_fh()
184 !(fh->fb.flags & OVL_FH_FLAG_PATH_UPPER)) in ovl_decode_real_fh()
353 int ovl_check_origin_fh(struct ovl_fs *ofs, struct ovl_fh *fh, bool connected, in ovl_check_origin_fh() argument
368 origin = ovl_decode_real_fh(ofs, fh, ofs->layers[i].mnt, in ovl_check_origin_fh()
407 struct ovl_fh *fh = ovl_get_fh(ofs, upperdentry, OVL_XATTR_ORIGIN); in ovl_check_origin() local
410 if (IS_ERR_OR_NULL(fh)) in ovl_check_origin()
411 return PTR_ERR(fh); in ovl_check_origin()
413 err = ovl_check_origin_fh(ofs, fh, false, upperdentry, stackp); in ovl_check_origin()
414 kfree(fh); in ovl_check_origin()
430 enum ovl_xattr ox, const struct ovl_fh *fh) in ovl_verify_fh() argument
441 if (fh->fb.len != ofh->fb.len || memcmp(&fh->fb, &ofh->fb, fh->fb.len)) in ovl_verify_fh()
461 struct ovl_fh *fh; in ovl_verify_set_fh() local
464 fh = ovl_encode_real_fh(ofs, real, is_upper); in ovl_verify_set_fh()
465 err = PTR_ERR(fh); in ovl_verify_set_fh()
466 if (IS_ERR(fh)) { in ovl_verify_set_fh()
467 fh = NULL; 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()
478 kfree(fh); in ovl_verify_set_fh()
492 struct ovl_fh *fh; in ovl_index_upper() local
498 fh = ovl_get_fh(ofs, index, OVL_XATTR_UPPER); in ovl_index_upper()
499 if (IS_ERR_OR_NULL(fh)) in ovl_index_upper()
500 return ERR_CAST(fh); in ovl_index_upper()
502 upper = ovl_decode_real_fh(ofs, fh, ovl_upper_mnt(ofs), true); in ovl_index_upper()
503 kfree(fh); in ovl_index_upper()
525 struct ovl_fh *fh = NULL; in ovl_verify_index() local
541 fh = kzalloc(len + OVL_FH_WIRE_OFFSET, GFP_KERNEL); in ovl_verify_index()
542 if (!fh) in ovl_verify_index()
546 if (hex2bin(fh->buf, index->d_name.name, len)) in ovl_verify_index()
549 err = ovl_check_fb_len(&fh->fb, len); 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()
608 kfree(fh); in ovl_verify_index()
624 static int ovl_get_index_name_fh(struct ovl_fh *fh, struct qstr *name) in ovl_get_index_name_fh() argument
628 n = kcalloc(fh->fb.len, 2, GFP_KERNEL); in ovl_get_index_name_fh()
632 s = bin2hex(n, fh->buf, fh->fb.len); in ovl_get_index_name_fh()
657 struct ovl_fh *fh; in ovl_get_index_name() local
660 fh = ovl_encode_real_fh(ofs, origin, false); in ovl_get_index_name()
661 if (IS_ERR(fh)) in ovl_get_index_name()
662 return PTR_ERR(fh); in ovl_get_index_name()
664 err = ovl_get_index_name_fh(fh, name); in ovl_get_index_name()
666 kfree(fh); 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
677 err = ovl_get_index_name_fh(fh, &name); in ovl_get_index_fh()