symlink.c 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Copyright (C) 2005, 2006
  3. * Avishay Traeger (avishay@gmail.com) (avishay@il.ibm.com)
  4. * Copyright (C) 2005, 2006
  5. * International Business Machines
  6. * Copyright (C) 2008, 2009
  7. * Boaz Harrosh <bharrosh@panasas.com>
  8. *
  9. * Copyrights for code taken from ext2:
  10. * Copyright (C) 1992, 1993, 1994, 1995
  11. * Remy Card (card@masi.ibp.fr)
  12. * Laboratoire MASI - Institut Blaise Pascal
  13. * Universite Pierre et Marie Curie (Paris VI)
  14. * from
  15. * linux/fs/minix/inode.c
  16. * Copyright (C) 1991, 1992 Linus Torvalds
  17. *
  18. * This file is part of exofs.
  19. *
  20. * exofs is free software; you can redistribute it and/or modify
  21. * it under the terms of the GNU General Public License as published by
  22. * the Free Software Foundation. Since it is based on ext2, and the only
  23. * valid version of GPL for the Linux kernel is version 2, the only valid
  24. * version of GPL for exofs is version 2.
  25. *
  26. * exofs is distributed in the hope that it will be useful,
  27. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  28. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  29. * GNU General Public License for more details.
  30. *
  31. * You should have received a copy of the GNU General Public License
  32. * along with exofs; if not, write to the Free Software
  33. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  34. */
  35. #include <linux/namei.h>
  36. #include "exofs.h"
  37. static void *exofs_follow_link(struct dentry *dentry, struct nameidata *nd)
  38. {
  39. struct exofs_i_info *oi = exofs_i(dentry->d_inode);
  40. nd_set_link(nd, (char *)oi->i_data);
  41. return NULL;
  42. }
  43. const struct inode_operations exofs_symlink_inode_operations = {
  44. .readlink = generic_readlink,
  45. .follow_link = page_follow_link_light,
  46. .put_link = page_put_link,
  47. };
  48. const struct inode_operations exofs_fast_symlink_inode_operations = {
  49. .readlink = generic_readlink,
  50. .follow_link = exofs_follow_link,
  51. };