1*38c8a9a5SSteve French /* SPDX-License-Identifier: GPL-2.0-or-later */ 2*38c8a9a5SSteve French /* 3*38c8a9a5SSteve French * Copyright (C) 2018 Samsung Electronics Co., Ltd. 4*38c8a9a5SSteve French */ 5*38c8a9a5SSteve French 6*38c8a9a5SSteve French #ifndef __KSMBD_MISC_H__ 7*38c8a9a5SSteve French #define __KSMBD_MISC_H__ 8*38c8a9a5SSteve French 9*38c8a9a5SSteve French struct ksmbd_share_config; 10*38c8a9a5SSteve French struct nls_table; 11*38c8a9a5SSteve French struct kstat; 12*38c8a9a5SSteve French struct ksmbd_file; 13*38c8a9a5SSteve French 14*38c8a9a5SSteve French int match_pattern(const char *str, size_t len, const char *pattern); 15*38c8a9a5SSteve French int ksmbd_validate_filename(char *filename); 16*38c8a9a5SSteve French int parse_stream_name(char *filename, char **stream_name, int *s_type); 17*38c8a9a5SSteve French char *convert_to_nt_pathname(struct ksmbd_share_config *share, 18*38c8a9a5SSteve French const struct path *path); 19*38c8a9a5SSteve French int get_nlink(struct kstat *st); 20*38c8a9a5SSteve French void ksmbd_conv_path_to_unix(char *path); 21*38c8a9a5SSteve French void ksmbd_strip_last_slash(char *path); 22*38c8a9a5SSteve French void ksmbd_conv_path_to_windows(char *path); 23*38c8a9a5SSteve French char *ksmbd_casefold_sharename(struct unicode_map *um, const char *name); 24*38c8a9a5SSteve French char *ksmbd_extract_sharename(struct unicode_map *um, const char *treename); 25*38c8a9a5SSteve French char *convert_to_unix_name(struct ksmbd_share_config *share, const char *name); 26*38c8a9a5SSteve French 27*38c8a9a5SSteve French #define KSMBD_DIR_INFO_ALIGNMENT 8 28*38c8a9a5SSteve French struct ksmbd_dir_info; 29*38c8a9a5SSteve French char *ksmbd_convert_dir_info_name(struct ksmbd_dir_info *d_info, 30*38c8a9a5SSteve French const struct nls_table *local_nls, 31*38c8a9a5SSteve French int *conv_len); 32*38c8a9a5SSteve French 33*38c8a9a5SSteve French #define NTFS_TIME_OFFSET ((u64)(369 * 365 + 89) * 24 * 3600 * 10000000) 34*38c8a9a5SSteve French struct timespec64 ksmbd_NTtimeToUnix(__le64 ntutc); 35*38c8a9a5SSteve French u64 ksmbd_UnixTimeToNT(struct timespec64 t); 36*38c8a9a5SSteve French long long ksmbd_systime(void); 37*38c8a9a5SSteve French #endif /* __KSMBD_MISC_H__ */ 38