Lines Matching defs:fh
123 * @fh: Pointer to the &struct liveupdate_file_handler that manages
162 struct liveupdate_file_handler *fh;
172 static unsigned long luo_get_id(struct liveupdate_file_handler *fh,
175 return fh->ops->get_id ? fh->ops->get_id(file) : (unsigned long)file;
233 struct liveupdate_file_handler *fh;
253 list_private_for_each_entry(fh, &luo_file_handler_list, list) {
254 if (fh->ops->can_preserve(fh, file)) {
255 if (try_module_get(fh->ops->owner))
266 err = xa_insert(&luo_preserved_files, luo_get_id(fh, file),
271 err = luo_flb_file_preserve(fh);
282 luo_file->fh = fh;
286 args.handler = fh;
288 err = fh->ops->preserve(&args);
302 luo_flb_file_unpreserve(fh);
304 xa_erase(&luo_preserved_files, luo_get_id(fh, file));
306 module_put(fh->ops->owner);
343 args.handler = luo_file->fh;
347 luo_file->fh->ops->unpreserve(&args);
348 luo_flb_file_unpreserve(luo_file->fh);
351 luo_get_id(luo_file->fh, luo_file->file));
352 module_put(luo_file->fh->ops->owner);
373 if (luo_file->fh->ops->freeze) {
376 args.handler = luo_file->fh;
381 err = luo_file->fh->ops->freeze(&args);
394 if (luo_file->fh->ops->unfreeze) {
397 args.handler = luo_file->fh;
402 luo_file->fh->ops->unfreeze(&args);
479 luo_file->token, luo_file->fh->compatible,
484 strscpy(file_ser->compatible, luo_file->fh->compatible,
589 args.handler = luo_file->fh;
591 err = luo_file->fh->ops->retrieve(&args);
603 luo_get_id(luo_file->fh, luo_file->file),
619 if (luo_file->fh->ops->can_finish) {
622 args.handler = luo_file->fh;
626 can_finish = luo_file->fh->ops->can_finish(&args);
639 args.handler = luo_file->fh;
644 luo_file->fh->ops->finish(&args);
645 luo_flb_file_finish(luo_file->fh);
703 luo_get_id(luo_file->fh, luo_file->file));
706 module_put(luo_file->fh->ops->owner);
722 struct liveupdate_file_handler *fh;
727 list_private_for_each_entry(fh, &luo_file_handler_list, list) {
728 if (!strcmp(fh->compatible, ser->compatible)) {
729 if (try_module_get(fh->ops->owner))
745 module_put(fh->ops->owner);
749 luo_file->fh = fh;
840 module_put(luo_file->fh->ops->owner);
864 * @fh: Pointer to a caller-allocated &struct liveupdate_file_handler.
866 * 'compatible' string and a valid 'fh' callbacks. This function adds the
874 int liveupdate_register_file_handler(struct liveupdate_file_handler *fh)
883 if (!fh->ops->preserve || !fh->ops->unpreserve || !fh->ops->retrieve ||
884 !fh->ops->finish || !fh->ops->can_preserve) {
891 if (!strcmp(fh_iter->compatible, fh->compatible)) {
893 fh->compatible);
899 INIT_LIST_HEAD(&ACCESS_PRIVATE(fh, flb_list));
900 INIT_LIST_HEAD(&ACCESS_PRIVATE(fh, list));
901 list_add_tail(&ACCESS_PRIVATE(fh, list), &luo_file_handler_list);
904 liveupdate_test_register(fh);
915 * @fh: The file handler to unregister
920 void liveupdate_unregister_file_handler(struct liveupdate_file_handler *fh)
926 luo_flb_unregister_all(fh);
927 list_del(&ACCESS_PRIVATE(fh, list));