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 = generic_file_open,
+ .open = udf_open_file,
.mmap = generic_file_mmap,
.write = udf_file_write,
.release = udf_release_file,