From patchwork Sun May 5 22:28:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 10930435 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 69DAD924 for ; Sun, 5 May 2019 22:29:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 552CB285E5 for ; Sun, 5 May 2019 22:29:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 490AD2864F; Sun, 5 May 2019 22:29:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4059285E5 for ; Sun, 5 May 2019 22:29:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727754AbfEEW3M (ORCPT ); Sun, 5 May 2019 18:29:12 -0400 Received: from mail-pg1-f180.google.com ([209.85.215.180]:42023 "EHLO mail-pg1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727593AbfEEW3M (ORCPT ); Sun, 5 May 2019 18:29:12 -0400 Received: by mail-pg1-f180.google.com with SMTP id p6so5467749pgh.9 for ; Sun, 05 May 2019 15:29:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=rD1Yv08Hv+vzxudJDCYCwQ/X/4r80KweD+kvN6bC3jk=; b=qjSYIVQMvCZJxnq9DpunzVOa0s27kPATZDONu/AkTVyezeBTuskaASTh1CkTbvoKUC 8fC+7hpPP/y7U9Pl0lVUGjeV+FmuEDBk+lchMTweqtmCW1AfVE7vJvaiBOyLuPspVt05 w1HYy7Dc5FUOMszUi5ce2kQ5Xs+rbIDT4YDO20XANpjHberCNeqBz/SuCophaFiAuplW Usgv+Tgt7Nd0c2fnSs8KOdMAL2ly+Z1CVs6aJValwDUtr+cDiGznyXDY3nGt866X1/Tk BdByxamU8XgprqipH3BHuwv1MQPP/bokru5tQwYV1Ww9DYAj0VJ8UosPU7ufsDUap6lh NMVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=rD1Yv08Hv+vzxudJDCYCwQ/X/4r80KweD+kvN6bC3jk=; b=gBIhDI4QxpgLay2/ZfrqfPJY/mYaAUhMgftE3SIdrkkqSu19CiQzlQlvaz+u/3gsBc 8LAbpgzdVhCMVHUYJd8tdZ00qzDWTJxKodsDSGdzzZx3tFtOTyiuzUFyDq/JDSJB6V/H iJyB6C8sHphmxNHjR6ZCBCRShc1RR/udNNM+lWgIlH1WGZjn5YU4ybgIrKUCGxVB6vnn QKQ4u9kYTYi3SuqP2KE9vBcBtwITmTM1ncwTozE577LH0R0eVSGCm1zbuaRQCLDCoIa4 P+bC3P103pIuyw5SeP/PFswxUQxQdltqLNLGGACrao4hT2VbyBK8Gj5+2x/aadTMBhlG fk/A== X-Gm-Message-State: APjAAAXRsfmMx4PuOcSDRbzhKPqGjigVZX6zs0bF5j/Eluy1i/nm61T5 x/qUZHpdtn66xn9HAFoNwBOS7Kcz+kK/mfrhLj1782mN X-Google-Smtp-Source: APXvYqzHmxwMzw8+SUBGpd5ytn/U7nXw+Q/qPKxaN3qf8Ko2LJEj4INwkBf+sgFVByE58YOyxisB13J/Ea71nasSh/c= X-Received: by 2002:a62:479b:: with SMTP id p27mr29969265pfi.111.1557095351164; Sun, 05 May 2019 15:29:11 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Sun, 5 May 2019 17:28:59 -0500 Message-ID: Subject: [PATCH][SMB3] Add SMB3 protocol flags and structs for change notify To: CIFS Cc: samba-technical Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP See MS-FSCC 2.6 and MS-SMB2 2.2.35 From afe5486a31330a181eb0fd1400d9d41242cbb51d Mon Sep 17 00:00:00 2001 From: Steve French Date: Sun, 5 May 2019 17:25:12 -0500 Subject: [PATCH] smb3: Add protocol structs for change notify support Add the SMB3 protocol flag definitions and structs for change notify. Future patches will add the hooks to allow it to be invoked from the client. See MS-FSCC 2.6 and MS-SMB2 2.2.35 Signed-off-by: Steve French --- fs/cifs/smb2pdu.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h index 868b0056808c..6bbfaec42263 100644 --- a/fs/cifs/smb2pdu.h +++ b/fs/cifs/smb2pdu.h @@ -1148,6 +1148,40 @@ struct smb2_write_rsp { __u8 Buffer[1]; } __packed; +/* notify flags */ +#define SMB2_WATCH_TREE 0x0001 + +/* notify completion filter flags. See MS-FSCC 2.6 and MS-SMB2 2.2.35 */ +#define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001 +#define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002 +#define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004 +#define FILE_NOTIFY_CHANGE_SIZE 0x00000008 +#define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010 +#define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020 +#define FILE_NOTIFY_CHANGE_CREATION 0x00000040 +#define FILE_NOTIFY_CHANGE_EA 0x00000080 +#define FILE_NOTIFY_CHANGE_SECURITY 0x00000100 +#define FILE_NOTIFY_CHANGE_STREAM_NAME 0x00000200 +#define FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400 +#define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800 + +struct smb2_change_notify_req { + __le16 StructureSize; + __le16 Flags; + __le32 OutputBufferLength; + __u64 PersistentFileId; /* opaque endianness */ + __u64 VolatileFileId; /* opaque endianness */ + __le32 CompletionFilter; + __u32 Reserved; +} __packed; + +struct smb2_change_notify_rsp { + __le16 StructureSize; /* Must be 9 */ + __le16 OutputBufferOffset; + __le32 OutputBufferLength; + __u8 Buffer[1]; /* array of file notify structs */ +} __packed; + #define SMB2_LOCKFLAG_SHARED_LOCK 0x0001 #define SMB2_LOCKFLAG_EXCLUSIVE_LOCK 0x0002 #define SMB2_LOCKFLAG_UNLOCK 0x0004 -- 2.20.1