diff options
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r-- | fs/cifs/cifssmb.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 939e2f76b959..bc09c998631f 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
@@ -1934,6 +1934,27 @@ CIFSSMBClose(const int xid, struct cifsTconInfo *tcon, int smb_file_id) | |||
1934 | } | 1934 | } |
1935 | 1935 | ||
1936 | int | 1936 | int |
1937 | CIFSSMBFlush(const int xid, struct cifsTconInfo *tcon, int smb_file_id) | ||
1938 | { | ||
1939 | int rc = 0; | ||
1940 | FLUSH_REQ *pSMB = NULL; | ||
1941 | cFYI(1, ("In CIFSSMBFlush")); | ||
1942 | |||
1943 | rc = small_smb_init(SMB_COM_FLUSH, 1, tcon, (void **) &pSMB); | ||
1944 | if (rc) | ||
1945 | return rc; | ||
1946 | |||
1947 | pSMB->FileID = (__u16) smb_file_id; | ||
1948 | pSMB->ByteCount = 0; | ||
1949 | rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0); | ||
1950 | cifs_stats_inc(&tcon->num_flushes); | ||
1951 | if (rc) | ||
1952 | cERROR(1, ("Send error in Flush = %d", rc)); | ||
1953 | |||
1954 | return rc; | ||
1955 | } | ||
1956 | |||
1957 | int | ||
1937 | CIFSSMBRename(const int xid, struct cifsTconInfo *tcon, | 1958 | CIFSSMBRename(const int xid, struct cifsTconInfo *tcon, |
1938 | const char *fromName, const char *toName, | 1959 | const char *fromName, const char *toName, |
1939 | const struct nls_table *nls_codepage, int remap) | 1960 | const struct nls_table *nls_codepage, int remap) |
@@ -2356,8 +2377,10 @@ winCreateHardLinkRetry: | |||
2356 | PATH_MAX, nls_codepage, remap); | 2377 | PATH_MAX, nls_codepage, remap); |
2357 | name_len++; /* trailing null */ | 2378 | name_len++; /* trailing null */ |
2358 | name_len *= 2; | 2379 | name_len *= 2; |
2359 | pSMB->OldFileName[name_len] = 0; /* pad */ | 2380 | |
2360 | pSMB->OldFileName[name_len + 1] = 0x04; | 2381 | /* protocol specifies ASCII buffer format (0x04) for unicode */ |
2382 | pSMB->OldFileName[name_len] = 0x04; | ||
2383 | pSMB->OldFileName[name_len + 1] = 0x00; /* pad */ | ||
2361 | name_len2 = | 2384 | name_len2 = |
2362 | cifsConvertToUCS((__le16 *)&pSMB->OldFileName[name_len + 2], | 2385 | cifsConvertToUCS((__le16 *)&pSMB->OldFileName[name_len + 2], |
2363 | toName, PATH_MAX, nls_codepage, remap); | 2386 | toName, PATH_MAX, nls_codepage, remap); |