yaffs direct: Move yaffs error string function to diferent directory
[yaffs2.git] / yaffs_vfs_multi.c
index 1d9ca00717a5ae7ecd0b69afcab24ce041c48d48..8aa3fd4c2b55d6a0e7a935869426e6824ed40498 100644 (file)
@@ -307,12 +307,12 @@ static int yaffs_writepage(struct page *page);
 #endif
 
 #ifdef CONFIG_YAFFS_XATTR
-int yaffs_setxattr(struct dentry *dentry, const char *name,
+static int yaffs_setxattr(struct dentry *dentry, const char *name,
                   const void *value, size_t size, int flags);
-ssize_t yaffs_getxattr(struct dentry *dentry, const char *name, void *buff,
+static ssize_t yaffs_getxattr(struct dentry *dentry, const char *name, void *buff,
                       size_t size);
-int yaffs_removexattr(struct dentry *dentry, const char *name);
-ssize_t yaffs_listxattr(struct dentry *dentry, char *buff, size_t size);
+static int yaffs_removexattr(struct dentry *dentry, const char *name);
+static ssize_t yaffs_listxattr(struct dentry *dentry, char *buff, size_t size);
 #endif
 
 #if (YAFFS_USE_WRITE_BEGIN_END != 0)
@@ -341,8 +341,6 @@ static int yaffs_follow_link(struct dentry *dentry, struct nameidata *nd);
 
 static void yaffs_touch_super(struct yaffs_dev *dev);
 
-static loff_t yaffs_dir_llseek(struct file *file, loff_t offset, int origin);
-
 static int yaffs_vfs_setattr(struct inode *, struct iattr *);
 
 static struct address_space_operations yaffs_file_address_operations = {
@@ -456,7 +454,7 @@ static const struct file_operations yaffs_dir_operations = {
        .read = generic_read_dir,
        .readdir = yaffs_readdir,
        .fsync = yaffs_sync_object,
-       .llseek = yaffs_dir_llseek,
+       .llseek = generic_file_llseek,
 };
 
 static const struct super_operations yaffs_super_ops = {
@@ -1529,31 +1527,6 @@ static void yaffs_release_space(struct file *f)
        yaffs_gross_unlock(dev);
 }
 
-static loff_t yaffs_dir_llseek(struct file *file, loff_t offset, int origin)
-{
-       long long retval;
-
-       lock_kernel();
-
-       switch (origin) {
-       case 2:
-               offset += i_size_read(file->f_path.dentry->d_inode);
-               break;
-       case 1:
-               offset += file->f_pos;
-       }
-       retval = -EINVAL;
-
-       if (offset >= 0) {
-               if (offset != file->f_pos)
-                       file->f_pos = offset;
-
-               retval = offset;
-       }
-       unlock_kernel();
-       return retval;
-}
-
 static int yaffs_readdir(struct file *f, void *dirent, filldir_t filldir)
 {
        struct yaffs_obj *obj;
@@ -2012,7 +1985,7 @@ static int yaffs_setattr(struct dentry *dentry, struct iattr *attr)
 }
 
 #ifdef CONFIG_YAFFS_XATTR
-int yaffs_setxattr(struct dentry *dentry, const char *name,
+static int yaffs_setxattr(struct dentry *dentry, const char *name,
                   const void *value, size_t size, int flags)
 {
        struct inode *inode = dentry->d_inode;
@@ -2039,7 +2012,7 @@ int yaffs_setxattr(struct dentry *dentry, const char *name,
        return error;
 }
 
-ssize_t yaffs_getxattr(struct dentry * dentry, const char *name, void *buff,
+static ssize_t yaffs_getxattr(struct dentry * dentry, const char *name, void *buff,
                       size_t size)
 {
        struct inode *inode = dentry->d_inode;
@@ -2062,7 +2035,7 @@ ssize_t yaffs_getxattr(struct dentry * dentry, const char *name, void *buff,
        return error;
 }
 
-int yaffs_removexattr(struct dentry *dentry, const char *name)
+static int yaffs_removexattr(struct dentry *dentry, const char *name)
 {
        struct inode *inode = dentry->d_inode;
        int error = 0;
@@ -2090,7 +2063,7 @@ int yaffs_removexattr(struct dentry *dentry, const char *name)
        return error;
 }
 
-ssize_t yaffs_listxattr(struct dentry * dentry, char *buff, size_t size)
+static ssize_t yaffs_listxattr(struct dentry * dentry, char *buff, size_t size)
 {
        struct inode *inode = dentry->d_inode;
        int error = 0;
@@ -3138,7 +3111,6 @@ static DECLARE_FSTYPE(yaffs2_fs_type, "yaffs2", yaffs2_read_super,
 #endif /* CONFIG_YAFFS_YAFFS2 */
 
 static struct proc_dir_entry *my_proc_entry;
-static struct proc_dir_entry *debug_proc_entry;
 
 static char *yaffs_dump_dev_part0(char *buf, struct yaffs_dev *dev)
 {
@@ -3282,37 +3254,6 @@ static int yaffs_proc_read(char *page,
        return buf - page < count ? buf - page : count;
 }
 
-static int yaffs_stats_proc_read(char *page,
-                                char **start,
-                                off_t offset, int count, int *eof, void *data)
-{
-       struct list_head *item;
-       char *buf = page;
-       int n = 0;
-
-       mutex_lock(&yaffs_context_lock);
-
-       /* Locate and print the Nth entry.  Order N-squared but N is small. */
-       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;
-
-               erased_chunks =
-                   dev->n_erased_blocks * dev->param.chunks_per_block;
-
-               buf += sprintf(buf, "%d, %d, %d, %u, %u, %u, %u\n",
-                              n, dev->n_free_chunks, erased_chunks,
-                              dev->bg_gcs, dev->oldest_dirty_gc_count,
-                              dev->n_obj, dev->n_tnodes);
-       }
-       mutex_unlock(&yaffs_context_lock);
-
-       return buf - page < count ? buf - page : count;
-}
-
 /**
  * Set the verbosity of the warnings and error messages.
  *
@@ -3497,17 +3438,6 @@ static int __init init_yaffs_fs(void)
                return -ENOMEM;
         }
 
-       debug_proc_entry = create_proc_entry("yaffs_stats",
-                                            S_IRUGO | S_IFREG, YPROC_ROOT);
-
-       if (debug_proc_entry) {
-               debug_proc_entry->write_proc = NULL;
-               debug_proc_entry->read_proc = yaffs_stats_proc_read;
-               debug_proc_entry->data = NULL;
-       } else {
-               return -ENOMEM;
-        }
-
        /* Now add the file system entries */
 
        fsinst = fs_to_install;
@@ -3544,7 +3474,6 @@ static void __exit exit_yaffs_fs(void)
          (TSTR("yaffs built " __DATE__ " " __TIME__ " removing. \n")));
 
        remove_proc_entry("yaffs", YPROC_ROOT);
-       remove_proc_entry("yaffs_stats", YPROC_ROOT);
 
        fsinst = fs_to_install;