Lines Matching refs:fh
112 struct ovl_fh *fh = NULL; in ovl_get_fh() local
124 fh = kzalloc(res + OVL_FH_WIRE_OFFSET, GFP_KERNEL); in ovl_get_fh()
125 if (!fh) in ovl_get_fh()
128 res = ovl_do_getxattr(ofs, dentry, ox, fh->buf, res); in ovl_get_fh()
132 err = ovl_check_fb_len(&fh->fb, res); in ovl_get_fh()
139 return fh; in ovl_get_fh()
142 kfree(fh); in ovl_get_fh()
149 pr_warn_ratelimited("invalid origin (%*phN)\n", res, fh); in ovl_get_fh()
153 struct dentry *ovl_decode_real_fh(struct ovl_fh *fh, struct vfsmount *mnt, in ovl_decode_real_fh() argument
163 if (!uuid_equal(&fh->fb.uuid, &mnt->mnt_sb->s_uuid)) in ovl_decode_real_fh()
166 bytes = (fh->fb.len - offsetof(struct ovl_fb, fid)); in ovl_decode_real_fh()
167 real = exportfs_decode_fh(mnt, (struct fid *)fh->fb.fid, in ovl_decode_real_fh()
168 bytes >> 2, (int)fh->fb.type, in ovl_decode_real_fh()
178 !(fh->fb.flags & OVL_FH_FLAG_PATH_UPPER)) in ovl_decode_real_fh()
342 int ovl_check_origin_fh(struct ovl_fs *ofs, struct ovl_fh *fh, bool connected, in ovl_check_origin_fh() argument
357 origin = ovl_decode_real_fh(fh, ofs->layers[i].mnt, in ovl_check_origin_fh()
396 struct ovl_fh *fh = ovl_get_fh(ofs, upperdentry, OVL_XATTR_ORIGIN); in ovl_check_origin() local
399 if (IS_ERR_OR_NULL(fh)) in ovl_check_origin()
400 return PTR_ERR(fh); in ovl_check_origin()
402 err = ovl_check_origin_fh(ofs, fh, false, upperdentry, stackp); in ovl_check_origin()
403 kfree(fh); in ovl_check_origin()
419 enum ovl_xattr ox, const struct ovl_fh *fh) in ovl_verify_fh() argument
430 if (fh->fb.len != ofh->fb.len || memcmp(&fh->fb, &ofh->fb, fh->fb.len)) in ovl_verify_fh()
450 struct ovl_fh *fh; in ovl_verify_set_fh() local
453 fh = ovl_encode_real_fh(real, is_upper); in ovl_verify_set_fh()
454 err = PTR_ERR(fh); in ovl_verify_set_fh()
455 if (IS_ERR(fh)) { in ovl_verify_set_fh()
456 fh = NULL; in ovl_verify_set_fh()
460 err = ovl_verify_fh(ofs, dentry, ox, fh); in ovl_verify_set_fh()
462 err = ovl_do_setxattr(ofs, dentry, ox, fh->buf, fh->fb.len); in ovl_verify_set_fh()
467 kfree(fh); in ovl_verify_set_fh()
481 struct ovl_fh *fh; in ovl_index_upper() local
487 fh = ovl_get_fh(ofs, index, OVL_XATTR_UPPER); in ovl_index_upper()
488 if (IS_ERR_OR_NULL(fh)) in ovl_index_upper()
489 return ERR_CAST(fh); in ovl_index_upper()
491 upper = ovl_decode_real_fh(fh, ovl_upper_mnt(ofs), true); in ovl_index_upper()
492 kfree(fh); in ovl_index_upper()
514 struct ovl_fh *fh = NULL; in ovl_verify_index() local
530 fh = kzalloc(len + OVL_FH_WIRE_OFFSET, GFP_KERNEL); in ovl_verify_index()
531 if (!fh) in ovl_verify_index()
535 if (hex2bin(fh->buf, index->d_name.name, len)) in ovl_verify_index()
538 err = ovl_check_fb_len(&fh->fb, len); in ovl_verify_index()
580 err = ovl_verify_fh(ofs, upper, OVL_XATTR_ORIGIN, fh); in ovl_verify_index()
587 err = ovl_check_origin_fh(ofs, fh, false, index, &stack); in ovl_verify_index()
597 kfree(fh); in ovl_verify_index()
613 static int ovl_get_index_name_fh(struct ovl_fh *fh, struct qstr *name) in ovl_get_index_name_fh() argument
617 n = kcalloc(fh->fb.len, 2, GFP_KERNEL); in ovl_get_index_name_fh()
621 s = bin2hex(n, fh->buf, fh->fb.len); in ovl_get_index_name_fh()
645 struct ovl_fh *fh; in ovl_get_index_name() local
648 fh = ovl_encode_real_fh(origin, false); in ovl_get_index_name()
649 if (IS_ERR(fh)) in ovl_get_index_name()
650 return PTR_ERR(fh); in ovl_get_index_name()
652 err = ovl_get_index_name_fh(fh, name); in ovl_get_index_name()
654 kfree(fh); in ovl_get_index_name()
659 struct dentry *ovl_get_index_fh(struct ovl_fs *ofs, struct ovl_fh *fh) in ovl_get_index_fh() argument
665 err = ovl_get_index_name_fh(fh, &name); in ovl_get_index_fh()