/* * Used only by cifs.ko to ignore reparse points from files when client or * server doesn't support FSCTL_GET_REPARSE_POINT.
*/ #define IO_REPARSE_TAG_INTERNAL ((__u32)~0U)
staticinline dev_t reparse_mkdev(void *ptr)
{
u64 v = le64_to_cpu(*(__le64 *)ptr);
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID) return cifs_sb->ctx->linux_gid; return make_kgid(current_user_ns(), gid);
}
staticinline u64 reparse_mode_nfs_type(mode_t mode)
{ switch (mode & S_IFMT) { case S_IFLNK: return NFS_SPECFILE_LNK; case S_IFBLK: return NFS_SPECFILE_BLK; case S_IFCHR: return NFS_SPECFILE_CHR; case S_IFIFO: return NFS_SPECFILE_FIFO; case S_IFSOCK: return NFS_SPECFILE_SOCK;
} return 0;
}
staticinline u32 reparse_mode_wsl_tag(mode_t mode)
{ switch (mode & S_IFMT) { case S_IFLNK: return IO_REPARSE_TAG_LX_SYMLINK; 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. * * Windows Server updates ctime of reparse points when their data have changed. * The server doesn't allow changing reparse tags from existing reparse points, * though it's worth checking.
*/ staticinlinebool reparse_inode_match(struct inode *inode, struct cifs_fattr *fattr)
{ struct cifsInodeInfo *cinode = CIFS_I(inode); struct timespec64 ctime = inode_get_ctime(inode);
/* * Do not match reparse tags when client or server doesn't support * FSCTL_GET_REPARSE_POINT. @fattr->cf_cifstag should contain correct * reparse tag from query dir response but the client won't be able to * read the reparse point data anyway. This spares us a revalidation.
*/ if (cinode->reparse_tag != IO_REPARSE_TAG_INTERNAL &&
cinode->reparse_tag != fattr->cf_cifstag) returnfalse; return (cinode->cifsAttrs & ATTR_REPARSE) &&
timespec64_equal(&ctime, &fattr->cf_ctime);
}
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.