linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / fs / udf / file.c
index 33640a9..a6f2acc 100644 (file)
@@ -4,11 +4,6 @@
  * PURPOSE
  *  File handling routines for the OSTA-UDF(tm) filesystem.
  *
- * CONTACTS
- *  E-mail regarding any portion of the Linux UDF file system should be
- *  directed to the development team mailing list (run by majordomo):
- *    linux_udf@hpesjro.fc.hp.com
- *
  * COPYRIGHT
  *  This file is distributed under the terms of the GNU General Public
  *  License (GPL). Copies of the GPL can be obtained from:
@@ -36,6 +31,7 @@
 #include <asm/uaccess.h>
 #include <linux/kernel.h>
 #include <linux/string.h> /* memset */
+#include <linux/capability.h>
 #include <linux/errno.h>
 #include <linux/smp_lock.h>
 #include <linux/pagemap.h>
@@ -49,8 +45,7 @@ static int udf_adinicb_readpage(struct file *file, struct page * page)
        struct inode *inode = page->mapping->host;
        char *kaddr;
 
-       if (!PageLocked(page))
-               PAGE_BUG(page);
+       BUG_ON(!PageLocked(page));
 
        kaddr = kmap(page);
        memset(kaddr, 0, PAGE_CACHE_SIZE);
@@ -67,8 +62,7 @@ static int udf_adinicb_writepage(struct page *page, struct writeback_control *wb
        struct inode *inode = page->mapping->host;
        char *kaddr;
 
-       if (!PageLocked(page))
-               PAGE_BUG(page);
+       BUG_ON(!PageLocked(page));
 
        kaddr = kmap(page);
        memcpy(UDF_I_DATA(inode) + UDF_I_LENEATTR(inode), kaddr, inode->i_size);
@@ -188,7 +182,7 @@ int udf_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
 {
        int result = -EINVAL;
 
-       if ( permission(inode, MAY_READ, NULL) != 0 )
+       if ( file_permission(filp, MAY_READ) != 0 )
        {
                udf_debug("no permission to access inode %lu\n",
                                                inode->i_ino);
@@ -254,30 +248,10 @@ static int udf_release_file(struct inode * inode, struct file * filp)
        return 0;
 }
 
-/*
- * udf_open_file
- *
- * PURPOSE
- *  Called when an inode is about to be open.
- *
- * DESCRIPTION
- *  Use this to disallow opening RW large files on 32 bit systems.
- *  On 64 bit systems we force on O_LARGEFILE in sys_open.
- *
- * HISTORY
- *
- */
-static int udf_open_file(struct inode * inode, struct file * filp)
-{
-       if ((inode->i_size & 0xFFFFFFFF80000000ULL) && !(filp->f_flags & O_LARGEFILE))
-               return -EFBIG;
-       return 0;
-}
-
 struct file_operations udf_file_operations = {
        .read                   = generic_file_read,
        .ioctl                  = udf_ioctl,
-       .open                   = udf_open_file,
+       .open                   = generic_file_open,
        .mmap                   = generic_file_mmap,
        .write                  = udf_file_write,
        .release                = udf_release_file,