[Cluster-devel] cluster/gfs-kernel/src/gfs ops_file.c
wcheng at sourceware.org
wcheng at sourceware.org
Fri Nov 17 16:15:32 UTC 2006
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: wcheng at sourceware.org 2006-11-17 16:15:32
Modified files:
gfs-kernel/src/gfs: ops_file.c
Log message:
Bugzilla 214274: Oops... only directIO has this issue - buffer IO should be
fine. Revert buffer io changes.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/ops_file.c.diff?cvsroot=cluster&r1=1.29&r2=1.30
--- cluster/gfs-kernel/src/gfs/ops_file.c 2006/11/17 05:00:57 1.29
+++ cluster/gfs-kernel/src/gfs/ops_file.c 2006/11/17 16:15:31 1.30
@@ -700,15 +700,18 @@
if (alloc_required) {
set_bit(GFF_DID_DIRECT_ALLOC, &fp->f_flags);
+ /* for asynchronous IO, the buffer can not be splitted */
+ if (iocb) {
+ count = do_write_direct_alloc(file, buf, size, offset, iocb);
+ goto out_iocb_write;
+ }
+
/* split large writes into smaller atomic transactions */
while (size) {
- if (iocb)
+ s = gfs_tune_get(sdp, gt_max_atomic_write);
+ if (s > size)
s = size;
- else {
- s = gfs_tune_get(sdp, gt_max_atomic_write);
- if (s > size)
- s = size;
- }
+
error = do_write_direct_alloc(file, buf, s, offset, iocb);
if (error < 0)
goto out_gunlock;
@@ -740,6 +743,7 @@
gfs_glock_dq_uninit(&t_gh);
}
+out_iocb_write:
error = 0;
out_gunlock:
@@ -977,13 +981,9 @@
/* split large writes into smaller atomic transactions */
while (size) {
- if (iocb)
+ s = gfs_tune_get(sdp, gt_max_atomic_write);
+ if (s > size)
s = size;
- else {
- s = gfs_tune_get(sdp, gt_max_atomic_write);
- if (s > size)
- s = size;
- }
error = do_do_write_buf(file, buf, s, offset, iocb);
if (error < 0)
More information about the Cluster-devel
mailing list