Skip to content

Commit fd5ad30

Browse files
author
Christoph Hellwig
committed
fs: expose utimes_common
Rename utimes_common to vfs_utimes and make it available outside of utimes.c. This will be used by the initramfs unpacking code. Signed-off-by: Christoph Hellwig <[email protected]> Acked-by: Linus Torvalds <[email protected]>
1 parent 27eb11c commit fd5ad30

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

fs/utimes.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ static bool nsec_valid(long nsec)
1616
return nsec >= 0 && nsec <= 999999999;
1717
}
1818

19-
static int utimes_common(const struct path *path, struct timespec64 *times)
19+
int vfs_utimes(const struct path *path, struct timespec64 *times)
2020
{
2121
int error;
2222
struct iattr newattrs;
@@ -94,7 +94,7 @@ static int do_utimes_path(int dfd, const char __user *filename,
9494
if (error)
9595
return error;
9696

97-
error = utimes_common(&path, times);
97+
error = vfs_utimes(&path, times);
9898
path_put(&path);
9999
if (retry_estale(error, lookup_flags)) {
100100
lookup_flags |= LOOKUP_REVAL;
@@ -115,7 +115,7 @@ static int do_utimes_fd(int fd, struct timespec64 *times, int flags)
115115
f = fdget(fd);
116116
if (!f.file)
117117
return -EBADF;
118-
error = utimes_common(&f.file->f_path, times);
118+
error = vfs_utimes(&f.file->f_path, times);
119119
fdput(f);
120120
return error;
121121
}

include/linux/fs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,6 +1746,7 @@ int vfs_mkobj(struct dentry *, umode_t,
17461746

17471747
int vfs_fchown(struct file *file, uid_t user, gid_t group);
17481748
int vfs_fchmod(struct file *file, umode_t mode);
1749+
int vfs_utimes(const struct path *path, struct timespec64 *times);
17491750

17501751
extern long vfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
17511752

0 commit comments

Comments
 (0)