View | Details | Raw Unified | Return to bug 194293 | Differences between
and this patch

Collapse All | Expand All

(-)fs/fuse/fuse_file.c (-1 / +11 lines)
Lines 141-147 fuse_filehandle_open(struct vnode *vp, Link Here
141
	foo = fdi.answ;
141
	foo = fdi.answ;
142
142
143
	fuse_filehandle_init(vp, fufh_type, fufhp, foo->fh);
143
	fuse_filehandle_init(vp, fufh_type, fufhp, foo->fh);
144
	fuse_vnode_open(vp, foo->open_flags, td);
144
145
	/*
146
	 * For WRONLY opens, force DIRECT_IO.  This is necessary
147
	 * since writing a partial block through the buffer cache
148
	 * will result in a read of the block and that read won't
149
	 * be allowed by the WRONLY open.
150
	 */
151
	if (fufh_type == FUFH_WRONLY)
152
		fuse_vnode_open(vp, foo->open_flags | FOPEN_DIRECT_IO, td);
153
	else
154
		fuse_vnode_open(vp, foo->open_flags, td);
145
155
146
out:
156
out:
147
	fdisp_destroy(&fdi);
157
	fdisp_destroy(&fdi);
(-)fs/fuse/fuse_vnops.c (-1 / +11 lines)
Lines 1139-1144 fuse_vnop_open(struct vop_open_args *ap) Link Here
1139
	struct fuse_vnode_data *fvdat;
1139
	struct fuse_vnode_data *fvdat;
1140
1140
1141
	int error, isdir = 0;
1141
	int error, isdir = 0;
1142
	int32_t fuse_open_flags;
1142
1143
1143
	FS_DEBUG2G("inode=%ju mode=0x%x\n", (uintmax_t)VTOI(vp), mode);
1144
	FS_DEBUG2G("inode=%ju mode=0x%x\n", (uintmax_t)VTOI(vp), mode);
1144
1145
Lines 1150-1163 fuse_vnop_open(struct vop_open_args *ap) Link Here
1150
	if (vnode_isdir(vp)) {
1151
	if (vnode_isdir(vp)) {
1151
		isdir = 1;
1152
		isdir = 1;
1152
	}
1153
	}
1154
	fuse_open_flags = 0;
1153
	if (isdir) {
1155
	if (isdir) {
1154
		fufh_type = FUFH_RDONLY;
1156
		fufh_type = FUFH_RDONLY;
1155
	} else {
1157
	} else {
1156
		fufh_type = fuse_filehandle_xlate_from_fflags(mode);
1158
		fufh_type = fuse_filehandle_xlate_from_fflags(mode);
1159
		/*
1160
		 * For WRONLY opens, force DIRECT_IO.  This is necessary
1161
		 * since writing a partial block through the buffer cache
1162
		 * will result in a read of the block and that read won't
1163
		 * be allowed by the WRONLY open.
1164
		 */
1165
		if (fufh_type == FUFH_WRONLY)
1166
			fuse_open_flags = FOPEN_DIRECT_IO;
1157
	}
1167
	}
1158
1168
1159
	if (fuse_filehandle_valid(vp, fufh_type)) {
1169
	if (fuse_filehandle_valid(vp, fufh_type)) {
1160
		fuse_vnode_open(vp, 0, td);
1170
		fuse_vnode_open(vp, fuse_open_flags, td);
1161
		return 0;
1171
		return 0;
1162
	}
1172
	}
1163
	error = fuse_filehandle_open(vp, fufh_type, NULL, td, cred);
1173
	error = fuse_filehandle_open(vp, fufh_type, NULL, td, cred);

Return to bug 194293