0001
0002
0003
0004
0005
0006 #ifndef __KSMBD_MISC_H__
0007 #define __KSMBD_MISC_H__
0008
0009 struct ksmbd_share_config;
0010 struct nls_table;
0011 struct kstat;
0012 struct ksmbd_file;
0013
0014 int match_pattern(const char *str, size_t len, const char *pattern);
0015 int ksmbd_validate_filename(char *filename);
0016 int parse_stream_name(char *filename, char **stream_name, int *s_type);
0017 char *convert_to_nt_pathname(struct ksmbd_share_config *share,
0018 struct path *path);
0019 int get_nlink(struct kstat *st);
0020 void ksmbd_conv_path_to_unix(char *path);
0021 void ksmbd_strip_last_slash(char *path);
0022 void ksmbd_conv_path_to_windows(char *path);
0023 char *ksmbd_extract_sharename(char *treename);
0024 char *convert_to_unix_name(struct ksmbd_share_config *share, const char *name);
0025
0026 #define KSMBD_DIR_INFO_ALIGNMENT 8
0027 struct ksmbd_dir_info;
0028 char *ksmbd_convert_dir_info_name(struct ksmbd_dir_info *d_info,
0029 const struct nls_table *local_nls,
0030 int *conv_len);
0031
0032 #define NTFS_TIME_OFFSET ((u64)(369 * 365 + 89) * 24 * 3600 * 10000000)
0033 struct timespec64 ksmbd_NTtimeToUnix(__le64 ntutc);
0034 u64 ksmbd_UnixTimeToNT(struct timespec64 t);
0035 long long ksmbd_systime(void);
0036 #endif