X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=fs%2Fcifs%2Fcifssmb.c;h=bc09c998631f48dae30c6b004d9f6abdcba5b4ac;hb=a3307eaf1390bd5dbe36de6116a1ce73a4c61cfa;hp=939e2f76b9596203ab68276a59aad6fd8c36981e;hpb=d6f818f71fa5db79969aaecba302745199376169;p=linux-2.6-omap-h63xx.git diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 939e2f76b95..bc09c998631 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -1933,6 +1933,27 @@ CIFSSMBClose(const int xid, struct cifsTconInfo *tcon, int smb_file_id) return rc; } +int +CIFSSMBFlush(const int xid, struct cifsTconInfo *tcon, int smb_file_id) +{ + int rc = 0; + FLUSH_REQ *pSMB = NULL; + cFYI(1, ("In CIFSSMBFlush")); + + rc = small_smb_init(SMB_COM_FLUSH, 1, tcon, (void **) &pSMB); + if (rc) + return rc; + + pSMB->FileID = (__u16) smb_file_id; + pSMB->ByteCount = 0; + rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0); + cifs_stats_inc(&tcon->num_flushes); + if (rc) + cERROR(1, ("Send error in Flush = %d", rc)); + + return rc; +} + int CIFSSMBRename(const int xid, struct cifsTconInfo *tcon, const char *fromName, const char *toName, @@ -2356,8 +2377,10 @@ winCreateHardLinkRetry: PATH_MAX, nls_codepage, remap); name_len++; /* trailing null */ name_len *= 2; - pSMB->OldFileName[name_len] = 0; /* pad */ - pSMB->OldFileName[name_len + 1] = 0x04; + + /* protocol specifies ASCII buffer format (0x04) for unicode */ + pSMB->OldFileName[name_len] = 0x04; + pSMB->OldFileName[name_len + 1] = 0x00; /* pad */ name_len2 = cifsConvertToUCS((__le16 *)&pSMB->OldFileName[name_len + 2], toName, PATH_MAX, nls_codepage, remap);