aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/file.c
diff options
context:
space:
mode:
authorJoel Becker <joel.becker@oracle.com>2008-09-03 23:03:41 -0400
committerMark Fasheh <mfasheh@suse.com>2008-10-13 20:02:43 -0400
commit2b4e30fbde425828b17f0e9c8f8e3fd3ecb2bc75 (patch)
tree5b340cde72e058b51642f0c7255818f62014bc91 /fs/ocfs2/file.c
parent12462f1d9f0b96389497438dc2730c6f7410be82 (diff)
ocfs2: Switch over to JBD2.
ocfs2 wants JBD2 for many reasons, not the least of which is that JBD is limiting our maximum filesystem size. It's a pretty trivial change. Most functions are just renamed. The only functional change is moving to Jan's inode-based ordered data mode. It's better, too. Because JBD2 reads and writes JBD journals, this is compatible with any existing filesystem. It can even interact with JBD-based ocfs2 as long as the journal is formated for JBD. We provide a compatibility option so that paranoid people can still use JBD for the time being. This will go away shortly. [ Moved call of ocfs2_begin_ordered_truncate() from ocfs2_delete_inode() to ocfs2_truncate_for_delete(). --Mark ] Signed-off-by: Joel Becker <joel.becker@oracle.com> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/file.c')
-rw-r--r--fs/ocfs2/file.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 441c6a94059..c95318bc00c 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -185,7 +185,7 @@ static int ocfs2_sync_file(struct file *file,
185 goto bail; 185 goto bail;
186 186
187 journal = osb->journal->j_journal; 187 journal = osb->journal->j_journal;
188 err = journal_force_commit(journal); 188 err = jbd2_journal_force_commit(journal);
189 189
190bail: 190bail:
191 mlog_exit(err); 191 mlog_exit(err);
@@ -941,9 +941,15 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
941 goto bail_unlock; 941 goto bail_unlock;
942 } 942 }
943 943
944 if (i_size_read(inode) > attr->ia_size) 944 if (i_size_read(inode) > attr->ia_size) {
945 if (ocfs2_should_order_data(inode)) {
946 status = ocfs2_begin_ordered_truncate(inode,
947 attr->ia_size);
948 if (status)
949 goto bail_unlock;
950 }
945 status = ocfs2_truncate_file(inode, bh, attr->ia_size); 951 status = ocfs2_truncate_file(inode, bh, attr->ia_size);
946 else 952 } else
947 status = ocfs2_extend_file(inode, bh, attr->ia_size); 953 status = ocfs2_extend_file(inode, bh, attr->ia_size);
948 if (status < 0) { 954 if (status < 0) {
949 if (status != -ENOSPC) 955 if (status != -ENOSPC)
@@ -1888,7 +1894,7 @@ out_dio:
1888 */ 1894 */
1889 if (old_size != i_size_read(inode) || 1895 if (old_size != i_size_read(inode) ||
1890 old_clusters != OCFS2_I(inode)->ip_clusters) { 1896 old_clusters != OCFS2_I(inode)->ip_clusters) {
1891 ret = journal_force_commit(osb->journal->j_journal); 1897 ret = jbd2_journal_force_commit(osb->journal->j_journal);
1892 if (ret < 0) 1898 if (ret < 0)
1893 written = ret; 1899 written = ret;
1894 } 1900 }