diff options
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/cluster/netdebug.c | 4 | ||||
-rw-r--r-- | fs/ocfs2/dlm/dlmdebug.c | 2 | ||||
-rw-r--r-- | fs/ocfs2/dlm/dlmfs.c | 1 | ||||
-rw-r--r-- | fs/ocfs2/file.c | 49 | ||||
-rw-r--r-- | fs/ocfs2/ioctl.c | 1 | ||||
-rw-r--r-- | fs/ocfs2/quota.h | 2 | ||||
-rw-r--r-- | fs/ocfs2/quota_global.c | 4 | ||||
-rw-r--r-- | fs/ocfs2/super.c | 2 |
8 files changed, 26 insertions, 39 deletions
diff --git a/fs/ocfs2/cluster/netdebug.c b/fs/ocfs2/cluster/netdebug.c index f8424874fa07..cfb2be708abe 100644 --- a/fs/ocfs2/cluster/netdebug.c +++ b/fs/ocfs2/cluster/netdebug.c | |||
@@ -163,7 +163,7 @@ static void nst_seq_stop(struct seq_file *seq, void *v) | |||
163 | { | 163 | { |
164 | } | 164 | } |
165 | 165 | ||
166 | static struct seq_operations nst_seq_ops = { | 166 | static const struct seq_operations nst_seq_ops = { |
167 | .start = nst_seq_start, | 167 | .start = nst_seq_start, |
168 | .next = nst_seq_next, | 168 | .next = nst_seq_next, |
169 | .stop = nst_seq_stop, | 169 | .stop = nst_seq_stop, |
@@ -344,7 +344,7 @@ static void sc_seq_stop(struct seq_file *seq, void *v) | |||
344 | { | 344 | { |
345 | } | 345 | } |
346 | 346 | ||
347 | static struct seq_operations sc_seq_ops = { | 347 | static const struct seq_operations sc_seq_ops = { |
348 | .start = sc_seq_start, | 348 | .start = sc_seq_start, |
349 | .next = sc_seq_next, | 349 | .next = sc_seq_next, |
350 | .stop = sc_seq_stop, | 350 | .stop = sc_seq_stop, |
diff --git a/fs/ocfs2/dlm/dlmdebug.c b/fs/ocfs2/dlm/dlmdebug.c index df52f706f669..c5c88124096d 100644 --- a/fs/ocfs2/dlm/dlmdebug.c +++ b/fs/ocfs2/dlm/dlmdebug.c | |||
@@ -683,7 +683,7 @@ static int lockres_seq_show(struct seq_file *s, void *v) | |||
683 | return 0; | 683 | return 0; |
684 | } | 684 | } |
685 | 685 | ||
686 | static struct seq_operations debug_lockres_ops = { | 686 | static const struct seq_operations debug_lockres_ops = { |
687 | .start = lockres_seq_start, | 687 | .start = lockres_seq_start, |
688 | .stop = lockres_seq_stop, | 688 | .stop = lockres_seq_stop, |
689 | .next = lockres_seq_next, | 689 | .next = lockres_seq_next, |
diff --git a/fs/ocfs2/dlm/dlmfs.c b/fs/ocfs2/dlm/dlmfs.c index 1c9efb406a96..02bf17808bdc 100644 --- a/fs/ocfs2/dlm/dlmfs.c +++ b/fs/ocfs2/dlm/dlmfs.c | |||
@@ -325,6 +325,7 @@ clear_fields: | |||
325 | } | 325 | } |
326 | 326 | ||
327 | static struct backing_dev_info dlmfs_backing_dev_info = { | 327 | static struct backing_dev_info dlmfs_backing_dev_info = { |
328 | .name = "ocfs2-dlmfs", | ||
328 | .ra_pages = 0, /* No readahead */ | 329 | .ra_pages = 0, /* No readahead */ |
329 | .capabilities = BDI_CAP_NO_ACCT_AND_WRITEBACK, | 330 | .capabilities = BDI_CAP_NO_ACCT_AND_WRITEBACK, |
330 | }; | 331 | }; |
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 2effac5d030e..89fc8ee1f5a5 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -1998,8 +1998,7 @@ relock: | |||
1998 | goto out_dio; | 1998 | goto out_dio; |
1999 | } | 1999 | } |
2000 | } else { | 2000 | } else { |
2001 | written = generic_file_aio_write_nolock(iocb, iov, nr_segs, | 2001 | written = __generic_file_aio_write(iocb, iov, nr_segs, ppos); |
2002 | *ppos); | ||
2003 | } | 2002 | } |
2004 | 2003 | ||
2005 | out_dio: | 2004 | out_dio: |
@@ -2007,18 +2006,21 @@ out_dio: | |||
2007 | BUG_ON(ret == -EIOCBQUEUED && !(file->f_flags & O_DIRECT)); | 2006 | BUG_ON(ret == -EIOCBQUEUED && !(file->f_flags & O_DIRECT)); |
2008 | 2007 | ||
2009 | if ((file->f_flags & O_SYNC && !direct_io) || IS_SYNC(inode)) { | 2008 | if ((file->f_flags & O_SYNC && !direct_io) || IS_SYNC(inode)) { |
2010 | /* | 2009 | ret = filemap_fdatawrite_range(file->f_mapping, pos, |
2011 | * The generic write paths have handled getting data | 2010 | pos + count - 1); |
2012 | * to disk, but since we don't make use of the dirty | 2011 | if (ret < 0) |
2013 | * inode list, a manual journal commit is necessary | 2012 | written = ret; |
2014 | * here. | 2013 | |
2015 | */ | 2014 | if (!ret && (old_size != i_size_read(inode) || |
2016 | if (old_size != i_size_read(inode) || | 2015 | old_clusters != OCFS2_I(inode)->ip_clusters)) { |
2017 | old_clusters != OCFS2_I(inode)->ip_clusters) { | ||
2018 | ret = jbd2_journal_force_commit(osb->journal->j_journal); | 2016 | ret = jbd2_journal_force_commit(osb->journal->j_journal); |
2019 | if (ret < 0) | 2017 | if (ret < 0) |
2020 | written = ret; | 2018 | written = ret; |
2021 | } | 2019 | } |
2020 | |||
2021 | if (!ret) | ||
2022 | ret = filemap_fdatawait_range(file->f_mapping, pos, | ||
2023 | pos + count - 1); | ||
2022 | } | 2024 | } |
2023 | 2025 | ||
2024 | /* | 2026 | /* |
@@ -2118,31 +2120,16 @@ static ssize_t ocfs2_file_splice_write(struct pipe_inode_info *pipe, | |||
2118 | 2120 | ||
2119 | if (ret > 0) { | 2121 | if (ret > 0) { |
2120 | unsigned long nr_pages; | 2122 | unsigned long nr_pages; |
2123 | int err; | ||
2121 | 2124 | ||
2122 | *ppos += ret; | ||
2123 | nr_pages = (ret + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; | 2125 | nr_pages = (ret + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; |
2124 | 2126 | ||
2125 | /* | 2127 | err = generic_write_sync(out, *ppos, ret); |
2126 | * If file or inode is SYNC and we actually wrote some data, | 2128 | if (err) |
2127 | * sync it. | 2129 | ret = err; |
2128 | */ | 2130 | else |
2129 | if (unlikely((out->f_flags & O_SYNC) || IS_SYNC(inode))) { | 2131 | *ppos += ret; |
2130 | int err; | ||
2131 | |||
2132 | mutex_lock(&inode->i_mutex); | ||
2133 | err = ocfs2_rw_lock(inode, 1); | ||
2134 | if (err < 0) { | ||
2135 | mlog_errno(err); | ||
2136 | } else { | ||
2137 | err = generic_osync_inode(inode, mapping, | ||
2138 | OSYNC_METADATA|OSYNC_DATA); | ||
2139 | ocfs2_rw_unlock(inode, 1); | ||
2140 | } | ||
2141 | mutex_unlock(&inode->i_mutex); | ||
2142 | 2132 | ||
2143 | if (err) | ||
2144 | ret = err; | ||
2145 | } | ||
2146 | balance_dirty_pages_ratelimited_nr(mapping, nr_pages); | 2133 | balance_dirty_pages_ratelimited_nr(mapping, nr_pages); |
2147 | } | 2134 | } |
2148 | 2135 | ||
diff --git a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c index a68d0e4ca6dc..31fbb0619510 100644 --- a/fs/ocfs2/ioctl.c +++ b/fs/ocfs2/ioctl.c | |||
@@ -7,7 +7,6 @@ | |||
7 | 7 | ||
8 | #include <linux/fs.h> | 8 | #include <linux/fs.h> |
9 | #include <linux/mount.h> | 9 | #include <linux/mount.h> |
10 | #include <linux/smp_lock.h> | ||
11 | 10 | ||
12 | #define MLOG_MASK_PREFIX ML_INODE | 11 | #define MLOG_MASK_PREFIX ML_INODE |
13 | #include <cluster/masklog.h> | 12 | #include <cluster/masklog.h> |
diff --git a/fs/ocfs2/quota.h b/fs/ocfs2/quota.h index 3fb96fcd4c81..e5df9d170b0c 100644 --- a/fs/ocfs2/quota.h +++ b/fs/ocfs2/quota.h | |||
@@ -109,7 +109,7 @@ void ocfs2_unlock_global_qf(struct ocfs2_mem_dqinfo *oinfo, int ex); | |||
109 | int ocfs2_read_quota_block(struct inode *inode, u64 v_block, | 109 | int ocfs2_read_quota_block(struct inode *inode, u64 v_block, |
110 | struct buffer_head **bh); | 110 | struct buffer_head **bh); |
111 | 111 | ||
112 | extern struct dquot_operations ocfs2_quota_operations; | 112 | extern const struct dquot_operations ocfs2_quota_operations; |
113 | extern struct quota_format_type ocfs2_quota_format; | 113 | extern struct quota_format_type ocfs2_quota_format; |
114 | 114 | ||
115 | int ocfs2_quota_setup(void); | 115 | int ocfs2_quota_setup(void); |
diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c index 7eadf8bf1e1f..b437dc0c4cad 100644 --- a/fs/ocfs2/quota_global.c +++ b/fs/ocfs2/quota_global.c | |||
@@ -154,7 +154,7 @@ static int ocfs2_get_quota_block(struct inode *inode, int block, | |||
154 | err = -EIO; | 154 | err = -EIO; |
155 | mlog_errno(err); | 155 | mlog_errno(err); |
156 | } | 156 | } |
157 | return err;; | 157 | return err; |
158 | } | 158 | } |
159 | 159 | ||
160 | /* Read data from global quotafile - avoid pagecache and such because we cannot | 160 | /* Read data from global quotafile - avoid pagecache and such because we cannot |
@@ -850,7 +850,7 @@ static void ocfs2_destroy_dquot(struct dquot *dquot) | |||
850 | kmem_cache_free(ocfs2_dquot_cachep, dquot); | 850 | kmem_cache_free(ocfs2_dquot_cachep, dquot); |
851 | } | 851 | } |
852 | 852 | ||
853 | struct dquot_operations ocfs2_quota_operations = { | 853 | const struct dquot_operations ocfs2_quota_operations = { |
854 | .initialize = dquot_initialize, | 854 | .initialize = dquot_initialize, |
855 | .drop = dquot_drop, | 855 | .drop = dquot_drop, |
856 | .alloc_space = dquot_alloc_space, | 856 | .alloc_space = dquot_alloc_space, |
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 154e62522b05..24feb449a1dc 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -966,7 +966,7 @@ static int ocfs2_quota_off(struct super_block *sb, int type, int remount) | |||
966 | return vfs_quota_disable(sb, type, DQUOT_LIMITS_ENABLED); | 966 | return vfs_quota_disable(sb, type, DQUOT_LIMITS_ENABLED); |
967 | } | 967 | } |
968 | 968 | ||
969 | static struct quotactl_ops ocfs2_quotactl_ops = { | 969 | static const struct quotactl_ops ocfs2_quotactl_ops = { |
970 | .quota_on = ocfs2_quota_on, | 970 | .quota_on = ocfs2_quota_on, |
971 | .quota_off = ocfs2_quota_off, | 971 | .quota_off = ocfs2_quota_off, |
972 | .quota_sync = vfs_quota_sync, | 972 | .quota_sync = vfs_quota_sync, |