Separate out common fstatat code into vfs_fstatat
[safe/jmp/linux-2.6] / fs / sync.c
index 23ebbd7..7abc65f 100644 (file)
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -25,7 +25,7 @@ static void do_sync(unsigned long wait)
 {
        wakeup_pdflush(0);
        sync_inodes(0);         /* All mappings, inodes and their blockdevs */
-       DQUOT_SYNC(NULL);
+       vfs_dq_sync(NULL);
        sync_supers();          /* Write the superblocks */
        sync_filesystems(0);    /* Start syncing the filesystems */
        sync_filesystems(wait); /* Waitingly sync the filesystems */
@@ -36,15 +36,27 @@ static void do_sync(unsigned long wait)
                laptop_sync_completion();
 }
 
-asmlinkage long sys_sync(void)
+SYSCALL_DEFINE0(sync)
 {
        do_sync(1);
        return 0;
 }
 
+static void do_sync_work(struct work_struct *work)
+{
+       do_sync(0);
+       kfree(work);
+}
+
 void emergency_sync(void)
 {
-       pdflush_operation(do_sync, 0);
+       struct work_struct *work;
+
+       work = kmalloc(sizeof(*work), GFP_ATOMIC);
+       if (work) {
+               INIT_WORK(work, do_sync_work);
+               schedule_work(work);
+       }
 }
 
 /*
@@ -144,12 +156,12 @@ static int do_fsync(unsigned int fd, int datasync)
        return ret;
 }
 
-asmlinkage long sys_fsync(unsigned int fd)
+SYSCALL_DEFINE1(fsync, unsigned int, fd)
 {
        return do_fsync(fd, 0);
 }
 
-asmlinkage long sys_fdatasync(unsigned int fd)
+SYSCALL_DEFINE1(fdatasync, unsigned int, fd)
 {
        return do_fsync(fd, 1);
 }