[kernel] update yaffs2 to compile with 2.6.23
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@9257 3c298f89-4303-0410-b956-a3cf2f4a3e73master
parent
89cb2932f8
commit
e103abd7dc
|
@ -32,7 +32,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const char *yaffs_fs_c_version =
|
const char *yaffs_fs_c_version =
|
||||||
"$Id: yaffs_fs.c,v 1.60 2007-05-15 20:07:40 charles Exp $";
|
"$Id: yaffs_fs.c,v 1.63 2007-09-19 20:35:40 imcd Exp $";
|
||||||
extern const char *yaffs_guts_c_version;
|
extern const char *yaffs_guts_c_version;
|
||||||
|
|
||||||
#include <linux/version.h>
|
#include <linux/version.h>
|
||||||
|
@ -213,24 +213,45 @@ static struct address_space_operations yaffs_file_address_operations = {
|
||||||
.commit_write = yaffs_commit_write,
|
.commit_write = yaffs_commit_write,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,22))
|
||||||
static struct file_operations yaffs_file_operations = {
|
static struct file_operations yaffs_file_operations = {
|
||||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,18))
|
|
||||||
.read = do_sync_read,
|
.read = do_sync_read,
|
||||||
.write = do_sync_write,
|
.write = do_sync_write,
|
||||||
.aio_read = generic_file_aio_read,
|
.aio_read = generic_file_aio_read,
|
||||||
.aio_write = generic_file_aio_write,
|
.aio_write = generic_file_aio_write,
|
||||||
|
.mmap = generic_file_mmap,
|
||||||
|
.flush = yaffs_file_flush,
|
||||||
|
.fsync = yaffs_sync_object,
|
||||||
|
.splice_read = generic_file_splice_read,
|
||||||
|
.splice_write = generic_file_splice_write,
|
||||||
|
};
|
||||||
|
|
||||||
|
#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,18))
|
||||||
|
|
||||||
|
static struct file_operations yaffs_file_operations = {
|
||||||
|
.read = do_sync_read,
|
||||||
|
.write = do_sync_write,
|
||||||
|
.aio_read = generic_file_aio_read,
|
||||||
|
.aio_write = generic_file_aio_write,
|
||||||
|
.mmap = generic_file_mmap,
|
||||||
|
.flush = yaffs_file_flush,
|
||||||
|
.fsync = yaffs_sync_object,
|
||||||
|
.sendfile = generic_file_sendfile,
|
||||||
|
};
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
static struct file_operations yaffs_file_operations = {
|
||||||
.read = generic_file_read,
|
.read = generic_file_read,
|
||||||
.write = generic_file_write,
|
.write = generic_file_write,
|
||||||
#endif
|
|
||||||
.mmap = generic_file_mmap,
|
.mmap = generic_file_mmap,
|
||||||
.flush = yaffs_file_flush,
|
.flush = yaffs_file_flush,
|
||||||
.fsync = yaffs_sync_object,
|
.fsync = yaffs_sync_object,
|
||||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
|
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
|
||||||
.sendfile = generic_file_sendfile,
|
.sendfile = generic_file_sendfile,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
static struct inode_operations yaffs_file_inode_operations = {
|
static struct inode_operations yaffs_file_inode_operations = {
|
||||||
.setattr = yaffs_setattr,
|
.setattr = yaffs_setattr,
|
||||||
|
@ -1430,6 +1451,7 @@ static void yaffs_read_inode(struct inode *inode)
|
||||||
|
|
||||||
static LIST_HEAD(yaffs_dev_list);
|
static LIST_HEAD(yaffs_dev_list);
|
||||||
|
|
||||||
|
#if 0 // not used
|
||||||
static int yaffs_remount_fs(struct super_block *sb, int *flags, char *data)
|
static int yaffs_remount_fs(struct super_block *sb, int *flags, char *data)
|
||||||
{
|
{
|
||||||
yaffs_Device *dev = yaffs_SuperToDevice(sb);
|
yaffs_Device *dev = yaffs_SuperToDevice(sb);
|
||||||
|
@ -1458,6 +1480,7 @@ static int yaffs_remount_fs(struct super_block *sb, int *flags, char *data)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void yaffs_put_super(struct super_block *sb)
|
static void yaffs_put_super(struct super_block *sb)
|
||||||
{
|
{
|
||||||
|
@ -2095,7 +2118,7 @@ static int yaffs_proc_write(struct file *file, const char *buf,
|
||||||
unsigned rg = 0, mask_bitfield;
|
unsigned rg = 0, mask_bitfield;
|
||||||
char *end;
|
char *end;
|
||||||
char *mask_name;
|
char *mask_name;
|
||||||
char *x;
|
const char *x;
|
||||||
char substring[MAX_MASK_NAME_LENGTH+1];
|
char substring[MAX_MASK_NAME_LENGTH+1];
|
||||||
int i;
|
int i;
|
||||||
int done = 0;
|
int done = 0;
|
||||||
|
@ -2128,6 +2151,7 @@ static int yaffs_proc_write(struct file *file, const char *buf,
|
||||||
if (end > buf + pos) {
|
if (end > buf + pos) {
|
||||||
mask_name = "numeral";
|
mask_name = "numeral";
|
||||||
len = end - (buf + pos);
|
len = end - (buf + pos);
|
||||||
|
pos += len;
|
||||||
done = 0;
|
done = 0;
|
||||||
} else {
|
} else {
|
||||||
for(x = buf + pos, i = 0;
|
for(x = buf + pos, i = 0;
|
||||||
|
@ -2137,8 +2161,6 @@ static int yaffs_proc_write(struct file *file, const char *buf,
|
||||||
substring[i] = '\0';
|
substring[i] = '\0';
|
||||||
|
|
||||||
for (i = 0; mask_flags[i].mask_name != NULL; i++) {
|
for (i = 0; mask_flags[i].mask_name != NULL; i++) {
|
||||||
//len = strlen(mask_flags[i].mask_name);
|
|
||||||
//if (strncmp(buf + pos, mask_flags[i].mask_name, len) == 0) {
|
|
||||||
if(strcmp(substring,mask_flags[i].mask_name) == 0){
|
if(strcmp(substring,mask_flags[i].mask_name) == 0){
|
||||||
mask_name = mask_flags[i].mask_name;
|
mask_name = mask_flags[i].mask_name;
|
||||||
mask_bitfield = mask_flags[i].mask_bitfield;
|
mask_bitfield = mask_flags[i].mask_bitfield;
|
||||||
|
@ -2149,7 +2171,6 @@ static int yaffs_proc_write(struct file *file, const char *buf,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mask_name != NULL) {
|
if (mask_name != NULL) {
|
||||||
// pos += len;
|
|
||||||
done = 0;
|
done = 0;
|
||||||
switch(add) {
|
switch(add) {
|
||||||
case '-':
|
case '-':
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#endif
|
#endif
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/mm.h>
|
#include <linux/mm.h>
|
||||||
|
#include <linux/sched.h>
|
||||||
#include <linux/string.h>
|
#include <linux/string.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/vmalloc.h>
|
#include <linux/vmalloc.h>
|
||||||
|
|
Loading…
Reference in New Issue