diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-21 13:06:51 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-21 13:06:51 -0400 |
| commit | 10effcb548c170d59ea1d2152f2ee0ad45ce4c9d (patch) | |
| tree | 6a1bf04ed66a1dcd242e8b2bd0c86690194cc09f | |
| parent | c3ca48f062a37c2f79560a9b0b9f1b08039aa248 (diff) | |
| parent | 0f60f240d522772467c7d2cebedb910748c78ed4 (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
FS: lookup_mnt() is only used in the core fs routines now
bfs: fix bitmap size argument to find_first_zero_bit()
fs: Use BUG_ON(!mnt) at dentry_open().
fs: devpts_pty_new() return -ENOMEM if dentry allocation failed
nfs: lock() vs unlock() typo
pstore: fix leaking ->i_private
introduce sys_syncfs to sync a single file system
Small typo fix...
Filesystem: fifo: Fixed coding style issue.
fs/inode: Fix kernel-doc format for inode_init_owner
select: remove unused MAX_SELECT_SECONDS
vfs: cleanup do_vfs_ioctl()
| -rw-r--r-- | arch/x86/ia32/ia32entry.S | 1 | ||||
| -rw-r--r-- | arch/x86/include/asm/unistd_32.h | 3 | ||||
| -rw-r--r-- | arch/x86/include/asm/unistd_64.h | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/syscall_table_32.S | 1 | ||||
| -rw-r--r-- | fs/bfs/dir.c | 2 | ||||
| -rw-r--r-- | fs/compat.c | 3 | ||||
| -rw-r--r-- | fs/devpts/inode.c | 19 | ||||
| -rw-r--r-- | fs/exec.c | 2 | ||||
| -rw-r--r-- | fs/fifo.c | 3 | ||||
| -rw-r--r-- | fs/inode.c | 2 | ||||
| -rw-r--r-- | fs/internal.h | 1 | ||||
| -rw-r--r-- | fs/ioctl.c | 21 | ||||
| -rw-r--r-- | fs/nfs/namespace.c | 4 | ||||
| -rw-r--r-- | fs/open.c | 13 | ||||
| -rw-r--r-- | fs/pstore/inode.c | 8 | ||||
| -rw-r--r-- | fs/select.c | 3 | ||||
| -rw-r--r-- | fs/sync.c | 24 | ||||
| -rw-r--r-- | include/asm-generic/unistd.h | 4 | ||||
| -rw-r--r-- | include/linux/dcache.h | 1 | ||||
| -rw-r--r-- | include/linux/syscalls.h | 1 |
20 files changed, 67 insertions, 51 deletions
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S index 430312ba6e3f..849a9d23c71d 100644 --- a/arch/x86/ia32/ia32entry.S +++ b/arch/x86/ia32/ia32entry.S | |||
| @@ -847,4 +847,5 @@ ia32_sys_call_table: | |||
| 847 | .quad sys_name_to_handle_at | 847 | .quad sys_name_to_handle_at |
| 848 | .quad compat_sys_open_by_handle_at | 848 | .quad compat_sys_open_by_handle_at |
| 849 | .quad compat_sys_clock_adjtime | 849 | .quad compat_sys_clock_adjtime |
| 850 | .quad sys_syncfs | ||
| 850 | ia32_syscall_end: | 851 | ia32_syscall_end: |
diff --git a/arch/x86/include/asm/unistd_32.h b/arch/x86/include/asm/unistd_32.h index ffaf183c619a..a755ef5e5977 100644 --- a/arch/x86/include/asm/unistd_32.h +++ b/arch/x86/include/asm/unistd_32.h | |||
| @@ -349,10 +349,11 @@ | |||
| 349 | #define __NR_name_to_handle_at 341 | 349 | #define __NR_name_to_handle_at 341 |
| 350 | #define __NR_open_by_handle_at 342 | 350 | #define __NR_open_by_handle_at 342 |
| 351 | #define __NR_clock_adjtime 343 | 351 | #define __NR_clock_adjtime 343 |
| 352 | #define __NR_syncfs 344 | ||
| 352 | 353 | ||
| 353 | #ifdef __KERNEL__ | 354 | #ifdef __KERNEL__ |
| 354 | 355 | ||
| 355 | #define NR_syscalls 344 | 356 | #define NR_syscalls 345 |
| 356 | 357 | ||
| 357 | #define __ARCH_WANT_IPC_PARSE_VERSION | 358 | #define __ARCH_WANT_IPC_PARSE_VERSION |
| 358 | #define __ARCH_WANT_OLD_READDIR | 359 | #define __ARCH_WANT_OLD_READDIR |
diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h index 5466bea670e7..160fa76bd578 100644 --- a/arch/x86/include/asm/unistd_64.h +++ b/arch/x86/include/asm/unistd_64.h | |||
| @@ -675,6 +675,8 @@ __SYSCALL(__NR_name_to_handle_at, sys_name_to_handle_at) | |||
| 675 | __SYSCALL(__NR_open_by_handle_at, sys_open_by_handle_at) | 675 | __SYSCALL(__NR_open_by_handle_at, sys_open_by_handle_at) |
| 676 | #define __NR_clock_adjtime 305 | 676 | #define __NR_clock_adjtime 305 |
| 677 | __SYSCALL(__NR_clock_adjtime, sys_clock_adjtime) | 677 | __SYSCALL(__NR_clock_adjtime, sys_clock_adjtime) |
| 678 | #define __NR_syncfs 306 | ||
| 679 | __SYSCALL(__NR_syncfs, sys_syncfs) | ||
| 678 | 680 | ||
| 679 | #ifndef __NO_STUBS | 681 | #ifndef __NO_STUBS |
| 680 | #define __ARCH_WANT_OLD_READDIR | 682 | #define __ARCH_WANT_OLD_READDIR |
diff --git a/arch/x86/kernel/syscall_table_32.S b/arch/x86/kernel/syscall_table_32.S index 5f181742e8f9..abce34d5c79d 100644 --- a/arch/x86/kernel/syscall_table_32.S +++ b/arch/x86/kernel/syscall_table_32.S | |||
| @@ -343,3 +343,4 @@ ENTRY(sys_call_table) | |||
| 343 | .long sys_name_to_handle_at | 343 | .long sys_name_to_handle_at |
| 344 | .long sys_open_by_handle_at | 344 | .long sys_open_by_handle_at |
| 345 | .long sys_clock_adjtime | 345 | .long sys_clock_adjtime |
| 346 | .long sys_syncfs | ||
diff --git a/fs/bfs/dir.c b/fs/bfs/dir.c index 685ecff3ab31..b14cebfd9047 100644 --- a/fs/bfs/dir.c +++ b/fs/bfs/dir.c | |||
| @@ -97,7 +97,7 @@ static int bfs_create(struct inode *dir, struct dentry *dentry, int mode, | |||
| 97 | if (!inode) | 97 | if (!inode) |
| 98 | return -ENOSPC; | 98 | return -ENOSPC; |
| 99 | mutex_lock(&info->bfs_lock); | 99 | mutex_lock(&info->bfs_lock); |
| 100 | ino = find_first_zero_bit(info->si_imap, info->si_lasti); | 100 | ino = find_first_zero_bit(info->si_imap, info->si_lasti + 1); |
| 101 | if (ino > info->si_lasti) { | 101 | if (ino > info->si_lasti) { |
| 102 | mutex_unlock(&info->bfs_lock); | 102 | mutex_unlock(&info->bfs_lock); |
| 103 | iput(inode); | 103 | iput(inode); |
diff --git a/fs/compat.c b/fs/compat.c index c6d31a3bab88..72fe6cda9108 100644 --- a/fs/compat.c +++ b/fs/compat.c | |||
| @@ -1671,9 +1671,6 @@ int compat_set_fd_set(unsigned long nr, compat_ulong_t __user *ufdset, | |||
| 1671 | * Update: ERESTARTSYS breaks at least the xview clock binary, so | 1671 | * Update: ERESTARTSYS breaks at least the xview clock binary, so |
| 1672 | * I'm trying ERESTARTNOHAND which restart only when you want to. | 1672 | * I'm trying ERESTARTNOHAND which restart only when you want to. |
| 1673 | */ | 1673 | */ |
| 1674 | #define MAX_SELECT_SECONDS \ | ||
| 1675 | ((unsigned long) (MAX_SCHEDULE_TIMEOUT / HZ)-1) | ||
| 1676 | |||
| 1677 | int compat_core_sys_select(int n, compat_ulong_t __user *inp, | 1674 | int compat_core_sys_select(int n, compat_ulong_t __user *inp, |
| 1678 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, | 1675 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, |
| 1679 | struct timespec *end_time) | 1676 | struct timespec *end_time) |
diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c index 1bb547c9cad6..c6bd815dc794 100644 --- a/fs/devpts/inode.c +++ b/fs/devpts/inode.c | |||
| @@ -479,6 +479,7 @@ int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty) | |||
| 479 | struct dentry *root = sb->s_root; | 479 | struct dentry *root = sb->s_root; |
| 480 | struct pts_fs_info *fsi = DEVPTS_SB(sb); | 480 | struct pts_fs_info *fsi = DEVPTS_SB(sb); |
| 481 | struct pts_mount_opts *opts = &fsi->mount_opts; | 481 | struct pts_mount_opts *opts = &fsi->mount_opts; |
| 482 | int ret = 0; | ||
| 482 | char s[12]; | 483 | char s[12]; |
| 483 | 484 | ||
| 484 | /* We're supposed to be given the slave end of a pty */ | 485 | /* We're supposed to be given the slave end of a pty */ |
| @@ -504,11 +505,14 @@ int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty) | |||
| 504 | if (!IS_ERR(dentry)) { | 505 | if (!IS_ERR(dentry)) { |
| 505 | d_add(dentry, inode); | 506 | d_add(dentry, inode); |
| 506 | fsnotify_create(root->d_inode, dentry); | 507 | fsnotify_create(root->d_inode, dentry); |
| 508 | } else { | ||
| 509 | iput(inode); | ||
| 510 | ret = -ENOMEM; | ||
| 507 | } | 511 | } |
| 508 | 512 | ||
| 509 | mutex_unlock(&root->d_inode->i_mutex); | 513 | mutex_unlock(&root->d_inode->i_mutex); |
| 510 | 514 | ||
| 511 | return 0; | 515 | return ret; |
| 512 | } | 516 | } |
| 513 | 517 | ||
| 514 | struct tty_struct *devpts_get_tty(struct inode *pts_inode, int number) | 518 | struct tty_struct *devpts_get_tty(struct inode *pts_inode, int number) |
| @@ -544,17 +548,12 @@ void devpts_pty_kill(struct tty_struct *tty) | |||
| 544 | mutex_lock(&root->d_inode->i_mutex); | 548 | mutex_lock(&root->d_inode->i_mutex); |
| 545 | 549 | ||
| 546 | dentry = d_find_alias(inode); | 550 | dentry = d_find_alias(inode); |
| 547 | if (IS_ERR(dentry)) | ||
| 548 | goto out; | ||
| 549 | |||
| 550 | if (dentry) { | ||
| 551 | inode->i_nlink--; | ||
| 552 | d_delete(dentry); | ||
| 553 | dput(dentry); /* d_alloc_name() in devpts_pty_new() */ | ||
| 554 | } | ||
| 555 | 551 | ||
| 552 | inode->i_nlink--; | ||
| 553 | d_delete(dentry); | ||
| 554 | dput(dentry); /* d_alloc_name() in devpts_pty_new() */ | ||
| 556 | dput(dentry); /* d_find_alias above */ | 555 | dput(dentry); /* d_find_alias above */ |
| 557 | out: | 556 | |
| 558 | mutex_unlock(&root->d_inode->i_mutex); | 557 | mutex_unlock(&root->d_inode->i_mutex); |
| 559 | } | 558 | } |
| 560 | 559 | ||
| @@ -1875,7 +1875,7 @@ static void wait_for_dump_helpers(struct file *file) | |||
| 1875 | 1875 | ||
| 1876 | 1876 | ||
| 1877 | /* | 1877 | /* |
| 1878 | * uhm_pipe_setup | 1878 | * umh_pipe_setup |
| 1879 | * helper function to customize the process used | 1879 | * helper function to customize the process used |
| 1880 | * to collect the core in userspace. Specifically | 1880 | * to collect the core in userspace. Specifically |
| 1881 | * it sets up a pipe and installs it as fd 0 (stdin) | 1881 | * it sets up a pipe and installs it as fd 0 (stdin) |
| @@ -66,8 +66,7 @@ static int fifo_open(struct inode *inode, struct file *filp) | |||
| 66 | /* suppress POLLHUP until we have | 66 | /* suppress POLLHUP until we have |
| 67 | * seen a writer */ | 67 | * seen a writer */ |
| 68 | filp->f_version = pipe->w_counter; | 68 | filp->f_version = pipe->w_counter; |
| 69 | } else | 69 | } else { |
| 70 | { | ||
| 71 | wait_for_partner(inode, &pipe->w_counter); | 70 | wait_for_partner(inode, &pipe->w_counter); |
| 72 | if(signal_pending(current)) | 71 | if(signal_pending(current)) |
| 73 | goto err_rd; | 72 | goto err_rd; |
diff --git a/fs/inode.c b/fs/inode.c index 9910c039f026..16fefd373fc2 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
| @@ -1715,7 +1715,7 @@ void init_special_inode(struct inode *inode, umode_t mode, dev_t rdev) | |||
| 1715 | EXPORT_SYMBOL(init_special_inode); | 1715 | EXPORT_SYMBOL(init_special_inode); |
| 1716 | 1716 | ||
| 1717 | /** | 1717 | /** |
| 1718 | * Init uid,gid,mode for new inode according to posix standards | 1718 | * inode_init_owner - Init uid,gid,mode for new inode according to posix standards |
| 1719 | * @inode: New inode | 1719 | * @inode: New inode |
| 1720 | * @dir: Directory inode | 1720 | * @dir: Directory inode |
| 1721 | * @mode: mode of the new inode | 1721 | * @mode: mode of the new inode |
diff --git a/fs/internal.h b/fs/internal.h index 17191546d527..8318059b42c6 100644 --- a/fs/internal.h +++ b/fs/internal.h | |||
| @@ -64,6 +64,7 @@ extern int copy_mount_string(const void __user *, char **); | |||
| 64 | 64 | ||
| 65 | extern unsigned int mnt_get_count(struct vfsmount *mnt); | 65 | extern unsigned int mnt_get_count(struct vfsmount *mnt); |
| 66 | extern struct vfsmount *__lookup_mnt(struct vfsmount *, struct dentry *, int); | 66 | extern struct vfsmount *__lookup_mnt(struct vfsmount *, struct dentry *, int); |
| 67 | extern struct vfsmount *lookup_mnt(struct path *); | ||
| 67 | extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *, | 68 | extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *, |
| 68 | struct vfsmount *); | 69 | struct vfsmount *); |
| 69 | extern void release_mounts(struct list_head *); | 70 | extern void release_mounts(struct list_head *); |
diff --git a/fs/ioctl.c b/fs/ioctl.c index 1eebeb72b202..1d9b9fcb2db4 100644 --- a/fs/ioctl.c +++ b/fs/ioctl.c | |||
| @@ -548,6 +548,7 @@ int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, | |||
| 548 | { | 548 | { |
| 549 | int error = 0; | 549 | int error = 0; |
| 550 | int __user *argp = (int __user *)arg; | 550 | int __user *argp = (int __user *)arg; |
| 551 | struct inode *inode = filp->f_path.dentry->d_inode; | ||
| 551 | 552 | ||
| 552 | switch (cmd) { | 553 | switch (cmd) { |
| 553 | case FIOCLEX: | 554 | case FIOCLEX: |
| @@ -567,13 +568,11 @@ int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, | |||
| 567 | break; | 568 | break; |
| 568 | 569 | ||
| 569 | case FIOQSIZE: | 570 | case FIOQSIZE: |
| 570 | if (S_ISDIR(filp->f_path.dentry->d_inode->i_mode) || | 571 | if (S_ISDIR(inode->i_mode) || S_ISREG(inode->i_mode) || |
| 571 | S_ISREG(filp->f_path.dentry->d_inode->i_mode) || | 572 | S_ISLNK(inode->i_mode)) { |
| 572 | S_ISLNK(filp->f_path.dentry->d_inode->i_mode)) { | 573 | loff_t res = inode_get_bytes(inode); |
| 573 | loff_t res = | 574 | error = copy_to_user(argp, &res, sizeof(res)) ? |
| 574 | inode_get_bytes(filp->f_path.dentry->d_inode); | 575 | -EFAULT : 0; |
| 575 | error = copy_to_user((loff_t __user *)arg, &res, | ||
| 576 | sizeof(res)) ? -EFAULT : 0; | ||
| 577 | } else | 576 | } else |
| 578 | error = -ENOTTY; | 577 | error = -ENOTTY; |
| 579 | break; | 578 | break; |
| @@ -590,14 +589,10 @@ int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, | |||
| 590 | return ioctl_fiemap(filp, arg); | 589 | return ioctl_fiemap(filp, arg); |
| 591 | 590 | ||
| 592 | case FIGETBSZ: | 591 | case FIGETBSZ: |
| 593 | { | 592 | return put_user(inode->i_sb->s_blocksize, argp); |
| 594 | struct inode *inode = filp->f_path.dentry->d_inode; | ||
| 595 | int __user *p = (int __user *)arg; | ||
| 596 | return put_user(inode->i_sb->s_blocksize, p); | ||
| 597 | } | ||
| 598 | 593 | ||
| 599 | default: | 594 | default: |
| 600 | if (S_ISREG(filp->f_path.dentry->d_inode->i_mode)) | 595 | if (S_ISREG(inode->i_mode)) |
| 601 | error = file_ioctl(filp, cmd, arg); | 596 | error = file_ioctl(filp, cmd, arg); |
| 602 | else | 597 | else |
| 603 | error = vfs_ioctl(filp, cmd, arg); | 598 | error = vfs_ioctl(filp, cmd, arg); |
diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c index c0b8344db0c6..bf1c68009ffd 100644 --- a/fs/nfs/namespace.c +++ b/fs/nfs/namespace.c | |||
| @@ -98,7 +98,7 @@ rename_retry: | |||
| 98 | namelen--; | 98 | namelen--; |
| 99 | buflen -= namelen; | 99 | buflen -= namelen; |
| 100 | if (buflen < 0) { | 100 | if (buflen < 0) { |
| 101 | spin_lock(&dentry->d_lock); | 101 | spin_unlock(&dentry->d_lock); |
| 102 | rcu_read_unlock(); | 102 | rcu_read_unlock(); |
| 103 | goto Elong; | 103 | goto Elong; |
| 104 | } | 104 | } |
| @@ -108,7 +108,7 @@ rename_retry: | |||
| 108 | rcu_read_unlock(); | 108 | rcu_read_unlock(); |
| 109 | return end; | 109 | return end; |
| 110 | Elong_unlock: | 110 | Elong_unlock: |
| 111 | spin_lock(&dentry->d_lock); | 111 | spin_unlock(&dentry->d_lock); |
| 112 | rcu_read_unlock(); | 112 | rcu_read_unlock(); |
| 113 | if (read_seqretry(&rename_lock, seq)) | 113 | if (read_seqretry(&rename_lock, seq)) |
| 114 | goto rename_retry; | 114 | goto rename_retry; |
| @@ -835,17 +835,8 @@ struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags, | |||
| 835 | 835 | ||
| 836 | validate_creds(cred); | 836 | validate_creds(cred); |
| 837 | 837 | ||
| 838 | /* | 838 | /* We must always pass in a valid mount pointer. */ |
| 839 | * We must always pass in a valid mount pointer. Historically | 839 | BUG_ON(!mnt); |
| 840 | * callers got away with not passing it, but we must enforce this at | ||
| 841 | * the earliest possible point now to avoid strange problems deep in the | ||
| 842 | * filesystem stack. | ||
| 843 | */ | ||
| 844 | if (!mnt) { | ||
| 845 | printk(KERN_WARNING "%s called with NULL vfsmount\n", __func__); | ||
| 846 | dump_stack(); | ||
| 847 | return ERR_PTR(-EINVAL); | ||
| 848 | } | ||
| 849 | 840 | ||
| 850 | error = -ENFILE; | 841 | error = -ENFILE; |
| 851 | f = get_empty_filp(); | 842 | f = get_empty_filp(); |
diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index 08342232cb1c..f777f2902c49 100644 --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c | |||
| @@ -73,11 +73,16 @@ static int pstore_unlink(struct inode *dir, struct dentry *dentry) | |||
| 73 | struct pstore_private *p = dentry->d_inode->i_private; | 73 | struct pstore_private *p = dentry->d_inode->i_private; |
| 74 | 74 | ||
| 75 | p->erase(p->id); | 75 | p->erase(p->id); |
| 76 | kfree(p); | ||
| 77 | 76 | ||
| 78 | return simple_unlink(dir, dentry); | 77 | return simple_unlink(dir, dentry); |
| 79 | } | 78 | } |
| 80 | 79 | ||
| 80 | static void pstore_evict_inode(struct inode *inode) | ||
| 81 | { | ||
| 82 | end_writeback(inode); | ||
| 83 | kfree(inode->i_private); | ||
| 84 | } | ||
| 85 | |||
| 81 | static const struct inode_operations pstore_dir_inode_operations = { | 86 | static const struct inode_operations pstore_dir_inode_operations = { |
| 82 | .lookup = simple_lookup, | 87 | .lookup = simple_lookup, |
| 83 | .unlink = pstore_unlink, | 88 | .unlink = pstore_unlink, |
| @@ -110,6 +115,7 @@ static struct inode *pstore_get_inode(struct super_block *sb, | |||
| 110 | static const struct super_operations pstore_ops = { | 115 | static const struct super_operations pstore_ops = { |
| 111 | .statfs = simple_statfs, | 116 | .statfs = simple_statfs, |
| 112 | .drop_inode = generic_delete_inode, | 117 | .drop_inode = generic_delete_inode, |
| 118 | .evict_inode = pstore_evict_inode, | ||
| 113 | .show_options = generic_show_options, | 119 | .show_options = generic_show_options, |
| 114 | }; | 120 | }; |
| 115 | 121 | ||
diff --git a/fs/select.c b/fs/select.c index e56560d2b08a..d33418fdc858 100644 --- a/fs/select.c +++ b/fs/select.c | |||
| @@ -517,9 +517,6 @@ int do_select(int n, fd_set_bits *fds, struct timespec *end_time) | |||
| 517 | * Update: ERESTARTSYS breaks at least the xview clock binary, so | 517 | * Update: ERESTARTSYS breaks at least the xview clock binary, so |
| 518 | * I'm trying ERESTARTNOHAND which restart only when you want to. | 518 | * I'm trying ERESTARTNOHAND which restart only when you want to. |
| 519 | */ | 519 | */ |
| 520 | #define MAX_SELECT_SECONDS \ | ||
| 521 | ((unsigned long) (MAX_SCHEDULE_TIMEOUT / HZ)-1) | ||
| 522 | |||
| 523 | int core_sys_select(int n, fd_set __user *inp, fd_set __user *outp, | 520 | int core_sys_select(int n, fd_set __user *inp, fd_set __user *outp, |
| 524 | fd_set __user *exp, struct timespec *end_time) | 521 | fd_set __user *exp, struct timespec *end_time) |
| 525 | { | 522 | { |
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <linux/fs.h> | 7 | #include <linux/fs.h> |
| 8 | #include <linux/slab.h> | 8 | #include <linux/slab.h> |
| 9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
| 10 | #include <linux/namei.h> | ||
| 10 | #include <linux/sched.h> | 11 | #include <linux/sched.h> |
| 11 | #include <linux/writeback.h> | 12 | #include <linux/writeback.h> |
| 12 | #include <linux/syscalls.h> | 13 | #include <linux/syscalls.h> |
| @@ -128,6 +129,29 @@ void emergency_sync(void) | |||
| 128 | } | 129 | } |
| 129 | } | 130 | } |
| 130 | 131 | ||
| 132 | /* | ||
| 133 | * sync a single super | ||
| 134 | */ | ||
| 135 | SYSCALL_DEFINE1(syncfs, int, fd) | ||
| 136 | { | ||
| 137 | struct file *file; | ||
| 138 | struct super_block *sb; | ||
| 139 | int ret; | ||
| 140 | int fput_needed; | ||
| 141 | |||
| 142 | file = fget_light(fd, &fput_needed); | ||
| 143 | if (!file) | ||
| 144 | return -EBADF; | ||
| 145 | sb = file->f_dentry->d_sb; | ||
| 146 | |||
| 147 | down_read(&sb->s_umount); | ||
| 148 | ret = sync_filesystem(sb); | ||
| 149 | up_read(&sb->s_umount); | ||
| 150 | |||
| 151 | fput_light(file, fput_needed); | ||
| 152 | return ret; | ||
| 153 | } | ||
| 154 | |||
| 131 | /** | 155 | /** |
| 132 | * vfs_fsync_range - helper to sync a range of data & metadata to disk | 156 | * vfs_fsync_range - helper to sync a range of data & metadata to disk |
| 133 | * @file: file to sync | 157 | * @file: file to sync |
diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h index d94f447c667a..176b825add52 100644 --- a/include/asm-generic/unistd.h +++ b/include/asm-generic/unistd.h | |||
| @@ -652,9 +652,11 @@ __SYSCALL(__NR_name_to_handle_at, sys_name_to_handle_at) | |||
| 652 | __SYSCALL(__NR_open_by_handle_at, sys_open_by_handle_at) | 652 | __SYSCALL(__NR_open_by_handle_at, sys_open_by_handle_at) |
| 653 | #define __NR_clock_adjtime 266 | 653 | #define __NR_clock_adjtime 266 |
| 654 | __SYSCALL(__NR_clock_adjtime, sys_clock_adjtime) | 654 | __SYSCALL(__NR_clock_adjtime, sys_clock_adjtime) |
| 655 | #define __NR_syncfs 264 | ||
| 656 | __SYSCALL(__NR_syncfs, sys_syncfs) | ||
| 655 | 657 | ||
| 656 | #undef __NR_syscalls | 658 | #undef __NR_syscalls |
| 657 | #define __NR_syscalls 267 | 659 | #define __NR_syscalls 268 |
| 658 | 660 | ||
| 659 | /* | 661 | /* |
| 660 | * All syscalls below here should go away really, | 662 | * All syscalls below here should go away really, |
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 1a87760d6532..f2afed4fa945 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
| @@ -416,7 +416,6 @@ static inline bool d_mountpoint(struct dentry *dentry) | |||
| 416 | return dentry->d_flags & DCACHE_MOUNTED; | 416 | return dentry->d_flags & DCACHE_MOUNTED; |
| 417 | } | 417 | } |
| 418 | 418 | ||
| 419 | extern struct vfsmount *lookup_mnt(struct path *); | ||
| 420 | extern struct dentry *lookup_create(struct nameidata *nd, int is_dir); | 419 | extern struct dentry *lookup_create(struct nameidata *nd, int is_dir); |
| 421 | 420 | ||
| 422 | extern int sysctl_vfs_cache_pressure; | 421 | extern int sysctl_vfs_cache_pressure; |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 1f5c18e6f4f1..83ecc1749ef6 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -825,6 +825,7 @@ asmlinkage long sys_fanotify_init(unsigned int flags, unsigned int event_f_flags | |||
| 825 | asmlinkage long sys_fanotify_mark(int fanotify_fd, unsigned int flags, | 825 | asmlinkage long sys_fanotify_mark(int fanotify_fd, unsigned int flags, |
| 826 | u64 mask, int fd, | 826 | u64 mask, int fd, |
| 827 | const char __user *pathname); | 827 | const char __user *pathname); |
| 828 | asmlinkage long sys_syncfs(int fd); | ||
| 828 | 829 | ||
| 829 | int kernel_execve(const char *filename, const char *const argv[], const char *const envp[]); | 830 | int kernel_execve(const char *filename, const char *const argv[], const char *const envp[]); |
| 830 | 831 | ||
