Skip to content

Commit

Permalink
11017 Support Apple FULL_SYNC feature
Browse files Browse the repository at this point in the history
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Approved by: Garrett D'Amore <garrett@damore.org>
  • Loading branch information
gwr committed Jun 9, 2019
1 parent 94047d4 commit 479c108
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
6 changes: 4 additions & 2 deletions usr/src/uts/common/fs/smbsrv/smb2_aapl.c
Expand Up @@ -10,7 +10,7 @@
*/

/*
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
* Copyright 2017 Nexenta Systems, Inc. All rights reserved.
*/

/*
Expand Down Expand Up @@ -40,6 +40,8 @@ uint64_t smb2_aapl_server_caps =
* modes only when we have a trivial ACL.
*/

uint64_t smb2_aapl_volume_caps = kAAPL_SUPPORTS_FULL_SYNC;

/*
* Normally suppress file IDs for MacOS because it
* requires them to be unique per share, and ours
Expand Down Expand Up @@ -130,7 +132,7 @@ smb2_aapl_srv_query(smb_request_t *sr,
(void) smb_mbc_encodef(mbcout, "q", server_caps);
}
if ((server_bitmap & kAAPL_VOLUME_CAPS) != 0) {
(void) smb_mbc_encodef(mbcout, "q", 0);
(void) smb_mbc_encodef(mbcout, "q", smb2_aapl_volume_caps);
}

/* Pad2, null model string. */
Expand Down
18 changes: 15 additions & 3 deletions usr/src/uts/common/smbsrv/smb2_aapl.h
Expand Up @@ -22,8 +22,8 @@
*/

/*
* This content was published as: smb-759.0/kernel/netsmb/smb_2.h
* in http://opensource.apple.com/source/smb/smb-759.0.tar.gz
* This file contains excerpts of content published under:
* http://opensource.apple.com/source/smb/smb-759.40.1.1
*/

#ifndef _SMB2AAPL_H
Expand Down Expand Up @@ -111,9 +111,21 @@ enum {
/* Define Volume Capabilities bitmap */
enum {
kAAPL_SUPPORT_RESOLVE_ID = 0x01,
kAAPL_CASE_SENSITIVE = 0x02
kAAPL_CASE_SENSITIVE = 0x02,
kAAPL_SUPPORTS_FULL_SYNC = 0x04
};

/*
* kAAPL_SUPPORTS_FULL_SYNC - Full Sync Request
* If the volume supports Full Sync, then when a F_FULLSYNC is done on the
* client side, the client will flush its buffers and then a SMB Flush Request
* with Reserved1 (uint16_t) set to 0xFFFF will be sent to the server. The
* server should flush all its buffer for that file and then call the
* filesystem to perform a F_FULLSYNC on that file.
* Refer to "man fsync" and "man fcntl" in OS X for more information on
* F_FULLSYNC
*/

/*
* Resolve ID Request
*
Expand Down

0 comments on commit 479c108

Please sign in to comment.