* the VFS.
*
* Special notes:
- * >> 2.4: sb->u.generic_sbp points to the yaffs_dev_t associated with
+ * >> 2.4: sb->u.generic_sbp points to the struct yaffs_dev associated with
* this superblock
- * >> 2.6: sb->s_fs_info points to the yaffs_dev_t associated with this
+ * >> 2.6: sb->s_fs_info points to the struct yaffs_dev associated with this
* superblock
- * >> inode->u.generic_ip points to the associated yaffs_obj_t.
+ * >> inode->u.generic_ip points to the associated struct yaffs_obj.
*/
/*
#define yaffs_inode_to_obj_lv(iptr) ((iptr)->u.generic_ip)
#endif
-#define yaffs_inode_to_obj(iptr) ((yaffs_obj_t *)(yaffs_inode_to_obj_lv(iptr)))
+#define yaffs_inode_to_obj(iptr) ((struct yaffs_obj *)(yaffs_inode_to_obj_lv(iptr)))
#define yaffs_dentry_to_obj(dptr) yaffs_inode_to_obj((dptr)->d_inode)
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
-#define yaffs_super_to_dev(sb) ((yaffs_dev_t *)sb->s_fs_info)
+#define yaffs_super_to_dev(sb) ((struct yaffs_dev *)sb->s_fs_info)
#else
-#define yaffs_super_to_dev(sb) ((yaffs_dev_t *)sb->u.generic_sbp)
+#define yaffs_super_to_dev(sb) ((struct yaffs_dev *)sb->u.generic_sbp)
#endif
static int yaffs_follow_link(struct dentry *dentry, struct nameidata *nd);
#endif
-static void yaffs_touch_super(yaffs_dev_t *dev);
+static void yaffs_touch_super(struct yaffs_dev *dev);
static loff_t yaffs_dir_llseek(struct file *file, loff_t offset, int origin);
}
-static unsigned yaffs_gc_control_callback(yaffs_dev_t *dev)
+static unsigned yaffs_gc_control_callback(struct yaffs_dev *dev)
{
return yaffs_gc_control;
}
-static void yaffs_gross_lock(yaffs_dev_t *dev)
+static void yaffs_gross_lock(struct yaffs_dev *dev)
{
T(YAFFS_TRACE_LOCK, (TSTR("yaffs locking %p\n"), current));
down(&(yaffs_dev_to_lc(dev)->gross_lock));
T(YAFFS_TRACE_LOCK, (TSTR("yaffs locked %p\n"), current));
}
-static void yaffs_gross_unlock(yaffs_dev_t *dev)
+static void yaffs_gross_unlock(struct yaffs_dev *dev)
{
T(YAFFS_TRACE_LOCK, (TSTR("yaffs unlocking %p\n"), current));
up(&(yaffs_dev_to_lc(dev)->gross_lock));
struct dentry *parent = ERR_PTR(-ENOENT);
struct inode *inode;
unsigned long parent_ino;
- yaffs_obj_t *d_obj;
- yaffs_obj_t *parent_obj;
+ struct yaffs_obj *d_obj;
+ struct yaffs_obj *parent_obj;
d_obj = yaffs_inode_to_obj(dentry->d_inode);
* next object before the object is deleted.
*
* Many readdirs (and thus seach conexts) may be alive simulateously so
- * each yaffs_dev_t has a list of these.
+ * each struct yaffs_dev has a list of these.
*
* A seach context lives for the duration of a readdir.
*
*/
struct yaffs_search_context {
- yaffs_dev_t *dev;
- yaffs_obj_t *dir_obj;
- yaffs_obj_t *next_return;
- struct ylist_head others;
+ struct yaffs_dev *dev;
+ struct yaffs_obj *dir_obj;
+ struct yaffs_obj *next_return;
+ struct list_head others;
};
/*
*
* Called at start of readdir.
*/
-static struct yaffs_search_context * yaffs_new_search(yaffs_obj_t *dir)
+static struct yaffs_search_context * yaffs_new_search(struct yaffs_obj *dir)
{
- yaffs_dev_t *dev = dir->my_dev;
+ struct yaffs_dev *dev = dir->my_dev;
struct yaffs_search_context *sc = YMALLOC(sizeof(struct yaffs_search_context));
if(sc){
sc->dir_obj = dir;
sc->dev = dev;
- if( ylist_empty(&sc->dir_obj->variant.dir_variant.children))
+ if( list_empty(&sc->dir_obj->variant.dir_variant.children))
sc->next_return = NULL;
else
- sc->next_return = ylist_entry(
+ sc->next_return = list_entry(
dir->variant.dir_variant.children.next,
- yaffs_obj_t,siblings);
- YINIT_LIST_HEAD(&sc->others);
- ylist_add(&sc->others,&(yaffs_dev_to_lc(dev)->search_contexts));
+ struct yaffs_obj,siblings);
+ INIT_LIST_HEAD(&sc->others);
+ list_add(&sc->others,&(yaffs_dev_to_lc(dev)->search_contexts));
}
return sc;
}
static void yaffs_search_end(struct yaffs_search_context * sc)
{
if(sc){
- ylist_del(&sc->others);
+ list_del(&sc->others);
YFREE(sc);
}
}
return;
if( sc->next_return == NULL ||
- ylist_empty(&sc->dir_obj->variant.dir_variant.children))
+ list_empty(&sc->dir_obj->variant.dir_variant.children))
sc->next_return = NULL;
else {
- struct ylist_head *next = sc->next_return->siblings.next;
+ struct list_head *next = sc->next_return->siblings.next;
if( next == &sc->dir_obj->variant.dir_variant.children)
sc->next_return = NULL; /* end of list */
else
- sc->next_return = ylist_entry(next,yaffs_obj_t,siblings);
+ sc->next_return = list_entry(next,struct yaffs_obj,siblings);
}
}
* We check open search contexts and advance any which are currently
* on the object being iterated.
*/
-static void yaffs_remove_obj_callback(yaffs_obj_t *obj)
+static void yaffs_remove_obj_callback(struct yaffs_obj *obj)
{
- struct ylist_head *i;
+ struct list_head *i;
struct yaffs_search_context *sc;
- struct ylist_head *search_contexts = &(yaffs_dev_to_lc(obj->my_dev)->search_contexts);
+ struct list_head *search_contexts = &(yaffs_dev_to_lc(obj->my_dev)->search_contexts);
/* Iterate through the directory search contexts.
* If any are currently on the object being removed, then advance
* the search context to the next object to prevent a hanging pointer.
*/
- ylist_for_each(i, search_contexts) {
+ list_for_each(i, search_contexts) {
if (i) {
- sc = ylist_entry(i, struct yaffs_search_context,others);
+ sc = list_entry(i, struct yaffs_search_context,others);
if(sc->next_return == obj)
yaffs_search_advance(sc);
}
unsigned char *alias;
int ret;
- yaffs_dev_t *dev = yaffs_dentry_to_obj(dentry)->my_dev;
+ struct yaffs_dev *dev = yaffs_dentry_to_obj(dentry)->my_dev;
yaffs_gross_lock(dev);
#if (YAFFS_NEW_FOLLOW_LINK == 1)
static void *yaffs_follow_link(struct dentry *dentry, struct nameidata *nd)
+{
+ void *ret;
#else
static int yaffs_follow_link(struct dentry *dentry, struct nameidata *nd)
-#endif
{
+ int ret
+#endif
unsigned char *alias;
- int ret;
- yaffs_dev_t *dev = yaffs_dentry_to_obj(dentry)->my_dev;
+ int ret_int = 0;
+ struct yaffs_dev *dev = yaffs_dentry_to_obj(dentry)->my_dev;
yaffs_gross_lock(dev);
yaffs_gross_unlock(dev);
if (!alias) {
- ret = -ENOMEM;
+ ret_int = -ENOMEM;
goto out;
}
#if (YAFFS_NEW_FOLLOW_LINK == 1)
nd_set_link(nd, alias);
- ret = (int)alias;
+ ret = alias;
out:
- return ERR_PTR(ret);
+ if(ret_int)
+ ret = ERR_PTR(ret_int);
+ return ret;
#else
ret = vfs_follow_link(nd, alias);
kfree(alias);
out:
+ if(ret_int)
+ ret = ret_int;
return ret;
#endif
}
#endif
struct inode *yaffs_get_inode(struct super_block *sb, int mode, int dev,
- yaffs_obj_t *obj);
+ struct yaffs_obj *obj);
/*
* Lookup is used to find objects in the fs
static struct dentry *yaffs_lookup(struct inode *dir, struct dentry *dentry)
#endif
{
- yaffs_obj_t *obj;
+ struct yaffs_obj *obj;
struct inode *inode = NULL; /* NCB 2.5/2.6 needs NULL here */
- yaffs_dev_t *dev = yaffs_inode_to_obj(dir)->my_dev;
+ struct yaffs_dev *dev = yaffs_inode_to_obj(dir)->my_dev;
if(current != yaffs_dev_to_lc(dev)->readdir_process)
yaffs_gross_lock(dev);
#endif
-static void yaffs_unstitch_obj(struct inode *inode, yaffs_obj_t *obj)
+static void yaffs_unstitch_obj(struct inode *inode, struct yaffs_obj *obj)
{
/* Clear the association between the inode and
- * the yaffs_obj_t.
+ * the struct yaffs_obj.
*/
obj->my_inode = NULL;
yaffs_inode_to_obj_lv(inode) = NULL;
*/
static void yaffs_evict_inode( struct inode *inode)
{
- yaffs_obj_t *obj;
- yaffs_dev_t *dev;
+ struct yaffs_obj *obj;
+ struct yaffs_dev *dev;
int deleteme = 0;
obj = yaffs_inode_to_obj(inode);
static void yaffs_clear_inode(struct inode *inode)
{
- yaffs_obj_t *obj;
- yaffs_dev_t *dev;
+ struct yaffs_obj *obj;
+ struct yaffs_dev *dev;
obj = yaffs_inode_to_obj(inode);
*/
static void yaffs_delete_inode(struct inode *inode)
{
- yaffs_obj_t *obj = yaffs_inode_to_obj(inode);
- yaffs_dev_t *dev;
+ struct yaffs_obj *obj = yaffs_inode_to_obj(inode);
+ struct yaffs_dev *dev;
T(YAFFS_TRACE_OS,
(TSTR("yaffs_delete_inode: ino %d, count %d %s\n"), (int)inode->i_ino,
static int yaffs_file_flush(struct file *file)
#endif
{
- yaffs_obj_t *obj = yaffs_dentry_to_obj(file->f_dentry);
+ struct yaffs_obj *obj = yaffs_dentry_to_obj(file->f_dentry);
- yaffs_dev_t *dev = obj->my_dev;
+ struct yaffs_dev *dev = obj->my_dev;
T(YAFFS_TRACE_OS,
(TSTR("yaffs_file_flush object %d (%s)\n"), obj->obj_id,
{
/* Lifted from jffs2 */
- yaffs_obj_t *obj;
+ struct yaffs_obj *obj;
unsigned char *pg_buf;
int ret;
- yaffs_dev_t *dev;
+ struct yaffs_dev *dev;
T(YAFFS_TRACE_OS,
(TSTR("yaffs_readpage_nolock at %08x, size %08x\n"),
static int yaffs_writepage(struct page *page)
#endif
{
- yaffs_dev_t *dev;
+ struct yaffs_dev *dev;
struct address_space *mapping = page->mapping;
struct inode *inode;
unsigned long end_index;
char *buffer;
- yaffs_obj_t *obj;
+ struct yaffs_obj *obj;
int n_written = 0;
unsigned n_bytes;
loff_t i_size;
#endif
-static void yaffs_fill_inode_from_obj(struct inode *inode, yaffs_obj_t *obj)
+static void yaffs_fill_inode_from_obj(struct inode *inode, struct yaffs_obj *obj)
{
if (inode && obj) {
/* Check mode against the variant type and attempt to repair if broken. */
- __u32 mode = obj->yst_mode;
+ u32 mode = obj->yst_mode;
switch (obj->variant_type) {
case YAFFS_OBJECT_TYPE_FILE:
if (!S_ISREG(mode)) {
}
struct inode *yaffs_get_inode(struct super_block *sb, int mode, int dev,
- yaffs_obj_t *obj)
+ struct yaffs_obj *obj)
{
struct inode *inode;
static ssize_t yaffs_file_write(struct file *f, const char *buf, size_t n,
loff_t *pos)
{
- yaffs_obj_t *obj;
+ struct yaffs_obj *obj;
int n_written, ipos;
struct inode *inode;
- yaffs_dev_t *dev;
+ struct yaffs_dev *dev;
obj = yaffs_dentry_to_obj(f->f_dentry);
static ssize_t yaffs_hold_space(struct file *f)
{
- yaffs_obj_t *obj;
- yaffs_dev_t *dev;
+ struct yaffs_obj *obj;
+ struct yaffs_dev *dev;
int n_free_chunks;
static void yaffs_release_space(struct file *f)
{
- yaffs_obj_t *obj;
- yaffs_dev_t *dev;
+ struct yaffs_obj *obj;
+ struct yaffs_dev *dev;
obj = yaffs_dentry_to_obj(f->f_dentry);
static int yaffs_readdir(struct file *f, void *dirent, filldir_t filldir)
{
- yaffs_obj_t *obj;
- yaffs_dev_t *dev;
+ struct yaffs_obj *obj;
+ struct yaffs_dev *dev;
struct yaffs_search_context *sc;
struct inode *inode = f->f_dentry->d_inode;
unsigned long offset, curoffs;
- yaffs_obj_t *l;
+ struct yaffs_obj *l;
int ret_val = 0;
char name[YAFFS_MAX_NAME_LENGTH + 1];
{
struct inode *inode;
- yaffs_obj_t *obj = NULL;
- yaffs_dev_t *dev;
+ struct yaffs_obj *obj = NULL;
+ struct yaffs_dev *dev;
- yaffs_obj_t *parent = yaffs_inode_to_obj(dir);
+ struct yaffs_obj *parent = yaffs_inode_to_obj(dir);
int error = -ENOSPC;
uid_t uid = YCRED(current)->fsuid;
{
int ret_val;
- yaffs_dev_t *dev;
- yaffs_obj_t *obj;
+ struct yaffs_dev *dev;
+ struct yaffs_obj *obj;
T(YAFFS_TRACE_OS,
(TSTR("yaffs_unlink %d:%s\n"),
struct dentry *dentry)
{
struct inode *inode = old_dentry->d_inode;
- yaffs_obj_t *obj = NULL;
- yaffs_obj_t *link = NULL;
- yaffs_dev_t *dev;
+ struct yaffs_obj *obj = NULL;
+ struct yaffs_obj *link = NULL;
+ struct yaffs_dev *dev;
T(YAFFS_TRACE_OS, (TSTR("yaffs_link\n")));
static int yaffs_symlink(struct inode *dir, struct dentry *dentry,
const char *symname)
{
- yaffs_obj_t *obj;
- yaffs_dev_t *dev;
+ struct yaffs_obj *obj;
+ struct yaffs_dev *dev;
uid_t uid = YCRED(current)->fsuid;
gid_t gid = (dir->i_mode & S_ISGID) ? dir->i_gid : YCRED(current)->fsgid;
#endif
{
- yaffs_obj_t *obj;
- yaffs_dev_t *dev;
+ struct yaffs_obj *obj;
+ struct yaffs_dev *dev;
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 34))
struct dentry *dentry = file->f_path.dentry;
#endif
static int yaffs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct inode *new_dir, struct dentry *new_dentry)
{
- yaffs_dev_t *dev;
+ struct yaffs_dev *dev;
int ret_val = YAFFS_FAIL;
- yaffs_obj_t *target;
+ struct yaffs_obj *target;
T(YAFFS_TRACE_OS, (TSTR("yaffs_rename\n")));
dev = yaffs_inode_to_obj(old_dir)->my_dev;
if (target && target->variant_type == YAFFS_OBJECT_TYPE_DIRECTORY &&
- !ylist_empty(&target->variant.dir_variant.children)) {
+ !list_empty(&target->variant.dir_variant.children)) {
T(YAFFS_TRACE_OS, (TSTR("target is non-empty dir\n")));
{
struct inode *inode = dentry->d_inode;
int error = 0;
- yaffs_dev_t *dev;
+ struct yaffs_dev *dev;
T(YAFFS_TRACE_OS,
(TSTR("yaffs_setattr of object %d\n"),
{
struct inode *inode = dentry->d_inode;
int error = 0;
- yaffs_dev_t *dev;
- yaffs_obj_t *obj = yaffs_inode_to_obj(inode);
+ struct yaffs_dev *dev;
+ struct yaffs_obj *obj = yaffs_inode_to_obj(inode);
T(YAFFS_TRACE_OS,
(TSTR("yaffs_setxattr of object %d\n"),
{
struct inode *inode = dentry->d_inode;
int error = 0;
- yaffs_dev_t *dev;
- yaffs_obj_t *obj = yaffs_inode_to_obj(inode);
+ struct yaffs_dev *dev;
+ struct yaffs_obj *obj = yaffs_inode_to_obj(inode);
T(YAFFS_TRACE_OS,
(TSTR("yaffs_getxattr \"%s\" from object %d\n"),
{
struct inode *inode = dentry->d_inode;
int error = 0;
- yaffs_dev_t *dev;
- yaffs_obj_t *obj = yaffs_inode_to_obj(inode);
+ struct yaffs_dev *dev;
+ struct yaffs_obj *obj = yaffs_inode_to_obj(inode);
T(YAFFS_TRACE_OS,
(TSTR("yaffs_removexattr of object %d\n"),
{
struct inode *inode = dentry->d_inode;
int error = 0;
- yaffs_dev_t *dev;
- yaffs_obj_t *obj = yaffs_inode_to_obj(inode);
+ struct yaffs_dev *dev;
+ struct yaffs_obj *obj = yaffs_inode_to_obj(inode);
T(YAFFS_TRACE_OS,
(TSTR("yaffs_listxattr of object %d\n"),
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
static int yaffs_statfs(struct dentry *dentry, struct kstatfs *buf)
{
- yaffs_dev_t *dev = yaffs_dentry_to_obj(dentry)->my_dev;
+ struct yaffs_dev *dev = yaffs_dentry_to_obj(dentry)->my_dev;
struct super_block *sb = dentry->d_sb;
#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
static int yaffs_statfs(struct super_block *sb, struct kstatfs *buf)
{
- yaffs_dev_t *dev = yaffs_super_to_dev(sb);
+ struct yaffs_dev *dev = yaffs_super_to_dev(sb);
#else
static int yaffs_statfs(struct super_block *sb, struct statfs *buf)
{
- yaffs_dev_t *dev = yaffs_super_to_dev(sb);
+ struct yaffs_dev *dev = yaffs_super_to_dev(sb);
#endif
T(YAFFS_TRACE_OS, (TSTR("yaffs_statfs\n")));
static void yaffs_flush_inodes(struct super_block *sb)
{
struct inode *iptr;
- yaffs_obj_t *obj;
+ struct yaffs_obj *obj;
list_for_each_entry(iptr,&sb->s_inodes, i_sb_list){
obj = yaffs_inode_to_obj(iptr);
static void yaffs_flush_super(struct super_block *sb, int do_checkpoint)
{
- yaffs_dev_t *dev = yaffs_super_to_dev(sb);
+ struct yaffs_dev *dev = yaffs_super_to_dev(sb);
if(!dev)
return;
}
-static unsigned yaffs_bg_gc_urgency(yaffs_dev_t *dev)
+static unsigned yaffs_bg_gc_urgency(struct yaffs_dev *dev)
{
unsigned erased_chunks = dev->n_erased_blocks * dev->param.chunks_per_block;
struct yaffs_linux_context *context = yaffs_dev_to_lc(dev);
int request_checkpoint)
{
- yaffs_dev_t *dev = yaffs_super_to_dev(sb);
+ struct yaffs_dev *dev = yaffs_super_to_dev(sb);
unsigned int oneshot_checkpoint = (yaffs_auto_checkpoint & 4);
unsigned gc_urgent = yaffs_bg_gc_urgency(dev);
int do_checkpoint;
static int yaffs_bg_thread_fn(void *data)
{
- yaffs_dev_t *dev = (yaffs_dev_t *)data;
+ struct yaffs_dev *dev = (struct yaffs_dev *)data;
struct yaffs_linux_context *context = yaffs_dev_to_lc(dev);
unsigned long now = jiffies;
unsigned long next_dir_update = now;
return 0;
}
-static int yaffs_bg_start(yaffs_dev_t *dev)
+static int yaffs_bg_start(struct yaffs_dev *dev)
{
int retval = 0;
struct yaffs_linux_context *context = yaffs_dev_to_lc(dev);
return retval;
}
-static void yaffs_bg_stop(yaffs_dev_t *dev)
+static void yaffs_bg_stop(struct yaffs_dev *dev)
{
struct yaffs_linux_context *ctxt = yaffs_dev_to_lc(dev);
return 0;
}
-static int yaffs_bg_start(yaffs_dev_t *dev)
+static int yaffs_bg_start(struct yaffs_dev *dev)
{
return 0;
}
-static void yaffs_bg_stop(yaffs_dev_t *dev)
+static void yaffs_bg_stop(struct yaffs_dev *dev)
{
}
#endif
static struct inode *yaffs_iget(struct super_block *sb, unsigned long ino)
{
struct inode *inode;
- yaffs_obj_t *obj;
- yaffs_dev_t *dev = yaffs_super_to_dev(sb);
+ struct yaffs_obj *obj;
+ struct yaffs_dev *dev = yaffs_super_to_dev(sb);
T(YAFFS_TRACE_OS,
(TSTR("yaffs_iget for %lu\n"), ino));
* need to lock again.
*/
- yaffs_obj_t *obj;
- yaffs_dev_t *dev = yaffs_super_to_dev(inode->i_sb);
+ struct yaffs_obj *obj;
+ struct yaffs_dev *dev = yaffs_super_to_dev(inode->i_sb);
T(YAFFS_TRACE_OS,
(TSTR("yaffs_read_inode for %d\n"), (int)inode->i_ino));
#endif
-static YLIST_HEAD(yaffs_context_list);
+static LIST_HEAD(yaffs_context_list);
struct semaphore yaffs_context_lock;
static void yaffs_put_super(struct super_block *sb)
{
- yaffs_dev_t *dev = yaffs_super_to_dev(sb);
+ struct yaffs_dev *dev = yaffs_super_to_dev(sb);
T(YAFFS_TRACE_OS, (TSTR("yaffs_put_super\n")));
yaffs_gross_unlock(dev);
down(&yaffs_context_lock);
- ylist_del_init(&(yaffs_dev_to_lc(dev)->context_list));
+ list_del_init(&(yaffs_dev_to_lc(dev)->context_list));
up(&yaffs_context_lock);
if (yaffs_dev_to_lc(dev)->spare_buffer) {
}
-static void yaffs_touch_super(yaffs_dev_t *dev)
+static void yaffs_touch_super(struct yaffs_dev *dev)
{
struct super_block *sb = yaffs_dev_to_lc(dev)->super;
sb->s_dirt = 1;
}
-typedef struct {
+struct yaffs_options {
int inband_tags;
int skip_checkpoint_read;
int skip_checkpoint_write;
int lazy_loading_overridden;
int empty_lost_and_found;
int empty_lost_and_found_overridden;
-} yaffs_options;
+} ;
#define MAX_OPT_LEN 30
-static int yaffs_parse_options(yaffs_options *options, const char *options_str)
+static int yaffs_parse_options(struct yaffs_options *options, const char *options_str)
{
char cur_opt[MAX_OPT_LEN + 1];
int p;
int n_blocks;
struct inode *inode = NULL;
struct dentry *root;
- yaffs_dev_t *dev = 0;
+ struct yaffs_dev *dev = 0;
char devname_buf[BDEVNAME_SIZE + 1];
struct mtd_info *mtd;
int err;
char *data_str = (char *)data;
struct yaffs_linux_context *context = NULL;
- yaffs_param_t *param;
+ struct yaffs_param *param;
int read_only = 0;
- yaffs_options options;
+ struct yaffs_options options;
unsigned mount_id;
int found;
struct yaffs_linux_context *context_iterator;
- struct ylist_head *l;
+ struct list_head *l;
sb->s_magic = YAFFS_MAGIC;
sb->s_op = &yaffs_super_ops;
/* OK, so if we got here, we have an MTD that's NAND and looks
* like it has the right capabilities
- * Set the yaffs_dev_t up for mtd
+ * Set the struct yaffs_dev up for mtd
*/
if (!read_only && !(mtd->flags & MTD_WRITEABLE)){
sb->s_flags |= MS_RDONLY;
}
- dev = kmalloc(sizeof(yaffs_dev_t), GFP_KERNEL);
+ dev = kmalloc(sizeof(struct yaffs_dev), GFP_KERNEL);
context = kmalloc(sizeof(struct yaffs_linux_context),GFP_KERNEL);
if(!dev || !context ){
/* Deep shit could not allocate device structure */
T(YAFFS_TRACE_ALWAYS,
(TSTR("yaffs_read_super: Failed trying to allocate "
- "yaffs_dev_t. \n")));
+ "struct yaffs_dev. \n")));
return NULL;
}
- memset(dev, 0, sizeof(yaffs_dev_t));
+ memset(dev, 0, sizeof(struct yaffs_dev));
param = &(dev->param);
memset(context,0,sizeof(struct yaffs_linux_context));
dev->os_context = context;
- YINIT_LIST_HEAD(&(context->context_list));
+ INIT_LIST_HEAD(&(context->context_list));
context->dev = dev;
context->super = sb;
found = 0;
for(mount_id=0; ! found; mount_id++){
found = 1;
- ylist_for_each(l,&yaffs_context_list){
- context_iterator = ylist_entry(l,struct yaffs_linux_context,context_list);
+ list_for_each(l,&yaffs_context_list){
+ context_iterator = list_entry(l,struct yaffs_linux_context,context_list);
if(context_iterator->mount_id == mount_id)
found = 0;
}
}
context->mount_id = mount_id;
- ylist_add_tail(&(yaffs_dev_to_lc(dev)->context_list), &yaffs_context_list);
+ list_add_tail(&(yaffs_dev_to_lc(dev)->context_list), &yaffs_context_list);
up(&yaffs_context_lock);
/* Directory search handling...*/
- YINIT_LIST_HEAD(&(yaffs_dev_to_lc(dev)->search_contexts));
+ INIT_LIST_HEAD(&(yaffs_dev_to_lc(dev)->search_contexts));
param->remove_obj_fn = yaffs_remove_obj_callback;
init_MUTEX(&(yaffs_dev_to_lc(dev)->gross_lock));
static struct proc_dir_entry *my_proc_entry;
static struct proc_dir_entry *debug_proc_entry;
-static char *yaffs_dump_dev_part0(char *buf, yaffs_dev_t * dev)
+static char *yaffs_dump_dev_part0(char *buf, struct yaffs_dev * dev)
{
buf += sprintf(buf, "start_block.......... %d\n", dev->param.start_block);
buf += sprintf(buf, "end_block............ %d\n", dev->param.end_block);
}
-static char *yaffs_dump_dev_part1(char *buf, yaffs_dev_t * dev)
+static char *yaffs_dump_dev_part1(char *buf, struct yaffs_dev * dev)
{
buf += sprintf(buf, "data_bytes_per_chunk. %d\n", dev->data_bytes_per_chunk);
buf += sprintf(buf, "chunk_grp_bits....... %d\n", dev->chunk_grp_bits);
char **start,
off_t offset, int count, int *eof, void *data)
{
- struct ylist_head *item;
+ struct list_head *item;
char *buf = page;
int step = offset;
int n = 0;
down(&yaffs_context_lock);
/* Locate and print the Nth entry. Order N-squared but N is small. */
- ylist_for_each(item, &yaffs_context_list) {
- struct yaffs_linux_context *dc = ylist_entry(item, struct yaffs_linux_context, context_list);
- yaffs_dev_t *dev = dc->dev;
+ list_for_each(item, &yaffs_context_list) {
+ struct yaffs_linux_context *dc = list_entry(item, struct yaffs_linux_context, context_list);
+ struct yaffs_dev *dev = dc->dev;
if (n < (step & ~1)) {
n+=2;
char **start,
off_t offset, int count, int *eof, void *data)
{
- struct ylist_head *item;
+ struct list_head *item;
char *buf = page;
int n = 0;
down(&yaffs_context_lock);
/* Locate and print the Nth entry. Order N-squared but N is small. */
- ylist_for_each(item, &yaffs_context_list) {
- struct yaffs_linux_context *dc = ylist_entry(item, struct yaffs_linux_context, context_list);
- yaffs_dev_t *dev = dc->dev;
+ list_for_each(item, &yaffs_context_list) {
+ struct yaffs_linux_context *dc = list_entry(item, struct yaffs_linux_context, context_list);
+ struct yaffs_dev *dev = dc->dev;
int erased_chunks;