Skip to content

Commit

Permalink
fs: expose utimes_common
Browse files Browse the repository at this point in the history
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 <hch@lst.de>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Christoph Hellwig committed Jul 31, 2020
1 parent 27eb11c commit fd5ad30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/utimes.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static bool nsec_valid(long nsec)
return nsec >= 0 && nsec <= 999999999;
}

static int utimes_common(const struct path *path, struct timespec64 *times)
int vfs_utimes(const struct path *path, struct timespec64 *times)
{
int error;
struct iattr newattrs;
Expand Down Expand Up @@ -94,7 +94,7 @@ static int do_utimes_path(int dfd, const char __user *filename,
if (error)
return error;

error = utimes_common(&path, times);
error = vfs_utimes(&path, times);
path_put(&path);
if (retry_estale(error, lookup_flags)) {
lookup_flags |= LOOKUP_REVAL;
Expand All @@ -115,7 +115,7 @@ static int do_utimes_fd(int fd, struct timespec64 *times, int flags)
f = fdget(fd);
if (!f.file)
return -EBADF;
error = utimes_common(&f.file->f_path, times);
error = vfs_utimes(&f.file->f_path, times);
fdput(f);
return error;
}
Expand Down
1 change: 1 addition & 0 deletions include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1746,6 +1746,7 @@ int vfs_mkobj(struct dentry *, umode_t,

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

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

Expand Down

0 comments on commit fd5ad30

Please sign in to comment.