~barry/ubuntu/maverick/fuse/bug-697792-m

« back to all changes in this revision

Viewing changes to kernel/file.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2007-08-04 08:09:00 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20070804080900-m1e9xpk5eitzmelg
Tags: 2.7.0-1ubuntu1
* Resynchronise with Debian (LP: #128292). Remaining changes:
  - Don't install the init script; install the udev rule and the module
    configuration file instead.
  - debian/45-fuse.rules: set /dev/fuse group to fuse.
  - debian/fuse-utils.modprobe: module configuration file that mounts the
    control filesystem when fuse is loaded and unmounts it when fuse is
    unloaded, along with checking that the control FS is mounting before
    unmounting it.
  - debian/fuse-utils.install: add the udev rule, the module configuration
    file, and ulockmgr_server.
  - Load fuse on install, and set it so it gets loaded on reboot.
  - Move fusermount and ulockmgr_server to /bin and associated libraries
    to /lib.
* Use dpkg-query to fetch conffile md5sums rather than parsing
  /var/lib/dpkg/status directly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
  FUSE: Filesystem in Userspace
3
 
  Copyright (C) 2001-2006  Miklos Szeredi <miklos@szeredi.hu>
 
3
  Copyright (C) 2001-2007  Miklos Szeredi <miklos@szeredi.hu>
4
4
 
5
5
  This program can be distributed under the terms of the GNU GPL.
6
6
  See the file COPYING.
11
11
#include <linux/pagemap.h>
12
12
#include <linux/slab.h>
13
13
#include <linux/kernel.h>
 
14
#include <linux/sched.h>
14
15
 
15
16
#ifndef KERNEL_2_6_11_PLUS
16
17
static inline loff_t page_offset(struct page *page)
75
76
        if (outarg->open_flags & FOPEN_DIRECT_IO)
76
77
                file->f_op = &fuse_direct_io_file_operations;
77
78
        if (!(outarg->open_flags & FOPEN_KEEP_CACHE))
 
79
#ifdef KERNEL_2_6_21_PLUS
 
80
                invalidate_mapping_pages(inode->i_mapping, 0, -1);
 
81
#else
78
82
                invalidate_inode_pages(inode->i_mapping);
 
83
#endif
79
84
        ff->fh = outarg->fh;
80
85
        file->private_data = ff;
81
86
}
627
632
        ssize_t res;
628
633
        /* Don't allow parallel writes to the same file */
629
634
        mutex_lock(&inode->i_mutex);
630
 
        res = fuse_direct_io(file, buf, count, ppos, 1);
 
635
        res = generic_write_checks(file, ppos, &count, 0);
 
636
        if (!res)
 
637
                res = fuse_direct_io(file, buf, count, ppos, 1);
631
638
        mutex_unlock(&inode->i_mutex);
632
639
        return res;
633
640
}
781
788
 
782
789
        if (cmd == F_GETLK) {
783
790
                if (fc->no_lock) {
784
 
#ifdef KERNEL_2_6_17_PLUS
 
791
#ifdef KERNEL_2_6_22_PLUS
 
792
                        posix_test_lock(file, fl);
 
793
#elif defined(KERNEL_2_6_17_PLUS)
785
794
                        if (!posix_test_lock(file, fl, fl))
786
795
                                fl->fl_type = F_UNLCK;
787
796
#else