vfs: drop spurious memcpy in stat

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
mjg 2018-11-29 09:04:10 +00:00
parent 77488e7af0
commit 157d106c90

View File

@ -2277,7 +2277,6 @@ kern_statat(struct thread *td, int flag, int fd, const char *path,
void (*hook)(struct vnode *vp, struct stat *sbp))
{
struct nameidata nd;
struct stat sb;
int error;
if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_BENEATH)) != 0)
@ -2290,13 +2289,13 @@ kern_statat(struct thread *td, int flag, int fd, const char *path,
if ((error = namei(&nd)) != 0)
return (error);
error = vn_stat(nd.ni_vp, &sb, td->td_ucred, NOCRED, td);
error = vn_stat(nd.ni_vp, sbp, td->td_ucred, NOCRED, td);
if (error == 0) {
SDT_PROBE2(vfs, , stat, mode, path, sb.st_mode);
if (S_ISREG(sb.st_mode))
SDT_PROBE2(vfs, , stat, mode, path, sbp->st_mode);
if (S_ISREG(sbp->st_mode))
SDT_PROBE2(vfs, , stat, reg, path, pathseg);
if (__predict_false(hook != NULL))
hook(nd.ni_vp, &sb);
hook(nd.ni_vp, sbp);
}
NDFREE(&nd, NDF_ONLY_PNBUF);
vput(nd.ni_vp);
@ -2308,10 +2307,9 @@ kern_statat(struct thread *td, int flag, int fd, const char *path,
sb.st_ctim_ext = 0;
sb.st_btim_ext = 0;
#endif
*sbp = sb;
#ifdef KTRACE
if (KTRPOINT(td, KTR_STRUCT))
ktrstat(&sb);
ktrstat(sbp);
#endif
return (0);
}