symlink.c 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Symlink inode operations for Coda filesystem
  4. * Original version: (C) 1996 P. Braam and M. Callahan
  5. * Rewritten for Linux 2.1. (C) 1997 Carnegie Mellon University
  6. *
  7. * Carnegie Mellon encourages users to contribute improvements to
  8. * the Coda project. Contact Peter Braam (coda@cs.cmu.edu).
  9. */
  10. #include <linux/types.h>
  11. #include <linux/kernel.h>
  12. #include <linux/time.h>
  13. #include <linux/fs.h>
  14. #include <linux/stat.h>
  15. #include <linux/errno.h>
  16. #include <linux/pagemap.h>
  17. #include <linux/coda.h>
  18. #include "coda_psdev.h"
  19. #include "coda_linux.h"
  20. static int coda_symlink_filler(struct file *file, struct folio *folio)
  21. {
  22. struct inode *inode = folio->mapping->host;
  23. int error;
  24. struct coda_inode_info *cii;
  25. unsigned int len = PAGE_SIZE;
  26. char *p = folio_address(folio);
  27. cii = ITOC(inode);
  28. error = venus_readlink(inode->i_sb, &cii->c_fid, p, &len);
  29. folio_end_read(folio, error == 0);
  30. return error;
  31. }
  32. const struct address_space_operations coda_symlink_aops = {
  33. .read_folio = coda_symlink_filler,
  34. };