2020-12-01 02:02:51 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
/*
|
|
|
|
* Witness Service client for CIFS
|
|
|
|
*
|
|
|
|
* Copyright (c) 2020 Samuel Cabrero <scabrero@suse.de>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _CIFS_SWN_H
|
|
|
|
#define _CIFS_SWN_H
|
2021-04-09 22:31:37 +08:00
|
|
|
#include "cifsglob.h"
|
2020-12-01 02:02:51 +08:00
|
|
|
|
|
|
|
struct cifs_tcon;
|
2020-12-01 02:02:52 +08:00
|
|
|
struct sk_buff;
|
|
|
|
struct genl_info;
|
2020-12-01 02:02:51 +08:00
|
|
|
|
2021-04-09 22:31:37 +08:00
|
|
|
#ifdef CONFIG_CIFS_SWN_UPCALL
|
2020-12-01 02:02:51 +08:00
|
|
|
extern int cifs_swn_register(struct cifs_tcon *tcon);
|
|
|
|
|
|
|
|
extern int cifs_swn_unregister(struct cifs_tcon *tcon);
|
|
|
|
|
2020-12-01 02:02:52 +08:00
|
|
|
extern int cifs_swn_notify(struct sk_buff *skb, struct genl_info *info);
|
|
|
|
|
2020-12-01 02:02:53 +08:00
|
|
|
extern void cifs_swn_dump(struct seq_file *m);
|
|
|
|
|
2020-12-01 02:02:54 +08:00
|
|
|
extern void cifs_swn_check(void);
|
|
|
|
|
2021-04-09 22:31:37 +08:00
|
|
|
static inline bool cifs_swn_set_server_dstaddr(struct TCP_Server_Info *server)
|
|
|
|
{
|
|
|
|
if (server->use_swn_dstaddr) {
|
|
|
|
server->dstaddr = server->swn_dstaddr;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void cifs_swn_reset_server_dstaddr(struct TCP_Server_Info *server)
|
|
|
|
{
|
|
|
|
server->use_swn_dstaddr = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
static inline int cifs_swn_register(struct cifs_tcon *tcon) { return 0; }
|
|
|
|
static inline int cifs_swn_unregister(struct cifs_tcon *tcon) { return 0; }
|
|
|
|
static inline int cifs_swn_notify(struct sk_buff *s, struct genl_info *i) { return 0; }
|
|
|
|
static inline void cifs_swn_dump(struct seq_file *m) {}
|
|
|
|
static inline void cifs_swn_check(void) {}
|
|
|
|
static inline bool cifs_swn_set_server_dstaddr(struct TCP_Server_Info *server) { return false; }
|
|
|
|
static inline void cifs_swn_reset_server_dstaddr(struct TCP_Server_Info *server) {}
|
|
|
|
|
|
|
|
#endif /* CONFIG_CIFS_SWN_UPCALL */
|
2020-12-01 02:02:51 +08:00
|
|
|
#endif /* _CIFS_SWN_H */
|