symlink.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 page *page)
  21. {
  22. struct inode *inode = page->mapping->host;
  23. int error;
  24. struct coda_inode_info *cii;
  25. unsigned int len = PAGE_SIZE;
  26. char *p = page_address(page);
  27. cii = ITOC(inode);
  28. error = venus_readlink(inode->i_sb, &cii->c_fid, p, &len);
  29. if (error)
  30. goto fail;
  31. SetPageUptodate(page);
  32. unlock_page(page);
  33. return 0;
  34. fail:
  35. SetPageError(page);
  36. unlock_page(page);
  37. return error;
  38. }
  39. const struct address_space_operations coda_symlink_aops = {
  40. .readpage = coda_symlink_filler,
  41. };