aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/file.c
diff options
context:
space:
mode:
authorMark Fasheh <mark.fasheh@oracle.com>2007-10-18 18:30:42 -0400
committerMark Fasheh <mark.fasheh@oracle.com>2008-01-25 17:46:01 -0500
commite63aecb651ba73dffc62f9608ee1b7ae2a0ffd4b (patch)
tree06a4b727230120fe73421dc3149c21aaed5fe91e /fs/ocfs2/file.c
parentc934a92d05b549dd2f25db72c5fc3cb9dcf1b611 (diff)
ocfs2: Rename ocfs2_meta_[un]lock
Call this the "inode_lock" now, since it covers both data and meta data. This patch makes no functional changes. Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/file.c')
-rw-r--r--fs/ocfs2/file.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index c5c183ac41fe..432e5f3c4784 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -1025,7 +1025,7 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
1025 } 1025 }
1026 } 1026 }
1027 1027
1028 status = ocfs2_meta_lock(inode, &bh, 1); 1028 status = ocfs2_inode_lock(inode, &bh, 1);
1029 if (status < 0) { 1029 if (status < 0) {
1030 if (status != -ENOENT) 1030 if (status != -ENOENT)
1031 mlog_errno(status); 1031 mlog_errno(status);
@@ -1077,7 +1077,7 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
1077bail_commit: 1077bail_commit:
1078 ocfs2_commit_trans(osb, handle); 1078 ocfs2_commit_trans(osb, handle);
1079bail_unlock: 1079bail_unlock:
1080 ocfs2_meta_unlock(inode, 1); 1080 ocfs2_inode_unlock(inode, 1);
1081bail_unlock_rw: 1081bail_unlock_rw:
1082 if (size_change) 1082 if (size_change)
1083 ocfs2_rw_unlock(inode, 1); 1083 ocfs2_rw_unlock(inode, 1);
@@ -1124,7 +1124,7 @@ int ocfs2_permission(struct inode *inode, int mask, struct nameidata *nd)
1124 1124
1125 mlog_entry_void(); 1125 mlog_entry_void();
1126 1126
1127 ret = ocfs2_meta_lock(inode, NULL, 0); 1127 ret = ocfs2_inode_lock(inode, NULL, 0);
1128 if (ret) { 1128 if (ret) {
1129 if (ret != -ENOENT) 1129 if (ret != -ENOENT)
1130 mlog_errno(ret); 1130 mlog_errno(ret);
@@ -1133,7 +1133,7 @@ int ocfs2_permission(struct inode *inode, int mask, struct nameidata *nd)
1133 1133
1134 ret = generic_permission(inode, mask, NULL); 1134 ret = generic_permission(inode, mask, NULL);
1135 1135
1136 ocfs2_meta_unlock(inode, 0); 1136 ocfs2_inode_unlock(inode, 0);
1137out: 1137out:
1138 mlog_exit(ret); 1138 mlog_exit(ret);
1139 return ret; 1139 return ret;
@@ -1605,7 +1605,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
1605 goto out; 1605 goto out;
1606 } 1606 }
1607 1607
1608 ret = ocfs2_meta_lock(inode, &di_bh, 1); 1608 ret = ocfs2_inode_lock(inode, &di_bh, 1);
1609 if (ret) { 1609 if (ret) {
1610 mlog_errno(ret); 1610 mlog_errno(ret);
1611 goto out_rw_unlock; 1611 goto out_rw_unlock;
@@ -1613,7 +1613,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
1613 1613
1614 if (inode->i_flags & (S_IMMUTABLE|S_APPEND)) { 1614 if (inode->i_flags & (S_IMMUTABLE|S_APPEND)) {
1615 ret = -EPERM; 1615 ret = -EPERM;
1616 goto out_meta_unlock; 1616 goto out_inode_unlock;
1617 } 1617 }
1618 1618
1619 switch (sr->l_whence) { 1619 switch (sr->l_whence) {
@@ -1627,7 +1627,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
1627 break; 1627 break;
1628 default: 1628 default:
1629 ret = -EINVAL; 1629 ret = -EINVAL;
1630 goto out_meta_unlock; 1630 goto out_inode_unlock;
1631 } 1631 }
1632 sr->l_whence = 0; 1632 sr->l_whence = 0;
1633 1633
@@ -1638,14 +1638,14 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
1638 || (sr->l_start + llen) < 0 1638 || (sr->l_start + llen) < 0
1639 || (sr->l_start + llen) > max_off) { 1639 || (sr->l_start + llen) > max_off) {
1640 ret = -EINVAL; 1640 ret = -EINVAL;
1641 goto out_meta_unlock; 1641 goto out_inode_unlock;
1642 } 1642 }
1643 size = sr->l_start + sr->l_len; 1643 size = sr->l_start + sr->l_len;
1644 1644
1645 if (cmd == OCFS2_IOC_RESVSP || cmd == OCFS2_IOC_RESVSP64) { 1645 if (cmd == OCFS2_IOC_RESVSP || cmd == OCFS2_IOC_RESVSP64) {
1646 if (sr->l_len <= 0) { 1646 if (sr->l_len <= 0) {
1647 ret = -EINVAL; 1647 ret = -EINVAL;
1648 goto out_meta_unlock; 1648 goto out_inode_unlock;
1649 } 1649 }
1650 } 1650 }
1651 1651
@@ -1653,7 +1653,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
1653 ret = __ocfs2_write_remove_suid(inode, di_bh); 1653 ret = __ocfs2_write_remove_suid(inode, di_bh);
1654 if (ret) { 1654 if (ret) {
1655 mlog_errno(ret); 1655 mlog_errno(ret);
1656 goto out_meta_unlock; 1656 goto out_inode_unlock;
1657 } 1657 }
1658 } 1658 }
1659 1659
@@ -1679,7 +1679,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
1679 up_write(&OCFS2_I(inode)->ip_alloc_sem); 1679 up_write(&OCFS2_I(inode)->ip_alloc_sem);
1680 if (ret) { 1680 if (ret) {
1681 mlog_errno(ret); 1681 mlog_errno(ret);
1682 goto out_meta_unlock; 1682 goto out_inode_unlock;
1683 } 1683 }
1684 1684
1685 /* 1685 /*
@@ -1689,7 +1689,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
1689 if (IS_ERR(handle)) { 1689 if (IS_ERR(handle)) {
1690 ret = PTR_ERR(handle); 1690 ret = PTR_ERR(handle);
1691 mlog_errno(ret); 1691 mlog_errno(ret);
1692 goto out_meta_unlock; 1692 goto out_inode_unlock;
1693 } 1693 }
1694 1694
1695 if (change_size && i_size_read(inode) < size) 1695 if (change_size && i_size_read(inode) < size)
@@ -1702,9 +1702,9 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
1702 1702
1703 ocfs2_commit_trans(osb, handle); 1703 ocfs2_commit_trans(osb, handle);
1704 1704
1705out_meta_unlock: 1705out_inode_unlock:
1706 brelse(di_bh); 1706 brelse(di_bh);
1707 ocfs2_meta_unlock(inode, 1); 1707 ocfs2_inode_unlock(inode, 1);
1708out_rw_unlock: 1708out_rw_unlock:
1709 ocfs2_rw_unlock(inode, 1); 1709 ocfs2_rw_unlock(inode, 1);
1710 1710
@@ -1774,7 +1774,7 @@ static int ocfs2_prepare_inode_for_write(struct dentry *dentry,
1774 * if we need to make modifications here. 1774 * if we need to make modifications here.
1775 */ 1775 */
1776 for(;;) { 1776 for(;;) {
1777 ret = ocfs2_meta_lock(inode, NULL, meta_level); 1777 ret = ocfs2_inode_lock(inode, NULL, meta_level);
1778 if (ret < 0) { 1778 if (ret < 0) {
1779 meta_level = -1; 1779 meta_level = -1;
1780 mlog_errno(ret); 1780 mlog_errno(ret);
@@ -1792,7 +1792,7 @@ static int ocfs2_prepare_inode_for_write(struct dentry *dentry,
1792 * set inode->i_size at the end of a write. */ 1792 * set inode->i_size at the end of a write. */
1793 if (should_remove_suid(dentry)) { 1793 if (should_remove_suid(dentry)) {
1794 if (meta_level == 0) { 1794 if (meta_level == 0) {
1795 ocfs2_meta_unlock(inode, meta_level); 1795 ocfs2_inode_unlock(inode, meta_level);
1796 meta_level = 1; 1796 meta_level = 1;
1797 continue; 1797 continue;
1798 } 1798 }
@@ -1861,7 +1861,7 @@ static int ocfs2_prepare_inode_for_write(struct dentry *dentry,
1861 *ppos = saved_pos; 1861 *ppos = saved_pos;
1862 1862
1863out_unlock: 1863out_unlock:
1864 ocfs2_meta_unlock(inode, meta_level); 1864 ocfs2_inode_unlock(inode, meta_level);
1865 1865
1866out: 1866out:
1867 return ret; 1867 return ret;
@@ -2074,12 +2074,12 @@ static ssize_t ocfs2_file_splice_read(struct file *in,
2074 /* 2074 /*
2075 * See the comment in ocfs2_file_aio_read() 2075 * See the comment in ocfs2_file_aio_read()
2076 */ 2076 */
2077 ret = ocfs2_meta_lock(inode, NULL, 0); 2077 ret = ocfs2_inode_lock(inode, NULL, 0);
2078 if (ret < 0) { 2078 if (ret < 0) {
2079 mlog_errno(ret); 2079 mlog_errno(ret);
2080 goto bail; 2080 goto bail;
2081 } 2081 }
2082 ocfs2_meta_unlock(inode, 0); 2082 ocfs2_inode_unlock(inode, 0);
2083 2083
2084 ret = generic_file_splice_read(in, ppos, pipe, len, flags); 2084 ret = generic_file_splice_read(in, ppos, pipe, len, flags);
2085 2085
@@ -2135,12 +2135,12 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb,
2135 * like i_size. This allows the checks down below 2135 * like i_size. This allows the checks down below
2136 * generic_file_aio_read() a chance of actually working. 2136 * generic_file_aio_read() a chance of actually working.
2137 */ 2137 */
2138 ret = ocfs2_meta_lock_atime(inode, filp->f_vfsmnt, &lock_level); 2138 ret = ocfs2_inode_lock_atime(inode, filp->f_vfsmnt, &lock_level);
2139 if (ret < 0) { 2139 if (ret < 0) {
2140 mlog_errno(ret); 2140 mlog_errno(ret);
2141 goto bail; 2141 goto bail;
2142 } 2142 }
2143 ocfs2_meta_unlock(inode, lock_level); 2143 ocfs2_inode_unlock(inode, lock_level);
2144 2144
2145 ret = generic_file_aio_read(iocb, iov, nr_segs, iocb->ki_pos); 2145 ret = generic_file_aio_read(iocb, iov, nr_segs, iocb->ki_pos);
2146 if (ret == -EINVAL) 2146 if (ret == -EINVAL)