Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109418333
D30488.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D30488.diff
View Options
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -722,18 +722,10 @@
struct l_utimbuf lut;
char *fname;
int error;
- bool convpath;
-
- convpath = LUSECONVPATH(td);
- if (convpath)
- LCONVPATHEXIST(td, args->fname, &fname);
if (args->times) {
- if ((error = copyin(args->times, &lut, sizeof lut))) {
- if (convpath)
- LFREEPATH(fname);
+ if ((error = copyin(args->times, &lut, sizeof lut)) != 0)
return (error);
- }
tv[0].tv_sec = lut.l_actime;
tv[0].tv_usec = 0;
tv[1].tv_sec = lut.l_modtime;
@@ -742,10 +734,11 @@
} else
tvp = NULL;
- if (!convpath) {
+ if (!LUSECONVPATH(td)) {
error = kern_utimesat(td, AT_FDCWD, args->fname, UIO_USERSPACE,
tvp, UIO_SYSSPACE);
} else {
+ LCONVPATHEXIST(td, args->fname, &fname);
error = kern_utimesat(td, AT_FDCWD, fname, UIO_SYSSPACE, tvp,
UIO_SYSSPACE);
LFREEPATH(fname);
@@ -762,17 +755,10 @@
struct timeval tv[2], *tvp = NULL;
char *fname;
int error;
- bool convpath;
-
- convpath = LUSECONVPATH(td);
- if (convpath)
- LCONVPATHEXIST(td, args->fname, &fname);
if (args->tptr != NULL) {
- if ((error = copyin(args->tptr, ltv, sizeof ltv))) {
- LFREEPATH(fname);
+ if ((error = copyin(args->tptr, ltv, sizeof ltv)) != 0)
return (error);
- }
tv[0].tv_sec = ltv[0].tv_sec;
tv[0].tv_usec = ltv[0].tv_usec;
tv[1].tv_sec = ltv[1].tv_sec;
@@ -780,10 +766,11 @@
tvp = tv;
}
- if (!convpath) {
+ if (!LUSECONVPATH(td)) {
error = kern_utimesat(td, AT_FDCWD, args->fname, UIO_USERSPACE,
tvp, UIO_SYSSPACE);
} else {
+ LCONVPATHEXIST(td, args->fname, &fname);
error = kern_utimesat(td, AT_FDCWD, fname, UIO_SYSSPACE,
tvp, UIO_SYSSPACE);
LFREEPATH(fname);
@@ -897,19 +884,12 @@
struct timeval tv[2], *tvp = NULL;
char *fname;
int error, dfd;
- bool convpath;
- convpath = LUSECONVPATH(td);
dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd;
- if (convpath)
- LCONVPATHEXIST_AT(td, args->filename, &fname, dfd);
if (args->utimes != NULL) {
- if ((error = copyin(args->utimes, ltv, sizeof ltv))) {
- if (convpath)
- LFREEPATH(fname);
+ if ((error = copyin(args->utimes, ltv, sizeof ltv)) != 0)
return (error);
- }
tv[0].tv_sec = ltv[0].tv_sec;
tv[0].tv_usec = ltv[0].tv_usec;
tv[1].tv_sec = ltv[1].tv_sec;
@@ -917,11 +897,13 @@
tvp = tv;
}
- if (!convpath) {
+ if (!LUSECONVPATH(td)) {
error = kern_utimesat(td, dfd, args->filename, UIO_USERSPACE,
tvp, UIO_SYSSPACE);
} else {
- error = kern_utimesat(td, dfd, fname, UIO_SYSSPACE, tvp, UIO_SYSSPACE);
+ LCONVPATHEXIST_AT(td, args->filename, &fname, dfd);
+ error = kern_utimesat(td, dfd, fname, UIO_SYSSPACE,
+ tvp, UIO_SYSSPACE);
LFREEPATH(fname);
}
return (error);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Feb 5, 7:45 PM (21 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16479692
Default Alt Text
D30488.diff (2 KB)
Attached To
Mode
D30488: linux: microoptimize futimesat.
Attached
Detach File
Event Timeline
Log In to Comment