page_range_helper.c 759 B

123456789101112131415161718192021222324
  1. // SPDX-License-Identifier: GPL-2.0
  2. /* C helper for page_range.rs to work around a CFI violation.
  3. *
  4. * Bindgen currently pretends that `enum lru_status` is the same as an integer.
  5. * This assumption is fine ABI-wise, but once you add CFI to the mix, it
  6. * triggers a CFI violation because `enum lru_status` gets a different CFI tag.
  7. *
  8. * This file contains a workaround until bindgen can be fixed.
  9. *
  10. * Copyright (C) 2025 Google LLC.
  11. */
  12. #include "page_range_helper.h"
  13. unsigned int rust_shrink_free_page(struct list_head *item,
  14. struct list_lru_one *list,
  15. void *cb_arg);
  16. enum lru_status
  17. rust_shrink_free_page_wrap(struct list_head *item, struct list_lru_one *list,
  18. void *cb_arg)
  19. {
  20. return rust_shrink_free_page(item, list, cb_arg);
  21. }