aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_iops.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_iops.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c58
1 files changed, 19 insertions, 39 deletions
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index 8070b34cc287..cd42ef78f6b5 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -43,7 +43,6 @@
43#include "xfs_error.h" 43#include "xfs_error.h"
44#include "xfs_itable.h" 44#include "xfs_itable.h"
45#include "xfs_rw.h" 45#include "xfs_rw.h"
46#include "xfs_acl.h"
47#include "xfs_attr.h" 46#include "xfs_attr.h"
48#include "xfs_buf_item.h" 47#include "xfs_buf_item.h"
49#include "xfs_utils.h" 48#include "xfs_utils.h"
@@ -58,19 +57,22 @@
58#include <linux/fiemap.h> 57#include <linux/fiemap.h>
59 58
60/* 59/*
61 * Bring the atime in the XFS inode uptodate. 60 * Bring the timestamps in the XFS inode uptodate.
62 * Used before logging the inode to disk or when the Linux inode goes away. 61 *
62 * Used before writing the inode to disk.
63 */ 63 */
64void 64void
65xfs_synchronize_atime( 65xfs_synchronize_times(
66 xfs_inode_t *ip) 66 xfs_inode_t *ip)
67{ 67{
68 struct inode *inode = VFS_I(ip); 68 struct inode *inode = VFS_I(ip);
69 69
70 if (!(inode->i_state & I_CLEAR)) { 70 ip->i_d.di_atime.t_sec = (__int32_t)inode->i_atime.tv_sec;
71 ip->i_d.di_atime.t_sec = (__int32_t)inode->i_atime.tv_sec; 71 ip->i_d.di_atime.t_nsec = (__int32_t)inode->i_atime.tv_nsec;
72 ip->i_d.di_atime.t_nsec = (__int32_t)inode->i_atime.tv_nsec; 72 ip->i_d.di_ctime.t_sec = (__int32_t)inode->i_ctime.tv_sec;
73 } 73 ip->i_d.di_ctime.t_nsec = (__int32_t)inode->i_ctime.tv_nsec;
74 ip->i_d.di_mtime.t_sec = (__int32_t)inode->i_mtime.tv_sec;
75 ip->i_d.di_mtime.t_nsec = (__int32_t)inode->i_mtime.tv_nsec;
74} 76}
75 77
76/* 78/*
@@ -107,32 +109,20 @@ xfs_ichgtime(
107 if ((flags & XFS_ICHGTIME_MOD) && 109 if ((flags & XFS_ICHGTIME_MOD) &&
108 !timespec_equal(&inode->i_mtime, &tv)) { 110 !timespec_equal(&inode->i_mtime, &tv)) {
109 inode->i_mtime = tv; 111 inode->i_mtime = tv;
110 ip->i_d.di_mtime.t_sec = (__int32_t)tv.tv_sec;
111 ip->i_d.di_mtime.t_nsec = (__int32_t)tv.tv_nsec;
112 sync_it = 1; 112 sync_it = 1;
113 } 113 }
114 if ((flags & XFS_ICHGTIME_CHG) && 114 if ((flags & XFS_ICHGTIME_CHG) &&
115 !timespec_equal(&inode->i_ctime, &tv)) { 115 !timespec_equal(&inode->i_ctime, &tv)) {
116 inode->i_ctime = tv; 116 inode->i_ctime = tv;
117 ip->i_d.di_ctime.t_sec = (__int32_t)tv.tv_sec;
118 ip->i_d.di_ctime.t_nsec = (__int32_t)tv.tv_nsec;
119 sync_it = 1; 117 sync_it = 1;
120 } 118 }
121 119
122 /* 120 /*
123 * We update the i_update_core field _after_ changing 121 * Update complete - now make sure everyone knows that the inode
124 * the timestamps in order to coordinate properly with 122 * is dirty.
125 * xfs_iflush() so that we don't lose timestamp updates.
126 * This keeps us from having to hold the inode lock
127 * while doing this. We use the SYNCHRONIZE macro to
128 * ensure that the compiler does not reorder the update
129 * of i_update_core above the timestamp updates above.
130 */ 123 */
131 if (sync_it) { 124 if (sync_it)
132 SYNCHRONIZE();
133 ip->i_update_core = 1;
134 xfs_mark_inode_dirty_sync(ip); 125 xfs_mark_inode_dirty_sync(ip);
135 }
136} 126}
137 127
138/* 128/*
@@ -485,14 +475,6 @@ xfs_vn_put_link(
485} 475}
486 476
487STATIC int 477STATIC int
488xfs_vn_permission(
489 struct inode *inode,
490 int mask)
491{
492 return generic_permission(inode, mask, xfs_check_acl);
493}
494
495STATIC int
496xfs_vn_getattr( 478xfs_vn_getattr(
497 struct vfsmount *mnt, 479 struct vfsmount *mnt,
498 struct dentry *dentry, 480 struct dentry *dentry,
@@ -515,10 +497,8 @@ xfs_vn_getattr(
515 stat->gid = ip->i_d.di_gid; 497 stat->gid = ip->i_d.di_gid;
516 stat->ino = ip->i_ino; 498 stat->ino = ip->i_ino;
517 stat->atime = inode->i_atime; 499 stat->atime = inode->i_atime;
518 stat->mtime.tv_sec = ip->i_d.di_mtime.t_sec; 500 stat->mtime = inode->i_mtime;
519 stat->mtime.tv_nsec = ip->i_d.di_mtime.t_nsec; 501 stat->ctime = inode->i_ctime;
520 stat->ctime.tv_sec = ip->i_d.di_ctime.t_sec;
521 stat->ctime.tv_nsec = ip->i_d.di_ctime.t_nsec;
522 stat->blocks = 502 stat->blocks =
523 XFS_FSB_TO_BB(mp, ip->i_d.di_nblocks + ip->i_delayed_blks); 503 XFS_FSB_TO_BB(mp, ip->i_d.di_nblocks + ip->i_delayed_blks);
524 504
@@ -696,7 +676,7 @@ xfs_vn_fiemap(
696} 676}
697 677
698static const struct inode_operations xfs_inode_operations = { 678static const struct inode_operations xfs_inode_operations = {
699 .permission = xfs_vn_permission, 679 .check_acl = xfs_check_acl,
700 .truncate = xfs_vn_truncate, 680 .truncate = xfs_vn_truncate,
701 .getattr = xfs_vn_getattr, 681 .getattr = xfs_vn_getattr,
702 .setattr = xfs_vn_setattr, 682 .setattr = xfs_vn_setattr,
@@ -724,7 +704,7 @@ static const struct inode_operations xfs_dir_inode_operations = {
724 .rmdir = xfs_vn_unlink, 704 .rmdir = xfs_vn_unlink,
725 .mknod = xfs_vn_mknod, 705 .mknod = xfs_vn_mknod,
726 .rename = xfs_vn_rename, 706 .rename = xfs_vn_rename,
727 .permission = xfs_vn_permission, 707 .check_acl = xfs_check_acl,
728 .getattr = xfs_vn_getattr, 708 .getattr = xfs_vn_getattr,
729 .setattr = xfs_vn_setattr, 709 .setattr = xfs_vn_setattr,
730 .setxattr = generic_setxattr, 710 .setxattr = generic_setxattr,
@@ -749,7 +729,7 @@ static const struct inode_operations xfs_dir_ci_inode_operations = {
749 .rmdir = xfs_vn_unlink, 729 .rmdir = xfs_vn_unlink,
750 .mknod = xfs_vn_mknod, 730 .mknod = xfs_vn_mknod,
751 .rename = xfs_vn_rename, 731 .rename = xfs_vn_rename,
752 .permission = xfs_vn_permission, 732 .check_acl = xfs_check_acl,
753 .getattr = xfs_vn_getattr, 733 .getattr = xfs_vn_getattr,
754 .setattr = xfs_vn_setattr, 734 .setattr = xfs_vn_setattr,
755 .setxattr = generic_setxattr, 735 .setxattr = generic_setxattr,
@@ -762,7 +742,7 @@ static const struct inode_operations xfs_symlink_inode_operations = {
762 .readlink = generic_readlink, 742 .readlink = generic_readlink,
763 .follow_link = xfs_vn_follow_link, 743 .follow_link = xfs_vn_follow_link,
764 .put_link = xfs_vn_put_link, 744 .put_link = xfs_vn_put_link,
765 .permission = xfs_vn_permission, 745 .check_acl = xfs_check_acl,
766 .getattr = xfs_vn_getattr, 746 .getattr = xfs_vn_getattr,
767 .setattr = xfs_vn_setattr, 747 .setattr = xfs_vn_setattr,
768 .setxattr = generic_setxattr, 748 .setxattr = generic_setxattr,