aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifspdu.h
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2009-02-21 16:17:43 -0500
committerSteve French <sfrench@us.ibm.com>2009-03-11 21:36:20 -0400
commitb298f223559e0205244f553ceef8c7df3674da74 (patch)
treea65cb2f64d1b999b7b573857a8b33bbb83ff97af /fs/cifs/cifspdu.h
parentebdcc81c71937b30e09110c02a1e8a21fa770b6f (diff)
[CIFS] Send SMB flush in cifs_fsync
In contrast to the now-obsolete smbfs, cifs does not send SMB_COM_FLUSH in response to an explicit fsync(2) to guarantee that all volatile data is written to stable storage on the server side, provided the server honors the request (which, to my knowledge, is true for Windows and Samba with 'strict sync' enabled). This patch modifies the cifs_fsync implementation to restore the fsync-behavior of smbfs by triggering SMB_COM_FLUSH after sending outstanding data on the client side to the server. Signed-off-by: Horst Reiterer <horst.reiterer@gmail.com> Acked-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifspdu.h')
-rw-r--r--fs/cifs/cifspdu.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/cifs/cifspdu.h b/fs/cifs/cifspdu.h
index b4e2e9f0ee3d..eda6e511fd3e 100644
--- a/fs/cifs/cifspdu.h
+++ b/fs/cifs/cifspdu.h
@@ -43,6 +43,7 @@
43#define SMB_COM_CREATE_DIRECTORY 0x00 /* trivial response */ 43#define SMB_COM_CREATE_DIRECTORY 0x00 /* trivial response */
44#define SMB_COM_DELETE_DIRECTORY 0x01 /* trivial response */ 44#define SMB_COM_DELETE_DIRECTORY 0x01 /* trivial response */
45#define SMB_COM_CLOSE 0x04 /* triv req/rsp, timestamp ignored */ 45#define SMB_COM_CLOSE 0x04 /* triv req/rsp, timestamp ignored */
46#define SMB_COM_FLUSH 0x05 /* triv req/rsp */
46#define SMB_COM_DELETE 0x06 /* trivial response */ 47#define SMB_COM_DELETE 0x06 /* trivial response */
47#define SMB_COM_RENAME 0x07 /* trivial response */ 48#define SMB_COM_RENAME 0x07 /* trivial response */
48#define SMB_COM_QUERY_INFORMATION 0x08 /* aka getattr */ 49#define SMB_COM_QUERY_INFORMATION 0x08 /* aka getattr */
@@ -790,6 +791,12 @@ typedef struct smb_com_close_rsp {
790 __u16 ByteCount; /* bct = 0 */ 791 __u16 ByteCount; /* bct = 0 */
791} __attribute__((packed)) CLOSE_RSP; 792} __attribute__((packed)) CLOSE_RSP;
792 793
794typedef struct smb_com_flush_req {
795 struct smb_hdr hdr; /* wct = 1 */
796 __u16 FileID;
797 __u16 ByteCount; /* 0 */
798} __attribute__((packed)) FLUSH_REQ;
799
793typedef struct smb_com_findclose_req { 800typedef struct smb_com_findclose_req {
794 struct smb_hdr hdr; /* wct = 1 */ 801 struct smb_hdr hdr; /* wct = 1 */
795 __u16 FileID; 802 __u16 FileID;