mirror of
https://github.com/a52xq-dev/kernel.git
synced 2026-10-18 21:58:11 +07:00
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: inotify: fix type errors in interfaces fix breakage in reiserfs_new_inode() fix the treatment of jfs special inodes vfs: remove duplicate code in get_fs_type() add a vfs_fsync helper sys_execve and sys_uselib do not call into fsnotify zero i_uid/i_gid on inode allocation inode->i_op is never NULL ntfs: don't NULL i_op isofs check for NULL ->i_op in root directory is dead code affs: do not zero ->i_op kill suid bit only for regular files vfs: lseek(fd, 0, SEEK_CUR) race condition
This commit is contained in:
commit
520c853466
58 changed files with 126 additions and 219 deletions
|
|
@ -97,7 +97,6 @@ spufs_new_inode(struct super_block *sb, int mode)
|
|||
inode->i_mode = mode;
|
||||
inode->i_uid = current_fsuid();
|
||||
inode->i_gid = current_fsgid();
|
||||
inode->i_blocks = 0;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
out:
|
||||
return inode;
|
||||
|
|
|
|||
|
|
@ -106,7 +106,6 @@ static struct inode *hypfs_make_inode(struct super_block *sb, int mode)
|
|||
ret->i_mode = mode;
|
||||
ret->i_uid = hypfs_info->uid;
|
||||
ret->i_gid = hypfs_info->gid;
|
||||
ret->i_blocks = 0;
|
||||
ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME;
|
||||
if (mode & S_IFDIR)
|
||||
ret->i_nlink = 2;
|
||||
|
|
|
|||
|
|
@ -57,9 +57,6 @@ static int ipathfs_mknod(struct inode *dir, struct dentry *dentry,
|
|||
}
|
||||
|
||||
inode->i_mode = mode;
|
||||
inode->i_uid = 0;
|
||||
inode->i_gid = 0;
|
||||
inode->i_blocks = 0;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_private = data;
|
||||
if ((mode & S_IFMT) == S_IFDIR) {
|
||||
|
|
|
|||
|
|
@ -111,8 +111,6 @@ capifs_fill_super(struct super_block *s, void *data, int silent)
|
|||
goto fail;
|
||||
inode->i_ino = 1;
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_blocks = 0;
|
||||
inode->i_uid = inode->i_gid = 0;
|
||||
inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR;
|
||||
inode->i_op = &simple_dir_inode_operations;
|
||||
inode->i_fop = &simple_dir_operations;
|
||||
|
|
|
|||
|
|
@ -146,8 +146,6 @@ static struct inode *ibmasmfs_make_inode(struct super_block *sb, int mode)
|
|||
|
||||
if (ret) {
|
||||
ret->i_mode = mode;
|
||||
ret->i_uid = ret->i_gid = 0;
|
||||
ret->i_blocks = 0;
|
||||
ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME;
|
||||
}
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -29,9 +29,6 @@ static struct inode *oprofilefs_get_inode(struct super_block *sb, int mode)
|
|||
|
||||
if (inode) {
|
||||
inode->i_mode = mode;
|
||||
inode->i_uid = 0;
|
||||
inode->i_gid = 0;
|
||||
inode->i_blocks = 0;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
}
|
||||
return inode;
|
||||
|
|
|
|||
|
|
@ -279,7 +279,6 @@ static struct inode *usbfs_get_inode (struct super_block *sb, int mode, dev_t de
|
|||
inode->i_mode = mode;
|
||||
inode->i_uid = current_fsuid();
|
||||
inode->i_gid = current_fsgid();
|
||||
inode->i_blocks = 0;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
switch (mode & S_IFMT) {
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -1863,26 +1863,10 @@ static int do_write(struct fsg_dev *fsg)
|
|||
static int fsync_sub(struct lun *curlun)
|
||||
{
|
||||
struct file *filp = curlun->filp;
|
||||
struct inode *inode;
|
||||
int rc, err;
|
||||
|
||||
if (curlun->ro || !filp)
|
||||
return 0;
|
||||
if (!filp->f_op->fsync)
|
||||
return -EINVAL;
|
||||
|
||||
inode = filp->f_path.dentry->d_inode;
|
||||
mutex_lock(&inode->i_mutex);
|
||||
rc = filemap_fdatawrite(inode->i_mapping);
|
||||
err = filp->f_op->fsync(filp, filp->f_path.dentry, 1);
|
||||
if (!rc)
|
||||
rc = err;
|
||||
err = filemap_fdatawait(inode->i_mapping);
|
||||
if (!rc)
|
||||
rc = err;
|
||||
mutex_unlock(&inode->i_mutex);
|
||||
VLDBG(curlun, "fdatasync -> %d\n", rc);
|
||||
return rc;
|
||||
return vfs_fsync(filp, filp->f_path.dentry, 1);
|
||||
}
|
||||
|
||||
static void fsync_all(struct fsg_dev *fsg)
|
||||
|
|
|
|||
|
|
@ -2001,7 +2001,6 @@ gadgetfs_make_inode (struct super_block *sb,
|
|||
inode->i_mode = mode;
|
||||
inode->i_uid = default_uid;
|
||||
inode->i_gid = default_gid;
|
||||
inode->i_blocks = 0;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime
|
||||
= CURRENT_TIME;
|
||||
inode->i_private = data;
|
||||
|
|
|
|||
|
|
@ -119,8 +119,7 @@ struct inode *affs_iget(struct super_block *sb, unsigned long ino)
|
|||
goto bad_inode;
|
||||
#else
|
||||
inode->i_mode |= S_IFDIR;
|
||||
inode->i_op = NULL;
|
||||
inode->i_fop = NULL;
|
||||
/* ... and leave ->i_op and ->i_fop pointing to empty */
|
||||
break;
|
||||
#endif
|
||||
case ST_LINKFILE:
|
||||
|
|
|
|||
|
|
@ -251,13 +251,11 @@ struct inode *autofs_iget(struct super_block *sb, unsigned long ino)
|
|||
inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO;
|
||||
inode->i_nlink = 2;
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_blocks = 0;
|
||||
|
||||
if (ino == AUTOFS_ROOT_INO) {
|
||||
inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR;
|
||||
inode->i_op = &autofs_root_inode_operations;
|
||||
inode->i_fop = &autofs_root_operations;
|
||||
inode->i_uid = inode->i_gid = 0; /* Changed in read_super */
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -455,11 +455,7 @@ struct inode *autofs4_get_inode(struct super_block *sb,
|
|||
if (sb->s_root) {
|
||||
inode->i_uid = sb->s_root->d_inode->i_uid;
|
||||
inode->i_gid = sb->s_root->d_inode->i_gid;
|
||||
} else {
|
||||
inode->i_uid = 0;
|
||||
inode->i_gid = 0;
|
||||
}
|
||||
inode->i_blocks = 0;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
|
||||
if (S_ISDIR(inf->mode)) {
|
||||
|
|
|
|||
|
|
@ -496,9 +496,6 @@ static struct inode *bm_get_inode(struct super_block *sb, int mode)
|
|||
|
||||
if (inode) {
|
||||
inode->i_mode = mode;
|
||||
inode->i_uid = 0;
|
||||
inode->i_gid = 0;
|
||||
inode->i_blocks = 0;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime =
|
||||
current_fs_time(inode->i_sb);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1641,7 +1641,7 @@ do_expand:
|
|||
i_size_write(inode, offset);
|
||||
spin_unlock(&inode->i_lock);
|
||||
out_truncate:
|
||||
if (inode->i_op && inode->i_op->truncate)
|
||||
if (inode->i_op->truncate)
|
||||
inode->i_op->truncate(inode);
|
||||
return 0;
|
||||
out_sig:
|
||||
|
|
|
|||
|
|
@ -201,8 +201,7 @@ int coda_release(struct inode *coda_inode, struct file *coda_file)
|
|||
int coda_fsync(struct file *coda_file, struct dentry *coda_dentry, int datasync)
|
||||
{
|
||||
struct file *host_file;
|
||||
struct dentry *host_dentry;
|
||||
struct inode *host_inode, *coda_inode = coda_dentry->d_inode;
|
||||
struct inode *coda_inode = coda_dentry->d_inode;
|
||||
struct coda_file_info *cfi;
|
||||
int err = 0;
|
||||
|
||||
|
|
@ -214,14 +213,7 @@ int coda_fsync(struct file *coda_file, struct dentry *coda_dentry, int datasync)
|
|||
BUG_ON(!cfi || cfi->cfi_magic != CODA_MAGIC);
|
||||
host_file = cfi->cfi_container;
|
||||
|
||||
if (host_file->f_op && host_file->f_op->fsync) {
|
||||
host_dentry = host_file->f_path.dentry;
|
||||
host_inode = host_dentry->d_inode;
|
||||
mutex_lock(&host_inode->i_mutex);
|
||||
err = host_file->f_op->fsync(host_file, host_dentry, datasync);
|
||||
mutex_unlock(&host_inode->i_mutex);
|
||||
}
|
||||
|
||||
err = vfs_fsync(host_file, host_file->f_path.dentry, datasync);
|
||||
if ( !err && !datasync ) {
|
||||
lock_kernel();
|
||||
err = venus_fsync(coda_inode->i_sb, coda_i2f(coda_inode));
|
||||
|
|
|
|||
|
|
@ -117,8 +117,6 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr)
|
|||
static inline void set_default_inode_attr(struct inode * inode, mode_t mode)
|
||||
{
|
||||
inode->i_mode = mode;
|
||||
inode->i_uid = 0;
|
||||
inode->i_gid = 0;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
}
|
||||
|
||||
|
|
@ -136,7 +134,6 @@ struct inode * configfs_new_inode(mode_t mode, struct configfs_dirent * sd)
|
|||
{
|
||||
struct inode * inode = new_inode(configfs_sb);
|
||||
if (inode) {
|
||||
inode->i_blocks = 0;
|
||||
inode->i_mapping->a_ops = &configfs_aops;
|
||||
inode->i_mapping->backing_dev_info = &configfs_backing_dev_info;
|
||||
inode->i_op = &configfs_inode_operations;
|
||||
|
|
|
|||
|
|
@ -83,8 +83,6 @@ static struct inode *get_cramfs_inode(struct super_block *sb,
|
|||
inode->i_op = &page_symlink_inode_operations;
|
||||
inode->i_data.a_ops = &cramfs_aops;
|
||||
} else {
|
||||
inode->i_size = 0;
|
||||
inode->i_blocks = 0;
|
||||
init_special_inode(inode, inode->i_mode,
|
||||
old_decode_dev(cramfs_inode->size));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,9 +37,6 @@ static struct inode *debugfs_get_inode(struct super_block *sb, int mode, dev_t d
|
|||
|
||||
if (inode) {
|
||||
inode->i_mode = mode;
|
||||
inode->i_uid = 0;
|
||||
inode->i_gid = 0;
|
||||
inode->i_blocks = 0;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
switch (mode & S_IFMT) {
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -189,8 +189,6 @@ static int mknod_ptmx(struct super_block *sb)
|
|||
}
|
||||
|
||||
inode->i_ino = 2;
|
||||
inode->i_uid = inode->i_gid = 0;
|
||||
inode->i_blocks = 0;
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
|
||||
|
||||
mode = S_IFCHR|opts->ptmxmode;
|
||||
|
|
@ -300,8 +298,6 @@ devpts_fill_super(struct super_block *s, void *data, int silent)
|
|||
goto free_fsi;
|
||||
inode->i_ino = 1;
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_blocks = 0;
|
||||
inode->i_uid = inode->i_gid = 0;
|
||||
inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR;
|
||||
inode->i_op = &simple_dir_inode_operations;
|
||||
inode->i_fop = &simple_dir_operations;
|
||||
|
|
|
|||
|
|
@ -275,18 +275,9 @@ static int ecryptfs_release(struct inode *inode, struct file *file)
|
|||
static int
|
||||
ecryptfs_fsync(struct file *file, struct dentry *dentry, int datasync)
|
||||
{
|
||||
struct file *lower_file = ecryptfs_file_to_lower(file);
|
||||
struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry);
|
||||
struct inode *lower_inode = lower_dentry->d_inode;
|
||||
int rc = -EINVAL;
|
||||
|
||||
if (lower_inode->i_fop->fsync) {
|
||||
mutex_lock(&lower_inode->i_mutex);
|
||||
rc = lower_inode->i_fop->fsync(lower_file, lower_dentry,
|
||||
datasync);
|
||||
mutex_unlock(&lower_inode->i_mutex);
|
||||
}
|
||||
return rc;
|
||||
return vfs_fsync(ecryptfs_file_to_lower(file),
|
||||
ecryptfs_dentry_to_lower(dentry),
|
||||
datasync);
|
||||
}
|
||||
|
||||
static int ecryptfs_fasync(int fd, struct file *file, int flag)
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue