Project

General

Profile

Bug #7483 ยป illumos-7483-1.patch

Dan Vatca, 2016-10-19 05:47 PM

View differences:

usr/src/uts/common/fs/smbsrv/smb2_flush.c
53 53
	}
54 54
	of = sr->fid_ofile;
55 55

  
56
	/*
57
	 * XXX - todo:
58
	 * Flush named pipe should drain writes.
59
	 */
60
	if ((of->f_node->flags & NODE_FLAGS_WRITE_THROUGH) == 0)
61
		(void) smb_fsop_commit(sr, of->f_cr, of->f_node);
56
	smb_ofile_flush(sr, of);
62 57

  
63 58
	/*
64 59
	 * SMB2 Flush reply
usr/src/uts/common/fs/smbsrv/smb_flush.c
113 113
/*
114 114
 * smb_flush_file
115 115
 *
116
 * If writes on this file are not synchronous, flush it using the NFSv3
117
 * commit interface.
118 116
 */
119 117
static void
120 118
smb_flush_file(struct smb_request *sr, struct smb_ofile *ofile)
121 119
{
122 120
	sr->user_cr = smb_ofile_getcred(ofile);
123 121

  
124
	if ((ofile->f_node->flags & NODE_FLAGS_WRITE_THROUGH) == 0)
125
		(void) smb_fsop_commit(sr, sr->user_cr, ofile->f_node);
122
	smb_ofile_flush(sr, ofile);
126 123
}
usr/src/uts/common/fs/smbsrv/smb_ofile.c
837 837
}
838 838

  
839 839
/*
840
 * smb_ofile_flush
841
 *
842
 * If writes on this file are not synchronous, flush it using the NFSv3
843
 * commit interface.
844
 *
845
 * XXX - todo: Flush named pipe should drain writes.
846
 */
847
void
848
smb_ofile_flush(struct smb_request *sr, struct smb_ofile *of)
849
{
850
	switch (ofile->f_ftype) {
851
	case SMB_FTYPE_DISK:
852
		if ((ofile->f_node->flags & NODE_FLAGS_WRITE_THROUGH) == 0)
853
			(void) smb_fsop_commit(sr, sr->user_cr, ofile->f_node);
854
		break;
855
	case SMB_FTYPE_BYTE_PIPE:
856
	case SMB_FTYPE_MESG_PIPE:
857
	case SMB_FTYPE_PRINTER:
858
	case SMB_FTYPE_UNKNOWN:
859
		break;
860
	default:
861
		break;
862
	}
863
}
864

  
865
/*
840 866
 * smb_ofile_is_open
841 867
 */
842 868
boolean_t
    (1-1/1)