symlink.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 = kmap(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. kunmap(page);
  32. unlock_page(page);
  33. return 0;
  34. fail:
  35. SetPageError(page);
  36. kunmap(page);
  37. unlock_page(page);
  38. return error;
  39. }
  40. const struct address_space_operations coda_symlink_aops = {
  41. .readpage = coda_symlink_filler,
  42. };