ffs_rawread.c (6a068746777241722b2b32c5d0bc443a2a64d80b) ffs_rawread.c (89f6b8632cc94bca2738b4fcc26e1189ef4f5dde)
1/*-
2 * Copyright (c) 2000-2003 Tor Egge
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 28 unchanged lines hidden (view full) ---

37#include <sys/mount.h>
38#include <sys/namei.h>
39#include <sys/vnode.h>
40#include <sys/conf.h>
41#include <sys/filio.h>
42#include <sys/ttycom.h>
43#include <sys/bio.h>
44#include <sys/buf.h>
1/*-
2 * Copyright (c) 2000-2003 Tor Egge
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 28 unchanged lines hidden (view full) ---

37#include <sys/mount.h>
38#include <sys/namei.h>
39#include <sys/vnode.h>
40#include <sys/conf.h>
41#include <sys/filio.h>
42#include <sys/ttycom.h>
43#include <sys/bio.h>
44#include <sys/buf.h>
45#include <sys/rwlock.h>
45#include <ufs/ufs/extattr.h>
46#include <ufs/ufs/quota.h>
47#include <ufs/ufs/inode.h>
48#include <ufs/ufs/ufsmount.h>
49#include <ufs/ufs/ufs_extern.h>
50#include <ufs/ffs/fs.h>
51#include <ufs/ffs/ffs_extern.h>
52

--- 85 unchanged lines hidden (view full) ---

138 VOP_LOCK(vp, LK_DOWNGRADE);
139 vn_finished_write(mp);
140 return (EIO);
141 }
142 /* Attempt to msync mmap() regions to clean dirty mmap */
143 if ((obj = vp->v_object) != NULL &&
144 (obj->flags & OBJ_MIGHTBEDIRTY) != 0) {
145 VI_UNLOCK(vp);
46#include <ufs/ufs/extattr.h>
47#include <ufs/ufs/quota.h>
48#include <ufs/ufs/inode.h>
49#include <ufs/ufs/ufsmount.h>
50#include <ufs/ufs/ufs_extern.h>
51#include <ufs/ffs/fs.h>
52#include <ufs/ffs/ffs_extern.h>
53

--- 85 unchanged lines hidden (view full) ---

139 VOP_LOCK(vp, LK_DOWNGRADE);
140 vn_finished_write(mp);
141 return (EIO);
142 }
143 /* Attempt to msync mmap() regions to clean dirty mmap */
144 if ((obj = vp->v_object) != NULL &&
145 (obj->flags & OBJ_MIGHTBEDIRTY) != 0) {
146 VI_UNLOCK(vp);
146 VM_OBJECT_LOCK(obj);
147 VM_OBJECT_WLOCK(obj);
147 vm_object_page_clean(obj, 0, 0, OBJPC_SYNC);
148 vm_object_page_clean(obj, 0, 0, OBJPC_SYNC);
148 VM_OBJECT_UNLOCK(obj);
149 VM_OBJECT_WUNLOCK(obj);
149 } else
150 VI_UNLOCK(vp);
151
152 /* Wait for pending writes to complete */
153 BO_LOCK(bo);
154 error = bufobj_wwait(&vp->v_bufobj, 0, 0);
155 if (error != 0) {
156 /* XXX: can't happen with a zero timeout ??? */

--- 340 unchanged lines hidden ---
150 } else
151 VI_UNLOCK(vp);
152
153 /* Wait for pending writes to complete */
154 BO_LOCK(bo);
155 error = bufobj_wwait(&vp->v_bufobj, 0, 0);
156 if (error != 0) {
157 /* XXX: can't happen with a zero timeout ??? */

--- 340 unchanged lines hidden ---