mtdbdi.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* MTD backing device capabilities
  2. *
  3. * Copyright © 2006 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. */
  11. #include <linux/backing-dev.h>
  12. #include <linux/mtd/mtd.h>
  13. #include "internal.h"
  14. /*
  15. * backing device capabilities for non-mappable devices (such as NAND flash)
  16. * - permits private mappings, copies are taken of the data
  17. */
  18. struct backing_dev_info mtd_bdi_unmappable = {
  19. .capabilities = BDI_CAP_MAP_COPY,
  20. };
  21. /*
  22. * backing device capabilities for R/O mappable devices (such as ROM)
  23. * - permits private mappings, copies are taken of the data
  24. * - permits non-writable shared mappings
  25. */
  26. struct backing_dev_info mtd_bdi_ro_mappable = {
  27. .capabilities = (BDI_CAP_MAP_COPY | BDI_CAP_MAP_DIRECT |
  28. BDI_CAP_EXEC_MAP | BDI_CAP_READ_MAP),
  29. };
  30. /*
  31. * backing device capabilities for writable mappable devices (such as RAM)
  32. * - permits private mappings, copies are taken of the data
  33. * - permits non-writable shared mappings
  34. */
  35. struct backing_dev_info mtd_bdi_rw_mappable = {
  36. .capabilities = (BDI_CAP_MAP_COPY | BDI_CAP_MAP_DIRECT |
  37. BDI_CAP_EXEC_MAP | BDI_CAP_READ_MAP |
  38. BDI_CAP_WRITE_MAP),
  39. };