[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200721162818.197315-12-hch@lst.de>
Date: Tue, 21 Jul 2020 18:28:05 +0200
From: Christoph Hellwig <hch@....de>
To: Al Viro <viro@...iv.linux.org.uk>,
Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
linux-kernel@...r.kernel.org, linux-raid@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-api@...r.kernel.org
Subject: [PATCH 11/24] init: open code do_utimes in do_utime
Open code the trivial utimes case in a version that takes proper kernel
pointers.
Signed-off-by: Christoph Hellwig <hch@....de>
---
init/initramfs.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/init/initramfs.c b/init/initramfs.c
index 3823d15e5d2619..6135b55286fc35 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -104,13 +104,20 @@ static void __init free_hash(void)
static long __init do_utime(char *filename, time64_t mtime)
{
struct timespec64 t[2];
+ struct path path;
+ int error;
t[0].tv_sec = mtime;
t[0].tv_nsec = 0;
t[1].tv_sec = mtime;
t[1].tv_nsec = 0;
- return do_utimes(AT_FDCWD, filename, t, AT_SYMLINK_NOFOLLOW);
+ error = kern_path(filename, 0, &path);
+ if (error)
+ return error;
+ error = vfs_utimes(&path, t);
+ path_put(&path);
+ return error;
}
static __initdata LIST_HEAD(dir_list);
--
2.27.0
Powered by blists - more mailing lists