diff options
author | Paulo Alcantara <pc@manguebit.com> | 2024-01-26 19:26:06 -0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2024-03-10 19:33:58 -0500 |
commit | 5a4b09ecf8e8ad26ea03a37e52e310fe13f15b49 (patch) | |
tree | 8f2538b6668b1941a40b21cd6104a75146b54360 /fs/smb/client/reparse.h | |
parent | fa792d8d235c20df5f422e4bd172db1efde55ab9 (diff) |
smb: client: add support for WSL reparse points
Add support for creating special files via WSL reparse points when
using 'reparse=wsl' mount option. They're faster than NFS reparse
points because they don't require extra roundtrips to figure out what
->d_type a specific dirent is as such information is already stored in
query dir responses and then making getdents() calls faster.
Signed-off-by: Paulo Alcantara <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb/client/reparse.h')
-rw-r--r-- | fs/smb/client/reparse.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/smb/client/reparse.h b/fs/smb/client/reparse.h index 3ceb90da0df9..9816bac98552 100644 --- a/fs/smb/client/reparse.h +++ b/fs/smb/client/reparse.h @@ -28,6 +28,17 @@ static inline u64 reparse_mode_nfs_type(mode_t mode) return 0; } +static inline u32 reparse_mode_wsl_tag(mode_t mode) +{ + switch (mode & S_IFMT) { + case S_IFBLK: return IO_REPARSE_TAG_LX_BLK; + case S_IFCHR: return IO_REPARSE_TAG_LX_CHR; + case S_IFIFO: return IO_REPARSE_TAG_LX_FIFO; + case S_IFSOCK: return IO_REPARSE_TAG_AF_UNIX; + } + return 0; +} + /* * Match a reparse point inode if reparse tag and ctime haven't changed. * @@ -64,7 +75,7 @@ bool cifs_reparse_point_to_fattr(struct cifs_sb_info *cifs_sb, int smb2_create_reparse_symlink(const unsigned int xid, struct inode *inode, struct dentry *dentry, struct cifs_tcon *tcon, const char *full_path, const char *symname); -int smb2_make_nfs_node(unsigned int xid, struct inode *inode, +int smb2_mknod_reparse(unsigned int xid, struct inode *inode, struct dentry *dentry, struct cifs_tcon *tcon, const char *full_path, umode_t mode, dev_t dev); int smb2_parse_reparse_point(struct cifs_sb_info *cifs_sb, struct kvec *rsp_iov, |