sysdep.c 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * linux/fs/hfs/sysdep.c
  3. *
  4. * Copyright (C) 1996 Paul H. Hargrove
  5. * (C) 2003 Ardis Technologies <roman@ardistech.com>
  6. * This file may be distributed under the terms of the GNU General Public License.
  7. *
  8. * This file contains the code to do various system dependent things.
  9. */
  10. #include <linux/namei.h>
  11. #include "hfs_fs.h"
  12. /* dentry case-handling: just lowercase everything */
  13. static int hfs_revalidate_dentry(struct dentry *dentry, unsigned int flags)
  14. {
  15. struct inode *inode;
  16. int diff;
  17. if (flags & LOOKUP_RCU)
  18. return -ECHILD;
  19. inode = d_inode(dentry);
  20. if(!inode)
  21. return 1;
  22. /* fix up inode on a timezone change */
  23. diff = sys_tz.tz_minuteswest * 60 - HFS_I(inode)->tz_secondswest;
  24. if (diff) {
  25. inode->i_ctime.tv_sec += diff;
  26. inode->i_atime.tv_sec += diff;
  27. inode->i_mtime.tv_sec += diff;
  28. HFS_I(inode)->tz_secondswest += diff;
  29. }
  30. return 1;
  31. }
  32. const struct dentry_operations hfs_dentry_operations =
  33. {
  34. .d_revalidate = hfs_revalidate_dentry,
  35. .d_hash = hfs_hash_dentry,
  36. .d_compare = hfs_compare_dentry,
  37. };