symlink.c 1.1 KB

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