Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fs: add a vfs_fchmod helper

Add a helper for struct file based chmode operations. To be used by
the initramfs code soon.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>

+8 -2
+7 -2
fs/open.c
··· 602 602 return error; 603 603 } 604 604 605 + int vfs_fchmod(struct file *file, umode_t mode) 606 + { 607 + audit_file(file); 608 + return chmod_common(&file->f_path, mode); 609 + } 610 + 605 611 int ksys_fchmod(unsigned int fd, umode_t mode) 606 612 { 607 613 struct fd f = fdget(fd); 608 614 int err = -EBADF; 609 615 610 616 if (f.file) { 611 - audit_file(f.file); 612 - err = chmod_common(&f.file->f_path, mode); 617 + err = vfs_fchmod(f.file, mode); 613 618 fdput(f); 614 619 } 615 620 return err;
+1
include/linux/fs.h
··· 1745 1745 void *); 1746 1746 1747 1747 int vfs_fchown(struct file *file, uid_t user, gid_t group); 1748 + int vfs_fchmod(struct file *file, umode_t mode); 1748 1749 1749 1750 extern long vfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg); 1750 1751