int smb_compress(struct TCP_Server_Info *server, struct smb_rqst *rq, compress_send_fn send_fn);
/** * should_compress() - Determines if a request (write) or the response to a * request (read) should be compressed. * @tcon: tcon of the request is being sent to * @rqst: request to evaluate * * Return: true iff: * - compression was successfully negotiated with server * - server has enabled compression for the share * - it's a read or write request * - (write only) request length is >= SMB_COMPRESS_MIN_LEN * - (write only) is_compressible() returns 1 * * Return false otherwise.
*/ bool should_compress(conststruct cifs_tcon *tcon, conststruct smb_rqst *rq);
/** * smb_compress_alg_valid() - Validate a compression algorithm. * @alg: Compression algorithm to check. * @valid_none: Conditional check whether NONE algorithm should be * considered valid or not. * * If @alg is SMB3_COMPRESS_NONE, this function returns @valid_none. * * Note that 'NONE' (0) compressor type is considered invalid in protocol * negotiation, as it's never requested to/returned from the server. * * Return: true if @alg is valid/supported, false otherwise.
*/ static __always_inline int smb_compress_alg_valid(__le16 alg, bool valid_none)
{ if (alg == SMB3_COMPRESS_NONE) return valid_none;
if (alg == SMB3_COMPRESS_LZ77 || alg == SMB3_COMPRESS_PATTERN) returntrue;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.