#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)
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 = {
.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 = {
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;
}
#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;
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;
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;
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;
next_gc = now + HZ / 10 + 1;
else
next_gc = now + HZ * 2;
- } else /*
+ } else {
+ /*
* gc not running so set to next_dir_update
* to cut down on wake ups
*/
next_gc = next_dir_update;
+ }
}
yaffs_gross_unlock(dev);
#if 1
options_str++;
}
- if (!strcmp(cur_opt, "inband-tags"))
+ if (!strcmp(cur_opt, "inband-tags")) {
options->inband_tags = 1;
- else if (!strcmp(cur_opt, "tags-ecc-off")) {
+ } else if (!strcmp(cur_opt, "tags-ecc-off")) {
options->tags_ecc_on = 0;
options->tags_ecc_overridden = 1;
} else if (!strcmp(cur_opt, "tags-ecc-on")) {
} else if (!strcmp(cur_opt, "empty-lost-and-found-on")) {
options->empty_lost_and_found = 1;
options->empty_lost_and_found_overridden = 1;
- } else if (!strcmp(cur_opt, "no-cache"))
+ } else if (!strcmp(cur_opt, "no-cache")) {
options->no_cache = 1;
- else if (!strcmp(cur_opt, "no-checkpoint-read"))
+ } else if (!strcmp(cur_opt, "no-checkpoint-read")) {
options->skip_checkpoint_read = 1;
- else if (!strcmp(cur_opt, "no-checkpoint-write"))
+ } else if (!strcmp(cur_opt, "no-checkpoint-write")) {
options->skip_checkpoint_write = 1;
- else if (!strcmp(cur_opt, "no-checkpoint")) {
+ } else if (!strcmp(cur_opt, "no-checkpoint")) {
options->skip_checkpoint_read = 1;
options->skip_checkpoint_write = 1;
} else {
#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)
{
sprintf(buf, "\nDevice %d \"%s\"\n", n,
dev->param.name);
buf = yaffs_dump_dev_part0(buf, dev);
- } else
+ } else {
buf = yaffs_dump_dev_part1(buf, dev);
+ }
break;
}
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.
*
char *mask_name;
unsigned mask_bitfield;
} mask_flags[] = {
- {
- "allocate", YAFFS_TRACE_ALLOCATE}, {
- "always", YAFFS_TRACE_ALWAYS}, {
- "background", YAFFS_TRACE_BACKGROUND}, {
- "bad_blocks", YAFFS_TRACE_BAD_BLOCKS}, {
- "buffers", YAFFS_TRACE_BUFFERS}, {
- "bug", YAFFS_TRACE_BUG}, {
- "checkpt", YAFFS_TRACE_CHECKPOINT}, {
- "deletion", YAFFS_TRACE_DELETION}, {
- "erase", YAFFS_TRACE_ERASE}, {
- "error", YAFFS_TRACE_ERROR}, {
- "gc_detail", YAFFS_TRACE_GC_DETAIL}, {
- "gc", YAFFS_TRACE_GC}, {
- "lock", YAFFS_TRACE_LOCK}, {
- "mtd", YAFFS_TRACE_MTD}, {
- "nandaccess", YAFFS_TRACE_NANDACCESS}, {
- "os", YAFFS_TRACE_OS}, {
- "scan_debug", YAFFS_TRACE_SCAN_DEBUG}, {
- "scan", YAFFS_TRACE_SCAN}, {
- "tracing", YAFFS_TRACE_TRACING}, {
- "sync", YAFFS_TRACE_SYNC}, {
- "write", YAFFS_TRACE_WRITE}, {
- "verify", YAFFS_TRACE_VERIFY}, {
- "verify_nand", YAFFS_TRACE_VERIFY_NAND}, {
- "verify_full", YAFFS_TRACE_VERIFY_FULL}, {
- "verify_all", YAFFS_TRACE_VERIFY_ALL}, {
- "all", 0xffffffff}, {
- "none", 0}, {
-NULL, 0},};
+ {"allocate", YAFFS_TRACE_ALLOCATE},
+ {"always", YAFFS_TRACE_ALWAYS},
+ {"background", YAFFS_TRACE_BACKGROUND},
+ {"bad_blocks", YAFFS_TRACE_BAD_BLOCKS},
+ {"buffers", YAFFS_TRACE_BUFFERS},
+ {"bug", YAFFS_TRACE_BUG},
+ {"checkpt", YAFFS_TRACE_CHECKPOINT},
+ {"deletion", YAFFS_TRACE_DELETION},
+ {"erase", YAFFS_TRACE_ERASE},
+ {"error", YAFFS_TRACE_ERROR},
+ {"gc_detail", YAFFS_TRACE_GC_DETAIL},
+ {"gc", YAFFS_TRACE_GC},
+ {"lock", YAFFS_TRACE_LOCK},
+ {"mtd", YAFFS_TRACE_MTD},
+ {"nandaccess", YAFFS_TRACE_NANDACCESS},
+ {"os", YAFFS_TRACE_OS},
+ {"scan_debug", YAFFS_TRACE_SCAN_DEBUG},
+ {"scan", YAFFS_TRACE_SCAN},
+ {"mount", YAFFS_TRACE_MOUNT},
+ {"tracing", YAFFS_TRACE_TRACING},
+ {"sync", YAFFS_TRACE_SYNC},
+ {"write", YAFFS_TRACE_WRITE},
+ {"verify", YAFFS_TRACE_VERIFY},
+ {"verify_nand", YAFFS_TRACE_VERIFY_NAND},
+ {"verify_full", YAFFS_TRACE_VERIFY_FULL},
+ {"verify_all", YAFFS_TRACE_VERIFY_ALL},
+ {"all", 0xffffffff},
+ {"none", 0},
+ {NULL, 0},
+};
#define MAX_MASK_NAME_LENGTH 40
static int yaffs_proc_write_trace_options(struct file *file, const char *buf,
my_proc_entry->write_proc = yaffs_proc_write;
my_proc_entry->read_proc = yaffs_proc_read;
my_proc_entry->data = NULL;
- } else
- 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
+ } else {
return -ENOMEM;
+ }
/* Now add the file system entries */
(TSTR("yaffs built " __DATE__ " " __TIME__ " removing. \n")));
remove_proc_entry("yaffs", YPROC_ROOT);
- remove_proc_entry("yaffs_stats", YPROC_ROOT);
fsinst = fs_to_install;