Changeset 935

Show
Ignore:
Timestamp:
08/03/08 22:52:13 (5 months ago)
Author:
mariodebian
Message:

unionfs-tcos (1.0.2.6.26.tcos2)

  • Fix vfs_splice_from, vfs_splice_to and rw_verify_area (file.c)
  • Move test target in Makefile to bottom
Location:
trunk/unionfs-tcos
Files:
2 removed
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/unionfs-tcos/2.6.26/file.c

    r934 r935  
    1818 
    1919#include "union.h" 
     20#include <linux/splice.h> 
     21 
     22int security_file_permission (struct file *file, int mask) 
     23{ 
     24        return 0; 
     25} 
     26 
     27#define MAX_RW_COUNT (INT_MAX & PAGE_CACHE_MASK) 
     28 
     29int rw_verify_area(int read_write, struct file *file, loff_t *ppos, size_t count) 
     30{ 
     31        struct inode *inode; 
     32        loff_t pos; 
     33        int retval = -EINVAL; 
     34 
     35        inode = file->f_path.dentry->d_inode; 
     36        if (unlikely((ssize_t) count < 0)) 
     37                return retval; 
     38        pos = *ppos; 
     39        if (unlikely((pos < 0) || (loff_t) (pos + count) < 0)) 
     40                return retval; 
     41 
     42        if (unlikely(inode->i_flock && mandatory_lock(inode))) { 
     43                retval = locks_mandatory_area( 
     44                        read_write == READ ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE, 
     45                        inode, file, pos, count); 
     46                if (retval < 0) 
     47                        return retval; 
     48        } 
     49        retval = security_file_permission(file, 
     50                                read_write == READ ? MAY_READ : MAY_WRITE); 
     51        if (retval) 
     52                return retval; 
     53        return count > MAX_RW_COUNT ? MAX_RW_COUNT : count; 
     54} 
     55 
     56long vfs_splice_from(struct pipe_inode_info *pipe, struct file *out, 
     57                     loff_t *ppos, size_t len, unsigned int flags) 
     58{ 
     59        int ret; 
     60 
     61        if (unlikely(!out->f_op || !out->f_op->splice_write)) 
     62                return -EINVAL; 
     63 
     64        if (unlikely(!(out->f_mode & FMODE_WRITE))) 
     65                return -EBADF; 
     66 
     67        ret = rw_verify_area(WRITE, out, ppos, len); 
     68        if (unlikely(ret < 0)) 
     69                return ret; 
     70 
     71        return out->f_op->splice_write(pipe, out, ppos, len, flags); 
     72} 
     73 
     74long vfs_splice_to(struct file *in, loff_t *ppos, 
     75                   struct pipe_inode_info *pipe, size_t len, 
     76                   unsigned int flags) 
     77{ 
     78        int ret; 
     79 
     80        if (unlikely(!in->f_op || !in->f_op->splice_read)) 
     81                return -EINVAL; 
     82 
     83        if (unlikely(!(in->f_mode & FMODE_READ))) 
     84                return -EBADF; 
     85 
     86        ret = rw_verify_area(READ, in, ppos, len); 
     87        if (unlikely(ret < 0)) 
     88                return ret; 
     89 
     90        return in->f_op->splice_read(in, ppos, pipe, len, flags); 
     91} 
    2092 
    2193static ssize_t unionfs_read(struct file *file, char __user *buf, 
  • trunk/unionfs-tcos/2.6.26/main.c

    r934 r935  
    2020#include <linux/module.h> 
    2121#include <linux/moduleparam.h> 
     22 
     23 
    2224 
    2325static void unionfs_fill_inode(struct dentry *dentry, 
  • trunk/unionfs-tcos/2.6.26/union.h

    r934 r935  
    5353#include "linux/union_fs.h" 
    5454 
    55 long vfs_splice_from(struct pipe_inode_info *pipe, struct file *out, 
    56                     loff_t *ppos, size_t len, unsigned int flags); 
    57 long vfs_splice_to(struct file *in, loff_t *ppos, 
    58                   struct pipe_inode_info *pipe, size_t len, 
    59                   unsigned int flags); 
    6055#define UNIONFS_SUPER_MAGIC 0xf15f083d 
    6156 
  • trunk/unionfs-tcos/Makefile

    r934 r935  
    88MODVERSION=$(shell echo $(KVER) | awk -F"-" '{print $$1}') 
    99SRCPATH=$(shell if [ -d $(CURDIR)/$(MODVERSION) ]; then echo $(CURDIR)/$(MODVERSION); else echo $(CURDIR)/build; fi) 
    10  
    11 test: 
    12         @echo KVER=$(MODVERSION) 
    13         @echo SRCPATH=$(SRCPATH) 
    1410 
    1511modules: 
     
    2622 
    2723modulesclean: 
    28         CFLAGS="$(CFLAGS)" make -C $(KDIR) SUBDIRS=`pwd`/build2 CONFIG_UNION_FS=m $(DBG_CONFIG) CC="${CROSS_COMPILE}gcc" clean 
     24        CFLAGS="$(CFLAGS)" make -C $(KDIR) SUBDIRS=$(SRCPATH) CONFIG_UNION_FS=m $(DBG_CONFIG) CC="${CROSS_COMPILE}gcc" clean 
     25 
     26test: 
     27        @echo KVER=$(MODVERSION) 
     28        @echo SRCPATH=$(SRCPATH) 
     29 
  • trunk/unionfs-tcos/debian/changelog

    r934 r935  
     1unionfs-tcos (1.0.2.6.26.tcos2) unstable; urgency=low 
     2 
     3  * Fix vfs_splice_from, vfs_splice_to and rw_verify_area (file.c) 
     4  * Move test target in Makefile to bottom 
     5 
     6 -- Mario Izquierdo (mariodebian) <mariodebian@gmail.com>  Sun, 03 Aug 2008 22:51:46 +0200 
     7 
    18unionfs-tcos (1.0.2.6.26.tcos1) unstable; urgency=low 
    29