Commit 0d1267fe authored by Linus Torvalds's avatar Linus Torvalds

Import 2.1.45pre1

parent fe01eea7
......@@ -1125,8 +1125,7 @@ random_read(struct inode * inode, struct file * file, char * buf, unsigned long
* update the access time.
*/
if (inode && count != 0) {
inode->i_atime = CURRENT_TIME;
inode->i_dirt = 1;
UPDATE_ATIME(inode);
}
return (count ? count : retval);
......@@ -1182,7 +1181,7 @@ random_write(struct inode * inode, struct file * file,
}
if ((ret > 0) && inode) {
inode->i_mtime = CURRENT_TIME;
inode->i_dirt = 1;
mark_inode_dirty(inode);
}
return ret;
}
......
......@@ -74,7 +74,7 @@ void inode_setattr(struct inode * inode, struct iattr * attr)
if (!fsuser() && !in_group_p(inode->i_gid))
inode->i_mode &= ~S_ISGID;
}
inode->i_dirt = 1;
mark_inode_dirty(inode);
}
}
......
......@@ -274,5 +274,4 @@ static void autofs_read_inode(struct inode *inode)
static void autofs_write_inode(struct inode *inode)
{
inode->i_dirt = 0;
}
......@@ -136,9 +136,10 @@ static int autofs_root_lookup(struct inode *dir, struct qstr *str, struct inode
return -EACCES;
}
if ( !oz_mode && S_ISDIR(res->i_mode) && res->i_sb == dir->i_sb ) {
if ( !oz_mode && S_ISDIR(res->i_mode) && res->i_dentry->d_covers == res->i_dentry ) {
/* Not a mount point yet, call 1-800-DAEMON */
DPRINTK(("autofs: waiting on non-mountpoint dir, inode = %lu, pid = %u, pgrp = %u\n", res->i_ino, current->pid, current->pgrp));
iput(res);
res = NULL;
up(&dir->i_sem);
status = autofs_wait(sbi,str);
......
......@@ -214,7 +214,6 @@ do_aout_core_dump(long signr, struct pt_regs * regs)
/* Finally dump the task struct. Not be used by gdb, but could be useful */
set_fs(KERNEL_DS);
DUMP_WRITE(current,sizeof(*current));
inode->i_status |= ST_MODIFIED;
close_coredump:
if (file.f_op->release)
file.f_op->release(inode,&file);
......
......@@ -884,7 +884,6 @@ static int load_elf_library(int fd)
*/
static int dump_write(struct file *file, const void *addr, int nr)
{
file->f_inode->i_status |= ST_MODIFIED;
return file->f_op->write(file->f_inode, file, addr, nr) == nr;
}
......
......@@ -241,7 +241,6 @@ static void write_dquot(struct dquot *dquot)
if (filp->f_op->write(filp->f_inode, filp,
(char *)&dquot->dq_dqb, sizeof(struct dqblk)) == sizeof(struct dqblk))
dquot->dq_flags &= ~DQ_MOD;
/* inode->i_status |= ST_MODIFIED is willingly *not* done here */
up(&dquot->dq_mnt->mnt_sem);
set_fs(fs);
......
......@@ -212,9 +212,6 @@ static int ext2_readdir (struct inode * inode, struct file * filp,
offset = 0;
brelse (bh);
}
if (DO_UPDATE_ATIME(inode)) {
inode->i_atime = CURRENT_TIME;
inode->i_dirt = 1;
}
UPDATE_ATIME(inode);
return 0;
}
......@@ -122,7 +122,7 @@ static inline void remove_suid(struct inode *inode)
mode &= inode->i_mode;
if (mode && !suser()) {
inode->i_mode &= ~mode;
inode->i_dirt = 1;
mark_inode_dirty(inode);
}
}
......@@ -251,7 +251,7 @@ static long ext2_file_write (struct inode * inode, struct file * filp,
inode->u.ext2_i.i_osync--;
inode->i_ctime = inode->i_mtime = CURRENT_TIME;
filp->f_pos = pos;
inode->i_dirt = 1;
mark_inode_dirty(inode);
return written;
}
......
......@@ -216,7 +216,7 @@ void ext2_free_inode (struct inode * inode)
es->s_free_inodes_count =
cpu_to_le32(le32_to_cpu(es->s_free_inodes_count) + 1);
mark_buffer_dirty(sb->u.ext2_sb.s_sbh, 1);
inode->i_dirt = 0;
mark_inode_dirty(inode);
}
mark_buffer_dirty(bh, 1);
if (sb->s_flags & MS_SYNCHRONOUS) {
......@@ -240,7 +240,7 @@ static void inc_inode_version (struct inode * inode,
int mode)
{
inode->u.ext2_i.i_version++;
inode->i_dirt = 1;
mark_inode_dirty(inode);
return;
}
......@@ -416,7 +416,7 @@ struct inode * ext2_new_inode (const struct inode * dir, int mode, int * err)
mode |= S_ISGID;
} else
inode->i_gid = current->fsgid;
inode->i_dirt = 1;
mark_inode_dirty(inode);
inode->i_ino = j;
inode->i_blksize = PAGE_SIZE; /* This is the optimal IO size (for stat), not the fs block size */
inode->i_blocks = 0;
......
......@@ -38,7 +38,7 @@ void ext2_put_inode (struct inode * inode)
inode->i_ino == EXT2_ACL_DATA_INO)
return;
inode->u.ext2_i.i_dtime = CURRENT_TIME;
inode->i_dirt = 1;
mark_inode_dirty(inode);
ext2_update_inode(inode, IS_SYNC(inode));
inode->i_size = 0;
if (inode->i_blocks)
......@@ -248,7 +248,7 @@ static struct buffer_head * inode_getblk (struct inode * inode, int nr,
if (IS_SYNC(inode) || inode->u.ext2_i.i_osync)
ext2_sync_inode (inode);
else
inode->i_dirt = 1;
mark_inode_dirty(inode);
return result;
}
......@@ -322,7 +322,7 @@ static struct buffer_head * block_getblk (struct inode * inode,
}
inode->i_ctime = CURRENT_TIME;
inode->i_blocks += blocks;
inode->i_dirt = 1;
mark_inode_dirty(inode);
inode->u.ext2_i.i_next_alloc_block = new_block;
inode->u.ext2_i.i_next_alloc_goal = tmp;
brelse (bh);
......@@ -591,7 +591,6 @@ static int ext2_update_inode(struct inode * inode, int do_sync)
else for (block = 0; block < EXT2_N_BLOCKS; block++)
raw_inode->i_block[block] = cpu_to_le32(inode->u.ext2_i.i_data[block]);
mark_buffer_dirty(bh, 1);
inode->i_dirt = 0;
if (do_sync) {
ll_rw_block (WRITE, 1, &bh);
wait_on_buffer (bh);
......@@ -671,7 +670,7 @@ int ext2_notify_change(struct inode *inode, struct iattr *iattr)
inode->i_flags &= ~S_IMMUTABLE;
inode->u.ext2_i.i_flags &= ~EXT2_IMMUTABLE_FL;
}
inode->i_dirt = 1;
mark_inode_dirty(inode);
return 0;
}
......
......@@ -62,7 +62,7 @@ int ext2_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
else
inode->i_flags &= ~MS_NOATIME;
inode->i_ctime = CURRENT_TIME;
inode->i_dirt = 1;
mark_inode_dirty(inode);
return 0;
case EXT2_IOC_GETVERSION:
return put_user(inode->u.ext2_i.i_version, (int *) arg);
......@@ -74,7 +74,7 @@ int ext2_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
if (get_user(inode->u.ext2_i.i_version, (int *) arg))
return -EFAULT;
inode->i_ctime = CURRENT_TIME;
inode->i_dirt = 1;
mark_inode_dirty(inode);
return 0;
default:
return -ENOTTY;
......
......@@ -252,7 +252,7 @@ static struct buffer_head * ext2_add_entry (struct inode * dir,
de->inode = le32_to_cpu(0);
de->rec_len = le16_to_cpu(sb->s_blocksize);
dir->i_size = offset + sb->s_blocksize;
dir->i_dirt = 1;
mark_inode_dirty(dir);
} else {
ext2_debug ("skipping to next block\n");
......@@ -297,7 +297,7 @@ static struct buffer_head * ext2_add_entry (struct inode * dir,
* and/or different from the directory change time.
*/
dir->i_mtime = dir->i_ctime = CURRENT_TIME;
dir->i_dirt = 1;
mark_inode_dirty(dir);
dir->i_version = ++event;
mark_buffer_dirty(bh, 1);
*res_dir = de;
......@@ -366,11 +366,11 @@ int ext2_create (struct inode * dir, struct dentry * dentry, int mode)
inode->i_op = &ext2_file_inode_operations;
inode->i_mode = mode;
inode->i_dirt = 1;
mark_inode_dirty(inode);
bh = ext2_add_entry (dir, dentry->d_name.name, dentry->d_name.len, &de, &err);
if (!bh) {
inode->i_nlink--;
inode->i_dirt = 1;
mark_inode_dirty(inode);
iput (inode);
return err;
}
......@@ -423,11 +423,11 @@ int ext2_mknod (struct inode * dir, struct dentry *dentry, int mode, int rdev)
init_fifo(inode);
if (S_ISBLK(mode) || S_ISCHR(mode))
inode->i_rdev = to_kdev_t(rdev);
inode->i_dirt = 1;
mark_inode_dirty(inode);
bh = ext2_add_entry (dir, dentry->d_name.name, dentry->d_name.len, &de, &err);
if (!bh) {
inode->i_nlink--;
inode->i_dirt = 1;
mark_inode_dirty(inode);
iput(inode);
return err;
}
......@@ -465,7 +465,7 @@ int ext2_mkdir(struct inode * dir, struct dentry * dentry, int mode)
dir_block = ext2_bread (inode, 0, 1, &err);
if (!dir_block) {
inode->i_nlink--;
inode->i_dirt = 1;
mark_inode_dirty(inode);
iput (inode);
return err;
}
......@@ -486,11 +486,11 @@ int ext2_mkdir(struct inode * dir, struct dentry * dentry, int mode)
inode->i_mode = S_IFDIR | (mode & (S_IRWXUGO|S_ISVTX) & ~current->fs->umask);
if (dir->i_mode & S_ISGID)
inode->i_mode |= S_ISGID;
inode->i_dirt = 1;
mark_inode_dirty(inode);
bh = ext2_add_entry (dir, dentry->d_name.name, dentry->d_name.len, &de, &err);
if (!bh) {
inode->i_nlink = 0;
inode->i_dirt = 1;
mark_inode_dirty(inode);
iput (inode);
return err;
}
......@@ -502,7 +502,7 @@ int ext2_mkdir(struct inode * dir, struct dentry * dentry, int mode)
wait_on_buffer (bh);
}
dir->i_nlink++;
dir->i_dirt = 1;
mark_inode_dirty(dir);
d_instantiate(dentry, inode, D_DIR);
brelse (bh);
return 0;
......@@ -640,10 +640,10 @@ int ext2_rmdir (struct inode * dir, struct dentry *dentry)
inode->i_nlink);
inode->i_version = ++event;
inode->i_nlink = 0;
inode->i_dirt = 1;
mark_inode_dirty(inode);
dir->i_nlink--;
inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
dir->i_dirt = 1;
mark_inode_dirty(dir);
d_delete(dentry);
end_rmdir:
......@@ -701,9 +701,9 @@ int ext2_unlink(struct inode * dir, struct dentry *dentry)
wait_on_buffer (bh);
}
dir->i_ctime = dir->i_mtime = CURRENT_TIME;
dir->i_dirt = 1;
mark_inode_dirty(dir);
inode->i_nlink--;
inode->i_dirt = 1;
mark_inode_dirty(inode);
inode->i_ctime = dir->i_ctime;
retval = 0;
d_delete(dentry); /* This also frees the inode */
......@@ -738,7 +738,7 @@ int ext2_symlink (struct inode * dir, struct dentry *dentry, const char * symnam
name_block = ext2_bread (inode, 0, 1, &err);
if (!name_block) {
inode->i_nlink--;
inode->i_dirt = 1;
mark_inode_dirty(inode);
iput (inode);
return err;
}
......@@ -758,12 +758,12 @@ int ext2_symlink (struct inode * dir, struct dentry *dentry, const char * symnam
brelse (name_block);
}
inode->i_size = i;
inode->i_dirt = 1;
mark_inode_dirty(inode);
bh = ext2_add_entry (dir, dentry->d_name.name, dentry->d_name.len, &de, &err);
if (!bh) {
inode->i_nlink--;
inode->i_dirt = 1;
mark_inode_dirty(inode);
iput (inode);
return err;
}
......@@ -808,7 +808,7 @@ int ext2_link (struct inode * inode, struct inode * dir, struct dentry *dentry)
brelse (bh);
inode->i_nlink++;
inode->i_ctime = CURRENT_TIME;
inode->i_dirt = 1;
mark_inode_dirty(inode);
atomic_inc(&inode->i_count);
d_instantiate(dentry, inode, 0);
return 0;
......@@ -953,21 +953,21 @@ static int do_ext2_rename (struct inode * old_dir, struct dentry *old_dentry,
if (new_inode) {
new_inode->i_nlink--;
new_inode->i_ctime = CURRENT_TIME;
new_inode->i_dirt = 1;
mark_inode_dirty(new_inode);
}
old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME;
old_dir->i_dirt = 1;
mark_inode_dirty(old_dir);
if (dir_bh) {
PARENT_INO(dir_bh->b_data) = le32_to_cpu(new_dir->i_ino);
mark_buffer_dirty(dir_bh, 1);
old_dir->i_nlink--;
old_dir->i_dirt = 1;
mark_inode_dirty(old_dir);
if (new_inode) {
new_inode->i_nlink--;
new_inode->i_dirt = 1;
mark_inode_dirty(new_inode);
} else {
new_dir->i_nlink++;
new_dir->i_dirt = 1;
mark_inode_dirty(new_dir);
}
}
mark_buffer_dirty(old_bh, 1);
......
......@@ -65,10 +65,7 @@ static struct dentry * ext2_follow_link(struct inode * inode, struct dentry *bas
}
link = bh->b_data;
}
if (!IS_RDONLY(inode)) {
inode->i_atime = CURRENT_TIME;
inode->i_dirt = 1;
}
UPDATE_ATIME(inode);
base = lookup_dentry(link, base, 1);
if (bh)
brelse(bh);
......@@ -101,10 +98,7 @@ static int ext2_readlink (struct inode * inode, char * buffer, int buflen)
i++;
if (copy_to_user(buffer, link, i))
i = -EFAULT;
if (DO_UPDATE_ATIME(inode)) {
inode->i_atime = CURRENT_TIME;
inode->i_dirt = 1;
}
UPDATE_ATIME(inode);
if (bh)
brelse (bh);
return i;
......
......@@ -91,7 +91,7 @@ static int trunc_direct (struct inode * inode)
}
*p = 0;
inode->i_blocks -= blocks;
inode->i_dirt = 1;
mark_inode_dirty(inode);
bforget(bh);
if (free_count == 0) {
block_to_free = tmp;
......@@ -172,7 +172,7 @@ static int trunc_indirect (struct inode * inode, int offset, u32 * p)
}
/* ext2_free_blocks (inode, tmp, 1); */
inode->i_blocks -= blocks;
inode->i_dirt = 1;
mark_inode_dirty(inode);
}
if (free_count > 0)
ext2_free_blocks (inode, block_to_free, free_count);
......@@ -187,7 +187,7 @@ static int trunc_indirect (struct inode * inode, int offset, u32 * p)
tmp = *p;
*p = 0;
inode->i_blocks -= blocks;
inode->i_dirt = 1;
mark_inode_dirty(inode);
ext2_free_blocks (inode, tmp, 1);
}
if (IS_SYNC(inode) && buffer_dirty(ind_bh)) {
......@@ -259,7 +259,7 @@ static int trunc_indirect_swab32 (struct inode * inode, int offset, u32 * p)
}
/* ext2_free_blocks (inode, tmp, 1); */
inode->i_blocks -= blocks;
inode->i_dirt = 1;
mark_inode_dirty(inode);
}
if (free_count > 0)
ext2_free_blocks (inode, block_to_free, free_count);
......@@ -274,7 +274,7 @@ static int trunc_indirect_swab32 (struct inode * inode, int offset, u32 * p)
tmp = le32_to_cpu(*p);
*p = cpu_to_le32(0);
inode->i_blocks -= blocks;
inode->i_dirt = 1;
mark_inode_dirty(inode);
ext2_free_blocks (inode, tmp, 1);
}
if (IS_SYNC(inode) && buffer_dirty(ind_bh)) {
......@@ -334,7 +334,7 @@ static int trunc_dindirect (struct inode * inode, int offset,
tmp = *p;
*p = 0;
inode->i_blocks -= blocks;
inode->i_dirt = 1;
mark_inode_dirty(inode);
ext2_free_blocks (inode, tmp, 1);
}
if (IS_SYNC(inode) && buffer_dirty(dind_bh)) {
......@@ -393,7 +393,7 @@ static int trunc_dindirect_swab32 (struct inode * inode, int offset,
tmp = le32_to_cpu(*p);
*p = cpu_to_le32(0);
inode->i_blocks -= blocks;
inode->i_dirt = 1;
mark_inode_dirty(inode);
ext2_free_blocks (inode, tmp, 1);
}
if (IS_SYNC(inode) && buffer_dirty(dind_bh)) {
......@@ -452,7 +452,7 @@ static int trunc_tindirect (struct inode * inode)
tmp = *p;
*p = 0;
inode->i_blocks -= blocks;
inode->i_dirt = 1;
mark_inode_dirty(inode);
ext2_free_blocks (inode, tmp, 1);
}
if (IS_SYNC(inode) && buffer_dirty(tind_bh)) {
......@@ -486,7 +486,7 @@ void ext2_truncate (struct inode * inode)
retry |= trunc_tindirect (inode);
if (!retry)
break;
if (IS_SYNC(inode) && inode->i_dirt)
if (IS_SYNC(inode) && test_bit(I_DIRTY, &inode->i_state))
ext2_sync_inode (inode);
current->counter = 0;
schedule ();
......@@ -510,5 +510,5 @@ void ext2_truncate (struct inode * inode)
}
}
inode->i_mtime = inode->i_ctime = CURRENT_TIME;
inode->i_dirt = 1;
mark_inode_dirty(inode);
}
This diff is collapsed.
......@@ -54,6 +54,7 @@ struct inode_operations isofs_dir_inode_operations =
NULL, /* mknod */
NULL, /* rename */
NULL, /* readlink */
NULL, /* follow_link */
NULL, /* readpage */
NULL, /* writepage */
isofs_bmap, /* bmap */
......
......@@ -47,6 +47,7 @@ struct inode_operations isofs_file_inode_operations = {
NULL, /* mknod */
NULL, /* rename */
NULL, /* readlink */
NULL, /* follow_link */
generic_readpage, /* readpage */
NULL, /* writepage */
isofs_bmap, /* bmap */
......
......@@ -481,12 +481,12 @@ struct super_block *isofs_read_super(struct super_block *s,void *data,
s->u.isofs_sb.s_mode = opt.mode & 0777;
s->s_blocksize = opt.blocksize;
s->s_blocksize_bits = blocksize_bits;
s->s_mounted = iget(s, (isonum_733(rootp->extent) +
s->s_root = d_alloc_root(iget(s, (isonum_733(rootp->extent) +
isonum_711(rootp->ext_attr_length))
<< s -> u.isofs_sb.s_log_zone_size);
<< s -> u.isofs_sb.s_log_zone_size), NULL);
unlock_super(s);
if (!(s->s_mounted)) {
if (!(s->s_root)) {
s->s_dev = 0;
printk("get root inode failed\n");
MOD_DEC_USE_COUNT;
......
......@@ -201,62 +201,60 @@ static struct buffer_head * isofs_find_entry(struct inode * dir,
return NULL;
}
int isofs_lookup(struct inode * dir,const char * name, int len,
struct inode ** result)
int isofs_lookup(struct inode * dir, struct qstr *name,
struct inode ** result)
{
unsigned long ino, ino_back;
struct buffer_head * bh;
char *lcname;
struct inode *inode;
#ifdef DEBUG
printk("lookup: %x %d\n",dir->i_ino, len);
printk("lookup: %x %d\n",dir->i_ino, name->len);
#endif
*result = NULL;
if (!dir)
return -ENOENT;
if (!S_ISDIR(dir->i_mode)) {
iput(dir);
if (!S_ISDIR(dir->i_mode))
return -ENOENT;
}
/* If mounted with check=relaxed (and most likely norock),
* then first convert this name to lower case.
*/
if (dir->i_sb->u.isofs_sb.s_name_check == 'r' &&
(lcname = kmalloc(len, GFP_KERNEL)) != NULL) {
(lcname = kmalloc(name->len, GFP_KERNEL)) != NULL) {
int i;
char c;
for (i=0; i<len; i++) {
c = name[i];
for (i=0; i<name->len; i++) {
c = name->name[i];
if (c >= 'A' && c <= 'Z') c |= 0x20;
lcname[i] = c;
}
bh = isofs_find_entry(dir,lcname,len, &ino, &ino_back);
bh = isofs_find_entry(dir, lcname, name->len,
&ino, &ino_back);
kfree(lcname);
} else
bh = isofs_find_entry(dir,name,len, &ino, &ino_back);
bh = isofs_find_entry(dir, name->name,
name->len, &ino, &ino_back);
if (!bh) {
iput(dir);
if (!bh)
return -ENOENT;
}
brelse(bh);
if (!(*result = iget(dir->i_sb,ino))) {
iput(dir);
inode = iget(dir->i_sb,ino);
if (!inode)
return -EACCES;
}
/* We need this backlink for the ".." entry unless the name that we
* are looking up traversed a mount point (in which case the inode
* may not even be on an iso9660 filesystem, and writing to
* u.isofs_i would only cause memory corruption).
*/
if (ino_back && !(*result)->i_pipe && (*result)->i_sb == dir->i_sb)
(*result)->u.isofs_i.i_backlink = ino_back;
if (ino_back && !inode->i_pipe && inode->i_sb == dir->i_sb)
inode->u.isofs_i.i_backlink = ino_back;
*result = inode;
iput(dir);
return 0;
}
......@@ -50,6 +50,7 @@ struct inode_operations minix_dir_inode_operations = {
minix_mknod, /* mknod */
minix_rename, /* rename */
NULL, /* readlink */
NULL, /* follow_link */
NULL, /* readpage */
NULL, /* writepage */
NULL, /* bmap */
......
......@@ -58,6 +58,7 @@ struct inode_operations minix_file_inode_operations = {
NULL, /* mknod */
NULL, /* rename */
NULL, /* readlink */
NULL, /* follow_link */
generic_readpage, /* readpage */
NULL, /* writepage */
minix_bmap, /* bmap */
......
......@@ -18,6 +18,7 @@
#include <linux/string.h>
#include <linux/stat.h>
#include <linux/locks.h>
#include <linux/dalloc.h>
#include <linux/init.h>
#include <asm/system.h>
......@@ -125,15 +126,13 @@ int minix_remount (struct super_block * sb, int * flags, char * data)
* it really _is_ a minix filesystem, and to check the size
* of the directory entry.
*/
static const char * minix_checkroot(struct super_block *s)
static const char * minix_checkroot(struct super_block *s, struct inode *dir)
{
struct inode * dir;
struct buffer_head *bh;
struct minix_dir_entry *de;
const char * errmsg;
int dirsize;
dir = s->s_mounted;
if (!S_ISDIR(dir->i_mode))
return "root directory is not a directory";
......@@ -172,7 +171,8 @@ struct super_block *minix_read_super(struct super_block *s,void *data,
int i, block;
kdev_t dev = s->s_dev;
const char * errmsg;
struct inode *root_inode;
if (32 != sizeof (struct minix_inode))
panic("bad V1 i-node size");
if (64 != sizeof(struct minix2_inode))
......@@ -272,8 +272,9 @@ struct super_block *minix_read_super(struct super_block *s,void *data,
/* set up enough so that it can read an inode */
s->s_dev = dev;
s->s_op = &minix_sops;
s->s_mounted = iget(s,MINIX_ROOT_INO);
if (!s->s_mounted) {
root_inode = iget(s,MINIX_ROOT_INO);
s->s_root = d_alloc_root(root_inode, NULL);
if (!s->s_root) {
s->s_dev = 0;
brelse(bh);
if (!silent)
......@@ -282,11 +283,11 @@ struct super_block *minix_read_super(struct super_block *s,void *data,
return NULL;
}
errmsg = minix_checkroot(s);
errmsg = minix_checkroot(s, root_inode);
if (errmsg) {
if (!silent)
printk("MINIX-fs: %s\n", errmsg);
iput (s->s_mounted);
d_delete(s->s_root); /* XXX Is this enough? */
s->s_dev = 0;
brelse (bh);
MOD_DEC_USE_COUNT;
......
This diff is collapsed.
......@@ -363,7 +363,6 @@ nfs_notify_change(struct inode *inode, struct iattr *attr)
nfs_truncate_dirty_pages(inode, sattr.size);
nfs_refresh_inode(inode, &fattr);
}
inode->i_dirt = 0;
return error;
}
......
......@@ -90,7 +90,6 @@ int do_truncate(struct inode *inode, unsigned long length)
vmtruncate(inode, length);
if (inode->i_op && inode->i_op->truncate)
inode->i_op->truncate(inode);
inode->i_status |= ST_MODIFIED;
}
up(&inode->i_sem);
return error;
......@@ -436,12 +435,7 @@ asmlinkage int sys_fchmod(unsigned int fd, mode_t mode)
mode = inode->i_mode;
newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
inode->i_dirt = 1;
err = notify_change(inode, &newattrs);
#ifdef CONFIG_OMIRR
if(!err)
omirr_printall(inode, " M %ld %ld ", CURRENT_TIME, newattrs.ia_mode);
#endif
out:
unlock_kernel();
return err;
......@@ -471,12 +465,7 @@ asmlinkage int sys_chmod(const char * filename, mode_t mode)
mode = inode->i_mode;
newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
inode->i_dirt = 1;
error = notify_change(inode, &newattrs);
#ifdef CONFIG_OMIRR
if(!error)
omirr_printall(inode, " M %ld %ld ", CURRENT_TIME, newattrs.ia_mode);
#endif
iput_and_out:
iput(inode);
out:
......@@ -528,7 +517,6 @@ asmlinkage int sys_fchown(unsigned int fd, uid_t user, gid_t group)
newattrs.ia_mode &= ~S_ISGID;
newattrs.ia_valid |= ATTR_MODE;
}
inode->i_dirt = 1;
if (inode->i_sb && inode->i_sb->dq_op) {
inode->i_sb->dq_op->initialize(inode, -1);
error = -EDQUOT;
......@@ -539,11 +527,6 @@ asmlinkage int sys_fchown(unsigned int fd, uid_t user, gid_t group)
inode->i_sb->dq_op->transfer(inode, &newattrs, 1);
} else
error = notify_change(inode, &newattrs);
#ifdef CONFIG_OMIRR
if(!error)
omirr_printall(inode, " O %d %d ", CURRENT_TIME,
newattrs.ia_uid, newattrs.ia_gid);
#endif
out:
unlock_kernel();
return error;
......@@ -590,7 +573,6 @@ asmlinkage int sys_chown(const char * filename, uid_t user, gid_t group)
newattrs.ia_mode &= ~S_ISGID;
newattrs.ia_valid |= ATTR_MODE;
}
inode->i_dirt = 1;
if (inode->i_sb->dq_op) {
inode->i_sb->dq_op->initialize(inode, -1);
error = -EDQUOT;
......@@ -601,11 +583,6 @@ asmlinkage int sys_chown(const char * filename, uid_t user, gid_t group)
inode->i_sb->dq_op->transfer(inode, &newattrs, 1);
} else
error = notify_change(inode, &newattrs);
#ifdef CONFIG_OMIRR
if(!error)
omirr_printall(inode, " O %d %d ", CURRENT_TIME,
newattrs.ia_uid, newattrs.ia_gid);
#endif
iput_and_out:
iput(inode);
out:
......
......@@ -75,10 +75,7 @@ static long pipe_read(struct inode * inode, struct file * filp,
PIPE_LOCK(*inode)--;
wake_up_interruptible(&PIPE_WAIT(*inode));
if (read) {
if (DO_UPDATE_ATIME(inode)) {
inode->i_atime = CURRENT_TIME;
inode->i_dirt = 1;
}
UPDATE_ATIME(inode);
return read;
}
if (PIPE_WRITERS(*inode))
......@@ -132,7 +129,7 @@ static long pipe_write(struct inode * inode, struct file * filp,
free = 1;
}
inode->i_ctime = inode->i_mtime = CURRENT_TIME;
inode->i_dirt = 1;
mark_inode_dirty(inode);
return written;
}
......@@ -423,11 +420,13 @@ int do_pipe(int *fd)
j = error;
f1->f_inode = f2->f_inode = inode;
/* read file */
f1->f_pos = f2->f_pos = 0;
f1->f_flags = O_RDONLY;
f1->f_op = &read_pipe_fops;
f1->f_mode = 1;
/* write file */
f2->f_flags = O_WRONLY;
f2->f_op = &write_pipe_fops;
......
......@@ -201,5 +201,4 @@ void proc_read_inode(struct inode * inode)
void proc_write_inode(struct inode * inode)
{
inode->i_dirt=0;
}
......@@ -168,7 +168,6 @@ asmlinkage long sys_write(unsigned int fd, const char * buf, unsigned long count
goto out;
down(&inode->i_sem);
error = write(inode,file,buf,count);
inode->i_status |= ST_MODIFIED;
up(&inode->i_sem);
out:
fput(file, inode);
......@@ -264,8 +263,6 @@ static long do_readv_writev(int type, struct inode * inode, struct file * file,
if (nr != len)
break;
}
if(fn == (IO_fn_t) file->f_op->write)
inode->i_status |= ST_MODIFIED;
if (iov != iovstack)
kfree(iov);
return retval;
......
......@@ -256,10 +256,7 @@ asmlinkage int sys_readlink(const char * path, char * buf, int bufsiz)
iput(inode);
goto out;
}
if (!IS_RDONLY(inode)) {
inode->i_atime = CURRENT_TIME;
inode->i_dirt = 1;
}
UPDATE_ATIME(inode);
error = inode->i_op->readlink(inode,buf,bufsiz);
iput(inode);
out:
......
......@@ -41,6 +41,7 @@ struct inode_operations ufs_file_inode_operations = {
NULL, /* mknod */
NULL, /* rename */
NULL, /* readlink */
NULL, /* follow_link */
generic_readpage, /* readpage */
NULL, /* writepage */
ufs_bmap, /* bmap */
......
......@@ -35,12 +35,14 @@ static int ufs_match (int len, const char * const name, struct ufs_direct * d)
}
/* XXX - this is a mess, especially for endianity */
int ufs_lookup (struct inode * dir, const char * name, int len,
int ufs_lookup (struct inode * dir, struct qstr *qname,
struct inode ** result)
{
unsigned long int lfragno, fragno;
struct buffer_head * bh;
struct ufs_direct * d;
const char *name = qname->name;
int len = qname->len;
if (dir->i_sb->u.ufs_sb.s_flags & UFS_DEBUG)
printk("Passed name: %s\nPassed length: %d\n", name, len);
......
......@@ -254,7 +254,7 @@ ufs_read_super(struct super_block * sb, void * data, int silent)
sb->u.ufs_sb.s_lmask = ~((ufs_swab32(usb->fs_fmask) - ufs_swab32(usb->fs_bmask))
>> ufs_swab32(usb->fs_fshift));
sb->u.ufs_sb.s_fsfrag = ufs_swab32(usb->fs_frag); /* XXX - rename this later */
sb->s_mounted = iget(sb, UFS_ROOTINO);
sb->s_root = d_alloc_root(iget(sb, UFS_ROOTINO), NULL);
#ifdef DEBUG_UFS_SUPER
printk("ufs_read_super: inopb %u\n", sb->u.ufs_sb.s_inopb);
......
......@@ -15,6 +15,7 @@
#include <linux/net.h>
#include <linux/kdev_t.h>
#include <linux/ioctl.h>
#include <linux/list.h>
#include <asm/atomic.h>
#include <asm/bitops.h>
......@@ -78,9 +79,6 @@ extern int max_files, nr_files;
*/
#define FS_IBASKET 8 /* FS does callback to free_ibasket() if space gets low. */
/* public flags for i_status */
#define ST_MODIFIED 1024
/*
* These are the fs-independent mount-flags: up to 16 flags are supported
*/
......@@ -126,7 +124,12 @@ extern int max_files, nr_files;
#define IS_APPEND(inode) ((inode)->i_flags & S_APPEND)
#define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE)
#define IS_NOATIME(inode) ((inode)->i_flags & MS_NOATIME)
#define DO_UPDATE_ATIME(inode) (!IS_NOATIME(inode) && !IS_RDONLY(inode))
#define UPDATE_ATIME(inode) \
if (!IS_NOATIME(inode) && !IS_RDONLY(inode)) { \
inode->i_atime = CURRENT_TIME; \
mark_inode_dirty(inode); \
}
/* the read-only stuff doesn't really belong here, but any other place is
probably as bad and I don't want to create yet another include file. */
......@@ -300,10 +303,8 @@ struct iattr {
#include <linux/quota.h>
struct inode {
struct inode *i_hash_next;
struct inode *i_hash_prev;
struct inode *i_next;
struct inode *i_prev;
struct list_head i_hash;
struct list_head i_list;
unsigned long i_ino;
kdev_t i_dev;
......@@ -330,25 +331,14 @@ struct inode {
struct page *i_pages;
struct dquot *i_dquot[MAXQUOTAS];
struct inode *i_lru_next;
struct inode *i_lru_prev;
struct inode *i_basket_next;
struct inode *i_basket_prev;
struct dentry *i_dentry;
unsigned short i_status;
unsigned short i_reuse_count;
unsigned int i_state;
unsigned int i_flags;
unsigned char i_lock;
unsigned char i_dirt;
unsigned char i_pipe;
unsigned char i_sock;
unsigned char i_level;
unsigned short i_fill;
int i_writecount;
unsigned int i_attr_flags;
union {
......@@ -369,6 +359,17 @@ struct inode {
} u;
};
/* Inode state bits.. */
#define I_DIRTY 0
#define I_LOCK 1
extern void __mark_inode_dirty(struct inode *);
static inline void mark_inode_dirty(struct inode *inode)
{
if (!test_and_set_bit(I_DIRTY, &inode->i_state))
__mark_inode_dirty(inode);
}
struct file {
struct file *f_next, **f_pprev;
struct inode *f_inode;
......@@ -735,42 +736,12 @@ extern inline void vfs_unlock(void)
/* Not to be used by ordinary vfs users */
extern void _get_inode(struct inode * inode);
extern blocking void __iput(struct inode * inode);
extern blocking void _iput(struct inode * inode);
extern inline blocking void iput(struct inode * inode)
{
if (inode) {
extern void wake_up_interruptible(struct wait_queue **q);
if (inode->i_pipe)
wake_up_interruptible(&inode->u.pipe_i.wait);
/* It does not matter if somebody re-increments it in between,
* only the _last_ user needs to call _iput().
*/
if (atomic_dec_and_test(&inode->i_count))
_iput(inode);
}
}
extern void iput(struct inode * inode);
extern blocking struct inode * iget(struct super_block * sb, unsigned long nr);
extern blocking void _clear_inode(struct inode * inode, int external, int verbose);
extern blocking inline void clear_inode(struct inode * inode)
{
vfs_lock();
_clear_inode(inode, 1, 1);
vfs_unlock();
}
extern blocking struct inode * _get_empty_inode(void);
extern inline blocking struct inode * get_empty_inode(void)
{
struct inode * inode;
vfs_lock();
inode = _get_empty_inode();
vfs_unlock();
return inode;
}
extern blocking void clear_inode(struct inode * inode);
extern blocking struct inode * get_empty_inode(void);
/* Please prefer to use this function in future, instead of using
* a get_empty_inode()/insert_inode_hash() combination.
* It allows for better checking and less race conditions.
......
......@@ -152,7 +152,7 @@ extern int find_rock_ridge_relocation(struct iso_directory_record *, struct inod
extern int isofs_open(struct inode * inode, struct file * filp);
extern void isofs_release(struct inode * inode, struct file * filp);
extern int isofs_lookup(struct inode * dir,const char * name, int len,
extern int isofs_lookup(struct inode * dir, struct qstr *dentry,
struct inode ** result);
extern unsigned long isofs_count_free_inodes(struct super_block *sb);
extern int isofs_new_block(int dev);
......
#ifndef _LINUX_LIST_H
#define _LINUX_LIST_H
/*
* Simple doubly linked list implementation.
*/
struct list_head {
struct list_head *next, *prev;
};
#define LIST_HEAD(name) \
struct list_head name = { &name, &name }
#define INIT_LIST_HEAD(ptr) do { \
(ptr)->next = (ptr); (ptr)->prev = (ptr); \
} while (0)
static inline void list_add(struct list_head *new, struct list_head *head)
{
struct list_head *next = head->next;
next->prev = new;
new->next = next;
new->prev = head;
head->next = new;
}
static inline void list_del(struct list_head *entry)
{
struct list_head *next, *prev;
next = entry->next;
prev = entry->prev;
next->prev = prev;
prev->next = next;
}
#define list_entry(ptr, type, member) \
((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
#endif
......@@ -88,19 +88,18 @@ struct minix_dir_entry {
#ifdef __KERNEL__
extern int minix_lookup(struct inode * dir,const char * name, int len,
extern int minix_lookup(struct inode * dir, struct qstr *name,
struct inode ** result);
extern int minix_create(struct inode * dir,const char * name, int len, int mode,
struct inode ** result);
extern int minix_mkdir(struct inode * dir, const char * name, int len, int mode);
extern int minix_rmdir(struct inode * dir, const char * name, int len);
extern int minix_unlink(struct inode * dir, const char * name, int len);
extern int minix_symlink(struct inode * inode, const char * name, int len,
extern int minix_create(struct inode * dir, struct dentry *dentry, int mode);
extern int minix_mkdir(struct inode * dir, struct dentry *dentry, int mode);
extern int minix_rmdir(struct inode * dir, struct dentry *dentry);
extern int minix_unlink(struct inode * dir, struct dentry *dentry);
extern int minix_symlink(struct inode * inode, struct dentry *dentry,
const char * symname);
extern int minix_link(struct inode * oldinode, struct inode * dir, const char * name, int len);
extern int minix_mknod(struct inode * dir, const char * name, int len, int mode, int rdev);
extern int minix_rename(struct inode * old_dir, const char * old_name, int old_len,
struct inode * new_dir, const char * new_name, int new_len);
extern int minix_link(struct inode * oldinode, struct inode * dir, struct dentry *dentry);
extern int minix_mknod(struct inode * dir, struct dentry *dentry, int mode, int rdev);
extern int minix_rename(struct inode * old_dir, struct dentry *old_dentry,
struct inode * new_dir, struct dentry *new_dentry);
extern struct inode * minix_new_inode(const struct inode * dir);
extern void minix_free_inode(struct inode * inode);
extern unsigned long minix_count_free_inodes(struct super_block *sb);
......
......@@ -225,7 +225,7 @@ extern void ufs_put_inode(struct inode * inode);
extern void ufs_print_inode (struct inode *);
/* ufs_namei.c */
extern int ufs_lookup (struct inode *, const char *, int, struct inode **);
extern int ufs_lookup (struct inode *, struct qstr *, struct inode **);
/* ufs_super.c */
extern void ufs_warning (struct super_block *, const char *, const char *, ...)
......
......@@ -142,7 +142,7 @@ EXPORT_SYMBOL(getname);
EXPORT_SYMBOL(putname);
EXPORT_SYMBOL(__fput);
EXPORT_SYMBOL(iget);
EXPORT_SYMBOL(_iput);
EXPORT_SYMBOL(iput);
EXPORT_SYMBOL(__namei);
EXPORT_SYMBOL(lookup_dentry);
EXPORT_SYMBOL(open_namei);
......@@ -342,7 +342,7 @@ EXPORT_SYMBOL(set_writetime);
EXPORT_SYMBOL(sys_tz);
EXPORT_SYMBOL(__wait_on_super);
EXPORT_SYMBOL(file_fsync);
EXPORT_SYMBOL(_clear_inode);
EXPORT_SYMBOL(clear_inode);
EXPORT_SYMBOL(refile_buffer);
EXPORT_SYMBOL(nr_async_pages);
EXPORT_SYMBOL(___strtok);
......@@ -353,7 +353,7 @@ EXPORT_SYMBOL(chrdev_inode_operations);
EXPORT_SYMBOL(blkdev_inode_operations);
EXPORT_SYMBOL(read_ahead);
EXPORT_SYMBOL(get_hash_table);
EXPORT_SYMBOL(_get_empty_inode);
EXPORT_SYMBOL(get_empty_inode);
EXPORT_SYMBOL(insert_inode_hash);
EXPORT_SYMBOL(event);
EXPORT_SYMBOL(__down);
......
......@@ -399,8 +399,6 @@ int acct_process(long exitcode)
acct_file.f_op->write(acct_file.f_inode, &acct_file,
(char *)&ac, sizeof(struct acct));
/* inode->i_status |= ST_MODIFIED is willingly *not* done here */
set_fs(fs);
}
return 0;
......
......@@ -753,10 +753,7 @@ long generic_file_read(struct inode * inode, struct file * filp,
filp->f_reada = 1;
if (page_cache)
free_page(page_cache);
if (DO_UPDATE_ATIME(inode)) {
inode->i_atime = CURRENT_TIME;
inode->i_dirt = 1;
}
UPDATE_ATIME(inode)
if (!read)
read = error;
return read;
......@@ -919,7 +916,6 @@ static inline int do_write_page(struct inode * inode, struct file * file,
retval = -EIO;
if (size == file->f_op->write(inode, file, (const char *) page, size))
retval = 0;
/* inode->i_status |= ST_MODIFIED is willingly *not* done here */
set_fs(old_fs);
return retval;
}
......@@ -1189,10 +1185,7 @@ int generic_file_mmap(struct inode * inode, struct file * file, struct vm_area_s
return -EACCES;
if (!inode->i_op || !inode->i_op->readpage)
return -ENOEXEC;
if (DO_UPDATE_ATIME(inode)) {
inode->i_atime = CURRENT_TIME;
inode->i_dirt = 1;
}
UPDATE_ATIME(inode);
vma->vm_inode = inode;
atomic_inc(&inode->i_count);
vma->vm_ops = ops;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment