if (len) {
invalidate_inode_pages(inode->i_mapping);
}
- inode->i_ctime = CURRENT_TIME;
+ inode->i_ctime = CURRENT_TIME_SEC;
inode->i_mtime = inode->i_ctime;
}
if (update_all || iattr->ia_valid & ATTR_ATIME) {
} /* jffs_notify_change() */
-struct inode *
+static struct inode *
jffs_new_inode(const struct inode * dir, struct jffs_raw_inode *raw_inode,
int * err)
{
}
/* Get statistics of the file system. */
-int
+static int
jffs_statfs(struct super_block *sb, struct kstatfs *buf)
{
struct jffs_control *c = (struct jffs_control *) sb->s_fs_info;
/* Rename a file. */
-int
+static int
jffs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct inode *new_dir, struct dentry *new_dentry)
{
/* This is a kind of update of the inode we're about to make
here. This is what they do in ext2fs. Kind of. */
if ((inode = iget(new_dir->i_sb, f->ino))) {
- inode->i_ctime = CURRENT_TIME;
+ inode->i_ctime = CURRENT_TIME_SEC;
mark_inode_dirty(inode);
iput(inode);
}
read_len = 0;
result = 0;
- offset = page->index << PAGE_CACHE_SHIFT;
+ offset = page_offset(page);
kmap(page);
buf = page_address(page);
from the in-memory file system structures. */
jffs_insert_node(c, del_f, &raw_inode, NULL, del_node);
- dir->i_ctime = dir->i_mtime = CURRENT_TIME;
+ dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC;
mark_inode_dirty(dir);
inode->i_nlink--;
inode->i_ctime = dir->i_ctime;
* This will never trigger with sane page sizes. leave it in
* anyway, since I'm thinking about how to merge larger writes
* (the current idea is to poke a thread that does the actual
- * I/O and starts by doing a down(&inode->i_sem). then we
+ * I/O and starts by doing a mutex_lock(&inode->i_mutex). then we
* would need to get the page cache pages and have a list of
* I/O requests and do write-merging here.
* -- prumpf
inode->i_size = pos;
inode->i_blocks = (inode->i_size + 511) >> 9;
}
- inode->i_ctime = inode->i_mtime = CURRENT_TIME;
+ inode->i_ctime = inode->i_mtime = CURRENT_TIME_SEC;
mark_inode_dirty(inode);
invalidate_inode_pages(inode->i_mapping);
{
void *addr = page_address(page) + from;
/* XXX: PAGE_CACHE_SHIFT or PAGE_SHIFT */
- loff_t pos = (page->index<<PAGE_CACHE_SHIFT) + from;
+ loff_t pos = page_offset(page) + from;
return jffs_file_write(filp, addr, to-from, &pos);
} /* jffs_commit_write() */
}
-extern int generic_file_open(struct inode *, struct file *) __attribute__((weak));
-extern loff_t generic_file_llseek(struct file *, loff_t, int) __attribute__((weak));
-
static struct file_operations jffs_file_operations =
{
.open = generic_file_open,
}
-void
+static void
jffs_delete_inode(struct inode *inode)
{
struct jffs_file *f;
D3(printk("jffs_delete_inode(): inode->i_ino == %lu\n",
inode->i_ino));
+ truncate_inode_pages(&inode->i_data, 0);
lock_kernel();
inode->i_size = 0;
inode->i_blocks = 0;
}
-void
+static void
jffs_write_super(struct super_block *sb)
{
struct jffs_control *c = (struct jffs_control *)sb->s_fs_info;