Lines Matching defs:fh

120 	struct ovl_fh *fh = NULL;
132 fh = kzalloc(res + OVL_FH_WIRE_OFFSET, GFP_KERNEL);
133 if (!fh)
136 res = ovl_getxattr_upper(ofs, upperdentry, ox, fh->buf, res);
140 err = ovl_check_fb_len(&fh->fb, res);
147 return fh;
150 kfree(fh);
157 pr_warn_ratelimited("invalid origin (%*phN)\n", res, fh);
161 struct dentry *ovl_decode_real_fh(struct ovl_fs *ofs, struct ovl_fh *fh,
176 !uuid_equal(&fh->fb.uuid, &mnt->mnt_sb->s_uuid) :
177 !uuid_is_null(&fh->fb.uuid))
180 bytes = (fh->fb.len - offsetof(struct ovl_fb, fid));
181 real = exportfs_decode_fh(mnt, (struct fid *)fh->fb.fid,
182 bytes >> 2, (int)fh->fb.type,
192 !(fh->fb.flags & OVL_FH_FLAG_PATH_UPPER))
421 int ovl_check_origin_fh(struct ovl_fs *ofs, struct ovl_fh *fh, bool connected,
430 * fh->uuid to layer.
436 origin = ovl_decode_real_fh(ofs, fh, ofs->layers[i].mnt,
475 struct ovl_fh *fh = ovl_get_fh(ofs, upperdentry, OVL_XATTR_ORIGIN);
478 if (IS_ERR_OR_NULL(fh))
479 return PTR_ERR(fh);
481 err = ovl_check_origin_fh(ofs, fh, false, upperdentry, stackp);
482 kfree(fh);
494 * Verify that @fh matches the file handle stored in xattr @name.
498 enum ovl_xattr ox, const struct ovl_fh *fh)
509 if (fh->fb.len != ofh->fb.len || memcmp(&fh->fb, &ofh->fb, fh->fb.len))
517 enum ovl_xattr ox, const struct ovl_fh *fh,
522 err = ovl_verify_fh(ofs, dentry, ox, fh);
524 err = ovl_setxattr(ofs, dentry, ox, fh->buf, fh->fb.len);
542 struct ovl_fh *fh;
545 fh = ovl_encode_real_fh(ofs, real, is_upper);
546 err = PTR_ERR(fh);
547 if (IS_ERR(fh)) {
548 fh = NULL;
552 err = ovl_verify_set_fh(ofs, dentry, ox, fh, is_upper, set);
557 kfree(fh);
573 struct ovl_fh *fh;
579 fh = ovl_get_fh(ofs, index, OVL_XATTR_UPPER);
580 if (IS_ERR_OR_NULL(fh))
581 return ERR_CAST(fh);
583 upper = ovl_decode_real_fh(ofs, fh, ovl_upper_mnt(ofs), connected);
584 kfree(fh);
606 struct ovl_fh *fh = NULL;
622 fh = kzalloc(len + OVL_FH_WIRE_OFFSET, GFP_KERNEL);
623 if (!fh)
627 if (hex2bin(fh->buf, index->d_name.name, len))
630 err = ovl_check_fb_len(&fh->fb, len);
672 err = ovl_verify_fh(ofs, upper, OVL_XATTR_ORIGIN, fh);
679 err = ovl_check_origin_fh(ofs, fh, false, index, &stack);
689 kfree(fh);
705 int ovl_get_index_name_fh(const struct ovl_fh *fh, struct qstr *name)
709 n = kcalloc(fh->fb.len, 2, GFP_KERNEL);
713 s = bin2hex(n, fh->buf, fh->fb.len);
738 struct ovl_fh *fh;
741 fh = ovl_encode_real_fh(ofs, origin, false);
742 if (IS_ERR(fh))
743 return PTR_ERR(fh);
745 err = ovl_get_index_name_fh(fh, name);
747 kfree(fh);
752 struct dentry *ovl_get_index_fh(struct ovl_fs *ofs, struct ovl_fh *fh)
758 err = ovl_get_index_name_fh(fh, &name);
898 const struct ovl_fh *fh;
904 fh = ovl_get_origin_fh(ofs, lower);
905 if (IS_ERR(fh))
906 return PTR_ERR(fh);
912 err = ovl_set_origin_fh(ofs, fh, upper);
918 kfree(fh);
1139 * If no origin fh is stored in upper of a merge dir, store fh