changeset 1835:dca80ff444df

Remove two files which are no longer used.
author asl
date Fri, 12 Nov 2004 16:53:05 +0000
parents 121da35df27b
children 9ad253729c53
files packages/fs/jffs2/current/src/file-ecos.c packages/fs/jffs2/current/src/jffs2port.h
diffstat 2 files changed, 0 insertions(+), 455 deletions(-) [+]
line wrap: on
line diff
deleted file mode 100644
--- a/packages/fs/jffs2/current/src/file-ecos.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * JFFS2 -- Journalling Flash File System, Version 2.
- *
- * Copyright (C) 2001, 2002 Red Hat, Inc.
- *
- * Created by David Woodhouse <dwmw2@cambridge.redhat.com>
- *
- * For licensing information, see the file 'LICENCE' in this directory.
- *
- * $Id: file-ecos.c,v 1.6 2003/11/20 16:41:58 dwmw2 Exp $
- *
- */
-
-#include <linux/kernel.h>
-#include <linux/pagemap.h>
-#include <linux/crc32.h>
-#include "nodelist.h"
-
-int jffs2_do_readpage_nolock (struct inode *inode, struct page *pg)
-{
-	struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode);
-	struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
-	unsigned char *pg_buf;
-	int ret;
-
-	D1(printk(KERN_DEBUG "jffs2_do_readpage_nolock(): ino #%lu, page at offset 0x%lx\n", inode->i_ino, pg->index << PAGE_CACHE_SHIFT));
-
-	if (!PageLocked(pg))
-                PAGE_BUG(pg);
-
-	pg_buf = (char *)kmap(pg);
-	/* FIXME: Can kmap fail? */
-
-	ret = jffs2_read_inode_range(c, f, pg_buf, pg->index << PAGE_CACHE_SHIFT, PAGE_CACHE_SIZE);
-
-	if (ret) {
-		ClearPageUptodate(pg);
-		SetPageError(pg);
-	} else {
-		SetPageUptodate(pg);
-		ClearPageError(pg);
-	}
-
-	flush_dcache_page(pg);
-	kunmap(pg);
-
-	D1(printk(KERN_DEBUG "readpage finished\n"));
-	return 0;
-}
-
-int jffs2_do_readpage_unlock(struct inode *inode, struct page *pg)
-{
-	int ret = jffs2_do_readpage_nolock(inode, pg);
-	UnlockPage(pg);
-	return ret;
-}
-
-
-//int jffs2_readpage (struct file *filp, struct page *pg)
-int jffs2_readpage (struct inode *d_inode, struct page *pg)
-{
-	//	struct jffs2_inode_info *f = JFFS2_INODE_INFO(d_inode);
-	int ret;
-	
-	//	down(&f->sem);
-	ret = jffs2_do_readpage_unlock(d_inode, pg);
-	//	up(&f->sem);
-	return ret;
-}
-
-//int jffs2_prepare_write (struct file *filp, struct page *pg, unsigned start, unsigned end)
-int jffs2_prepare_write (struct inode *d_inode, struct page *pg, unsigned start, unsigned end)
-{
-	struct inode *inode = d_inode;
-	struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode);
-	uint32_t pageofs = pg->index << PAGE_CACHE_SHIFT;
-	int ret = 0;
-
-	D1(printk(KERN_DEBUG "jffs2_prepare_write()\n"));
-
-	if (pageofs > inode->i_size) {
-		/* Make new hole frag from old EOF to new page */
-		struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
-		struct jffs2_raw_inode ri;
-		struct jffs2_full_dnode *fn;
-		uint32_t phys_ofs, alloc_len;
-		
-		D1(printk(KERN_DEBUG "Writing new hole frag 0x%x-0x%x between current EOF and new page\n",
-			  (unsigned int)inode->i_size, pageofs));
-
-		ret = jffs2_reserve_space(c, sizeof(ri), &phys_ofs, &alloc_len, ALLOC_NORMAL);
-		if (ret)
-			return ret;
-
-		down(&f->sem);
-		memset(&ri, 0, sizeof(ri));
-
-		ri.magic = cpu_to_je16(JFFS2_MAGIC_BITMASK);
-		ri.nodetype = cpu_to_je16(JFFS2_NODETYPE_INODE);
-		ri.totlen = cpu_to_je32(sizeof(ri));
-		ri.hdr_crc = cpu_to_je32(crc32(0, &ri, sizeof(struct jffs2_unknown_node)-4));
-
-		ri.ino = cpu_to_je32(f->inocache->ino);
-		ri.version = cpu_to_je32(++f->highest_version);
-		ri.mode = cpu_to_jemode(inode->i_mode);
-		ri.uid = cpu_to_je16(inode->i_uid);
-		ri.gid = cpu_to_je16(inode->i_gid);
-
-		ri.isize = cpu_to_je32(max((uint32_t)inode->i_size, pageofs));
-		ri.atime = ri.ctime = ri.mtime = cpu_to_je32(cyg_timestamp());
-		ri.offset = cpu_to_je32(inode->i_size);
-		ri.dsize = cpu_to_je32(pageofs - inode->i_size);
-		ri.csize = cpu_to_je32(0);
-		ri.compr = JFFS2_COMPR_ZERO;
-		ri.node_crc = cpu_to_je32(crc32(0, &ri, sizeof(ri)-8));
-		ri.data_crc = cpu_to_je32(0);
-		
-		fn = jffs2_write_dnode(c, f, &ri, NULL, 0, phys_ofs, ALLOC_NORMAL);
-		jffs2_complete_reservation(c);
-		if (IS_ERR(fn)) {
-			ret = PTR_ERR(fn);
-			up(&f->sem);
-			return ret;
-		}
-		ret = jffs2_add_full_dnode_to_inode(c, f, fn);
-		if (f->metadata) {
-			jffs2_mark_node_obsolete(c, f->metadata->raw);
-			jffs2_free_full_dnode(f->metadata);
-			f->metadata = NULL;
-		}
-		if (ret) {
-			D1(printk(KERN_DEBUG "Eep. add_full_dnode_to_inode() failed in prepare_write, returned %d\n", ret));
-			jffs2_mark_node_obsolete(c, fn->raw);
-			jffs2_free_full_dnode(fn);
-			up(&f->sem);
-			return ret;
-		}
-		inode->i_size = pageofs;
-		up(&f->sem);
-	}
-	
-
-	/* Read in the page if it wasn't already present, unless it's a whole page */
-        // eCos has no concept of uptodate and by default always reads pages afresh
-	if (!Page_Uptodate(pg) && (start || end < PAGE_CACHE_SIZE)) {
-		down(&f->sem);
-		ret = jffs2_do_readpage_nolock(inode, pg);
-		up(&f->sem);
-	}
-	D1(printk(KERN_DEBUG "end prepare_write()\n"));
-	return ret;
-}
-
-//int jffs2_commit_write (struct file *filp, struct page *pg, unsigned start, unsigned end)
-int jffs2_commit_write (struct inode *d_inode, struct page *pg, unsigned start, unsigned end)
-{
-	/* Actually commit the write from the page cache page we're looking at.
-	 * For now, we write the full page out each time. It sucks, but it's simple
-	 */
-	struct inode *inode = d_inode;
-	struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode);
-	struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
-	struct jffs2_raw_inode *ri;
-	int ret = 0;
-	uint32_t writtenlen = 0;
-
-	D1(printk(KERN_DEBUG "jffs2_commit_write(): ino #%lu, page at 0x%lx, range %d-%d\n",
-		  inode->i_ino, pg->index << PAGE_CACHE_SHIFT, start, end));
-
-
-	ri = jffs2_alloc_raw_inode();
-	if (!ri) {
-		D1(printk(KERN_DEBUG "jffs2_commit_write(): Allocation of raw inode failed\n"));
-		return -ENOMEM;
-	}
-
-	/* Set the fields that the generic jffs2_write_inode_range() code can't find */
-	ri->ino = cpu_to_je32(inode->i_ino);
-	ri->mode = cpu_to_jemode(inode->i_mode);
-	ri->uid = cpu_to_je16(inode->i_uid);
-	ri->gid = cpu_to_je16(inode->i_gid);
-	ri->isize = cpu_to_je32((uint32_t)inode->i_size);
-	ri->atime = ri->ctime = ri->mtime = cpu_to_je32(cyg_timestamp());
-
-	ret = jffs2_write_inode_range(c, f, ri, page_address(pg) + start,
-				      (pg->index << PAGE_CACHE_SHIFT) + start,
-				      end - start, &writtenlen);
-
-	if (ret) {
-		/* There was an error writing. */
-		SetPageError(pg);
-	}
-
-	if (writtenlen) {
-		if (inode->i_size < (pg->index << PAGE_CACHE_SHIFT) + start + writtenlen) {
-			inode->i_size = (pg->index << PAGE_CACHE_SHIFT) + start + writtenlen;
-			inode->i_ctime = inode->i_mtime = je32_to_cpu(ri->ctime);
-		}
-	}
-
-	jffs2_free_raw_inode(ri);
-
-	if (start+writtenlen < end) {
-		/* generic_file_write has written more to the page cache than we've
-		   actually written to the medium. Mark the page !Uptodate so that 
-		   it gets reread */
-		D1(printk(KERN_DEBUG "jffs2_commit_write(): Not all bytes written. Marking page !uptodate\n"));
-		SetPageError(pg);
-		ClearPageUptodate(pg);
-	}
-
-	D1(printk(KERN_DEBUG "jffs2_commit_write() returning %d\n",writtenlen?writtenlen:ret));
-	return writtenlen?writtenlen:ret;
-}
deleted file mode 100644
--- a/packages/fs/jffs2/current/src/jffs2port.h
+++ /dev/null
@@ -1,241 +0,0 @@
-#ifndef __LINUX_JFFS2PORT_H__
-#define __LINUX_JFFS2PORT_H__
-
-/* $Id: jffs2port.h,v 1.4 2003/11/20 16:41:58 dwmw2 Exp $ */
-
-#include <pkgconf/system.h>
-#include <pkgconf/hal.h>
-//#include <pkgconf/kernel.h>
-#include <pkgconf/io_fileio.h>
-//#include <pkgconf/fs_ram.h>
-
-#include <cyg/infra/cyg_trac.h>        // tracing macros
-#include <cyg/infra/cyg_ass.h>         // assertion macros
-
-#include <unistd.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <dirent.h>
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <cyg/fileio/fileio.h>
-
-#include <cyg/hal/drv_api.h>
-#include <cyg/infra/diag.h>
-
-#include <cyg/io/flash.h>
-
-#include <pkgconf/fs_jffs2.h>
-#include <linux/types.h>
-#include <linux/list.h>
-#include <asm/bug.h>
-// Linux types
-#define printf diag_printf
-
-// Structures used by VFS
-
-typedef unsigned short kdev_t;
-
-struct qstr {
-	const unsigned char * name;
-	unsigned int len;
-	unsigned int hash;
-};
-
-#define DNAME_INLINE_LEN 16
-
-struct dentry {
-	//	atomic_t d_count;
-	unsigned int d_flags;
-	struct inode  * d_inode;	/* Where the name belongs to - NULL is negative */
-	struct dentry * d_parent;	/* parent directory */
-	struct list_head d_hash;	/* lookup hash list */
-	struct list_head d_child;	/* child of parent list */
-	struct list_head d_subdirs;	/* our children */
-	struct list_head d_alias;	/* inode alias list */
-	struct qstr d_name;
-	struct dentry_operations  *d_op;
-	struct super_block * d_sb;	/* The root of the dentry tree */
-	unsigned char d_iname[DNAME_INLINE_LEN]; /* small names */
-};
-
-struct file {
-	struct dentry		*f_dentry;
-	unsigned int 		f_flags;
-	mode_t			    f_mode;
-	loff_t			    f_pos;
-	unsigned long 		f_reada, f_ramax, f_raend, f_ralen, f_rawin;
-};
-
-#define ATTR_MODE	1
-#define ATTR_UID	2
-#define ATTR_GID	4
-#define ATTR_SIZE	8
-#define ATTR_ATIME	16
-#define ATTR_MTIME	32
-#define ATTR_CTIME	64
-#define ATTR_ATIME_SET	128
-#define ATTR_MTIME_SET	256
-#define ATTR_FORCE	512	/* Not a change, but a change it */
-#define ATTR_ATTR_FLAG	1024
-
-typedef unsigned short umode_t;
-
-struct iattr {
-        unsigned int ia_valid;
-	umode_t		ia_mode;
-	uid_t		ia_uid;
-	gid_t		ia_gid;
-	loff_t		ia_size;
-	time_t		ia_atime;
-	time_t		ia_mtime;
-	time_t		ia_ctime;
-};
-
-struct page {
-	unsigned long index;
-	void *virtual;
-};
-
-struct nameidata {
-	struct dentry *dentry;
-	struct qstr last;
-	unsigned int flags;
-	int last_type;
-};
-
-struct file_operations {
-	//struct module *owner;
-	//loff_t (*llseek) (struct file *, loff_t, int);
-	ssize_t (*read) (struct file *, char *, size_t, loff_t *);
-	//ssize_t (*write) (struct file *, const char *, size_t, loff_t *);
-	int (*readdir) (struct file *, char *, int);
-	//unsigned int (*poll) (struct file *, struct poll_table_struct *);
-	int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long);
-	//int (*mmap) (struct file *, struct vm_area_struct *);
-	//int (*open) (struct inode *, struct file *);
-	//int (*flush) (struct file *);
-	//int (*release) (struct inode *, struct file *);
-	int (*fsync) (struct file *, struct dentry *, int datasync);
-	//int (*fasync) (int, struct file *, int);
-	//int (*lock) (struct file *, int, struct file_lock *);
-	//ssize_t (*readv) (struct file *, const struct iovec *, unsigned long, loff_t *);
-	//ssize_t (*writev) (struct file *, const struct iovec *, unsigned long, loff_t *);
-};
-
-struct inode_operations {
-	int (*create) (struct inode *,struct dentry *,int);
-	struct dentry * (*lookup) (struct inode *,struct dentry *);
-	int (*link) (struct dentry *,struct inode *,struct dentry *);
-	int (*unlink) (struct inode *,struct dentry *);
-	int (*symlink) (struct inode *,struct dentry *,const char *);
-	int (*mkdir) (struct inode *,struct dentry *,int);
-	int (*rmdir) (struct inode *,struct dentry *);
-	int (*mknod) (struct inode *,struct dentry *,int,int);
-	int (*rename) (struct inode *, struct dentry *,
-			struct inode *, struct dentry *);
-	int (*readlink) (struct dentry *, char *,int);
-	int (*follow_link) (struct dentry *, struct nameidata *);
-	//void (*truncate) (struct inode *);
-	int (*permission) (struct inode *, int);
-	//int (*revalidate) (struct dentry *);
-	int (*setattr) (struct dentry *, struct iattr *);
-	//int (*getattr) (struct dentry *, struct iattr *);
-};
-
-
-struct iovec {
-        void *iov_base;
-        ssize_t iov_len; 
-};
-
-
-// called by JFFS2
-
-#define to_kdev_t(rdev) (rdev)
-#define MAJOR(rdev) (rdev)>>8
-#define MINOR(rdev) (rdev)
-
-#define page_address(page)	((page)->virtual)
-
-static __inline__ void * kmap(struct page * page) {
-	return page_address(page);
-}
-
-#define kunmap(page) do { } while (0)
-
-//struct page * read_cache_page(cyg_uint32 start, void * f, struct inode * i);
-struct page *read_cache_page(unsigned long index, int (*filler)(void *,struct page*), void *data);
-void page_cache_release(struct page * pg);
-
-struct inode * new_inode(struct super_block *sb);
-struct inode * iget(struct super_block *sb, cyg_uint32 ino);
-void iput(struct inode * i);
-void make_bad_inode(struct inode * inode);
-int is_bad_inode(struct inode * inode);
-
-#define insert_inode_hash(inode) do { } while (0)
-
-#define d_alloc_root(root_inode) root_inode
-
-#define flush_dcache_page(page) do { } while (0)
-
-struct jffs2_sb_info;
-struct jffs2_eraseblock;
-
-cyg_bool jffs2_flash_read(struct jffs2_sb_info *c, cyg_uint32 read_buffer_offset, const size_t size, size_t * return_size, char * write_buffer);
-cyg_bool jffs2_flash_write(struct jffs2_sb_info *c, cyg_uint32 write_buffer_offset, const size_t size, size_t * return_size, char * read_buffer);
-int jffs2_flash_direct_writev(struct jffs2_sb_info *c, const struct iovec *vecs, unsigned long count, loff_t to, size_t *retlen);
-cyg_bool jffs2_flash_erase(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
-
-
-// calls to JFFS2
-
-// dir-ecos.c
-struct inode *jffs2_lookup(struct inode *dir_i, struct qstr *name);
-int jffs2_readdir (struct inode *d_inode, unsigned long f_pos, char *nbuf, int nlen);
-int jffs2_create(struct inode *dir_i, struct qstr *d_name, int mode, struct inode **new_i);
-int jffs2_mkdir (struct inode *dir_i, struct qstr *d_name, int mode, struct inode **new_i);
-int jffs2_link (struct inode *old_d_inode, struct inode *dir_i, struct qstr *d_name);
-int jffs2_unlink(struct inode *dir_i, struct inode *d_inode, struct qstr *d_name);
-int jffs2_rmdir (struct inode *dir_i, struct inode *d_inode, struct qstr *d_name);
-int jffs2_rename (struct inode *old_dir_i, struct inode *d_inode, struct qstr *old_d_name,
-                        struct inode *new_dir_i, struct qstr *new_d_name);
-
-#define init_name_hash()		0
-static inline unsigned long partial_name_hash(unsigned long c, unsigned long prevhash)
-{
-	prevhash = (prevhash << 4) | (prevhash >> (8*sizeof(unsigned long)-4));
-	return prevhash ^ c;
-}
-
-static inline unsigned long end_name_hash(unsigned long hash)
-{
-	if (sizeof(hash) > sizeof(unsigned int))
-		hash += hash >> 4*sizeof(hash);
-	return (unsigned int) hash;
-}
-
-static inline unsigned int full_name_hash(const unsigned char * name, unsigned int len) {
-
-	unsigned long hash = init_name_hash();
-	while (len--)
-		hash = partial_name_hash(*name++, hash);
-	return end_name_hash(hash);
-}
-
-#endif /* __LINUX_JFFS2PORT_H__ */
-
-
-
-
-
-
-
-
-
-