diff options
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_iops.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_iops.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index cd42ef78f6b5..e65a7937f3a4 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c | |||
@@ -47,6 +47,7 @@ | |||
47 | #include "xfs_buf_item.h" | 47 | #include "xfs_buf_item.h" |
48 | #include "xfs_utils.h" | 48 | #include "xfs_utils.h" |
49 | #include "xfs_vnodeops.h" | 49 | #include "xfs_vnodeops.h" |
50 | #include "xfs_trace.h" | ||
50 | 51 | ||
51 | #include <linux/capability.h> | 52 | #include <linux/capability.h> |
52 | #include <linux/xattr.h> | 53 | #include <linux/xattr.h> |
@@ -55,6 +56,7 @@ | |||
55 | #include <linux/security.h> | 56 | #include <linux/security.h> |
56 | #include <linux/falloc.h> | 57 | #include <linux/falloc.h> |
57 | #include <linux/fiemap.h> | 58 | #include <linux/fiemap.h> |
59 | #include <linux/slab.h> | ||
58 | 60 | ||
59 | /* | 61 | /* |
60 | * Bring the timestamps in the XFS inode uptodate. | 62 | * Bring the timestamps in the XFS inode uptodate. |
@@ -90,6 +92,16 @@ xfs_mark_inode_dirty_sync( | |||
90 | mark_inode_dirty_sync(inode); | 92 | mark_inode_dirty_sync(inode); |
91 | } | 93 | } |
92 | 94 | ||
95 | void | ||
96 | xfs_mark_inode_dirty( | ||
97 | xfs_inode_t *ip) | ||
98 | { | ||
99 | struct inode *inode = VFS_I(ip); | ||
100 | |||
101 | if (!(inode->i_state & (I_WILL_FREE|I_FREEING|I_CLEAR))) | ||
102 | mark_inode_dirty(inode); | ||
103 | } | ||
104 | |||
93 | /* | 105 | /* |
94 | * Change the requested timestamp in the given inode. | 106 | * Change the requested timestamp in the given inode. |
95 | * We don't lock across timestamp updates, and we don't log them but | 107 | * We don't lock across timestamp updates, and we don't log them but |
@@ -139,10 +151,10 @@ xfs_init_security( | |||
139 | struct xfs_inode *ip = XFS_I(inode); | 151 | struct xfs_inode *ip = XFS_I(inode); |
140 | size_t length; | 152 | size_t length; |
141 | void *value; | 153 | void *value; |
142 | char *name; | 154 | unsigned char *name; |
143 | int error; | 155 | int error; |
144 | 156 | ||
145 | error = security_inode_init_security(inode, dir, &name, | 157 | error = security_inode_init_security(inode, dir, (char **)&name, |
146 | &value, &length); | 158 | &value, &length); |
147 | if (error) { | 159 | if (error) { |
148 | if (error == -EOPNOTSUPP) | 160 | if (error == -EOPNOTSUPP) |
@@ -573,8 +585,8 @@ xfs_vn_fallocate( | |||
573 | bf.l_len = len; | 585 | bf.l_len = len; |
574 | 586 | ||
575 | xfs_ilock(ip, XFS_IOLOCK_EXCL); | 587 | xfs_ilock(ip, XFS_IOLOCK_EXCL); |
576 | error = xfs_change_file_space(ip, XFS_IOC_RESVSP, &bf, | 588 | error = -xfs_change_file_space(ip, XFS_IOC_RESVSP, &bf, |
577 | 0, XFS_ATTR_NOLOCK); | 589 | 0, XFS_ATTR_NOLOCK); |
578 | if (!error && !(mode & FALLOC_FL_KEEP_SIZE) && | 590 | if (!error && !(mode & FALLOC_FL_KEEP_SIZE) && |
579 | offset + len > i_size_read(inode)) | 591 | offset + len > i_size_read(inode)) |
580 | new_size = offset + len; | 592 | new_size = offset + len; |
@@ -585,7 +597,7 @@ xfs_vn_fallocate( | |||
585 | 597 | ||
586 | iattr.ia_valid = ATTR_SIZE; | 598 | iattr.ia_valid = ATTR_SIZE; |
587 | iattr.ia_size = new_size; | 599 | iattr.ia_size = new_size; |
588 | error = xfs_setattr(ip, &iattr, XFS_ATTR_NOLOCK); | 600 | error = -xfs_setattr(ip, &iattr, XFS_ATTR_NOLOCK); |
589 | } | 601 | } |
590 | 602 | ||
591 | xfs_iunlock(ip, XFS_IOLOCK_EXCL); | 603 | xfs_iunlock(ip, XFS_IOLOCK_EXCL); |
@@ -793,7 +805,7 @@ xfs_setup_inode( | |||
793 | struct inode *inode = &ip->i_vnode; | 805 | struct inode *inode = &ip->i_vnode; |
794 | 806 | ||
795 | inode->i_ino = ip->i_ino; | 807 | inode->i_ino = ip->i_ino; |
796 | inode->i_state = I_NEW|I_LOCK; | 808 | inode->i_state = I_NEW; |
797 | inode_add_to_lists(ip->i_mount->m_super, inode); | 809 | inode_add_to_lists(ip->i_mount->m_super, inode); |
798 | 810 | ||
799 | inode->i_mode = ip->i_d.di_mode; | 811 | inode->i_mode = ip->i_d.di_mode; |