]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/fuse/inode.c
ALSA: Fix a const to non-const assignment in the Digigram VXpocket sound driver
[linux-2.6-omap-h63xx.git] / fs / fuse / inode.c
index 0cef5ea319f3dfa03953c48d402ca897f4288e98..3141690558c8aa6029128f7c2d8a5b9fc742696d 100644 (file)
@@ -84,7 +84,7 @@ static void fuse_destroy_inode(struct inode *inode)
 }
 
 void fuse_send_forget(struct fuse_conn *fc, struct fuse_req *req,
-                     unsigned long nodeid, u64 nlookup)
+                     u64 nodeid, u64 nlookup)
 {
        struct fuse_forget_in *inarg = &req->misc.forget_in;
        inarg->nlookup = nlookup;
@@ -207,7 +207,7 @@ static void fuse_init_inode(struct inode *inode, struct fuse_attr *attr)
 
 static int fuse_inode_eq(struct inode *inode, void *_nodeidp)
 {
-       unsigned long nodeid = *(unsigned long *) _nodeidp;
+       u64 nodeid = *(u64 *) _nodeidp;
        if (get_node_id(inode) == nodeid)
                return 1;
        else
@@ -216,12 +216,12 @@ static int fuse_inode_eq(struct inode *inode, void *_nodeidp)
 
 static int fuse_inode_set(struct inode *inode, void *_nodeidp)
 {
-       unsigned long nodeid = *(unsigned long *) _nodeidp;
+       u64 nodeid = *(u64 *) _nodeidp;
        get_fuse_inode(inode)->nodeid = nodeid;
        return 0;
 }
 
-struct inode *fuse_iget(struct super_block *sb, unsigned long nodeid,
+struct inode *fuse_iget(struct super_block *sb, u64 nodeid,
                        int generation, struct fuse_attr *attr,
                        u64 attr_valid, u64 attr_version)
 {
@@ -488,7 +488,12 @@ static struct fuse_conn *new_conn(struct super_block *sb)
                err = bdi_init(&fc->bdi);
                if (err)
                        goto error_kfree;
-               err = bdi_register_dev(&fc->bdi, fc->dev);
+               if (sb->s_bdev) {
+                       err = bdi_register(&fc->bdi, NULL, "%u:%u-fuseblk",
+                                          MAJOR(fc->dev), MINOR(fc->dev));
+               } else {
+                       err = bdi_register_dev(&fc->bdi, fc->dev);
+               }
                if (err)
                        goto error_bdi_destroy;
                /*
@@ -576,6 +581,8 @@ static void process_init_reply(struct fuse_conn *fc, struct fuse_req *req)
                                fc->no_lock = 1;
                        if (arg->flags & FUSE_ATOMIC_O_TRUNC)
                                fc->atomic_o_trunc = 1;
+                       if (arg->flags & FUSE_BIG_WRITES)
+                               fc->big_writes = 1;
                } else {
                        ra_pages = fc->max_read / PAGE_CACHE_SIZE;
                        fc->no_lock = 1;
@@ -584,7 +591,7 @@ static void process_init_reply(struct fuse_conn *fc, struct fuse_req *req)
                fc->bdi.ra_pages = min(fc->bdi.ra_pages, ra_pages);
                fc->minor = arg->minor;
                fc->max_write = arg->minor < 5 ? 4096 : arg->max_write;
-               fc->max_write = min_t(unsigned, 4096, fc->max_write);
+               fc->max_write = max_t(unsigned, 4096, fc->max_write);
                fc->conn_init = 1;
        }
        fuse_put_request(fc, req);
@@ -599,7 +606,8 @@ static void fuse_send_init(struct fuse_conn *fc, struct fuse_req *req)
        arg->major = FUSE_KERNEL_VERSION;
        arg->minor = FUSE_KERNEL_MINOR_VERSION;
        arg->max_readahead = fc->bdi.ra_pages * PAGE_CACHE_SIZE;
-       arg->flags |= FUSE_ASYNC_READ | FUSE_POSIX_LOCKS | FUSE_ATOMIC_O_TRUNC;
+       arg->flags |= FUSE_ASYNC_READ | FUSE_POSIX_LOCKS | FUSE_ATOMIC_O_TRUNC |
+               FUSE_BIG_WRITES;
        req->in.h.opcode = FUSE_INIT;
        req->in.numargs = 1;
        req->in.args[0].size = sizeof(*arg);
@@ -659,7 +667,7 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
        fc->flags = d.flags;
        fc->user_id = d.user_id;
        fc->group_id = d.group_id;
-       fc->max_read = min_t(unsigned, 4096, d.max_read);
+       fc->max_read = max_t(unsigned, 4096, d.max_read);
 
        /* Used by get_root_inode() */
        sb->s_fs_info = fc;