Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/viro/vfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (87 commits)
  nilfs2: get rid of bd_mount_sem use from nilfs
  nilfs2: correct exclusion control in nilfs_remount function
  nilfs2: simplify remaining sget() use
  nilfs2: get rid of sget use for checking if current mount is present
  nilfs2: get rid of sget use for acquiring nilfs object
  nilfs2: remove meaningless EBUSY case from nilfs_get_sb function
  remove the call to ->write_super in __sync_filesystem
  nilfs2: call nilfs2_write_super from nilfs2_sync_fs
  jffs2: call jffs2_write_super from jffs2_sync_fs
  ufs: add ->sync_fs
  sysv: add ->sync_fs
  hfsplus: add ->sync_fs
  hfs: add ->sync_fs
  fat: add ->sync_fs
  ext2: add ->sync_fs
  exofs: add ->sync_fs
  bfs: add ->sync_fs
  affs: add ->sync_fs
  sanitize ->fsync() for affs
  repair bfs_write_inode(), switch bfs to simple_fsync()
  ...
  • Loading branch information
Linus Torvalds committed Jun 12, 2009
2 parents 875287c + aa7dfb8 commit 4b4f1d0
Show file tree
Hide file tree
Showing 147 changed files with 1,707 additions and 1,834 deletions.
3 changes: 0 additions & 3 deletions arch/alpha/kernel/osf_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,6 @@ SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, char __user *, path,
int retval = -EINVAL;
char *name;

lock_kernel();

name = getname(path);
retval = PTR_ERR(name);
if (IS_ERR(name))
Expand All @@ -392,7 +390,6 @@ SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, char __user *, path,
}
putname(name);
out:
unlock_kernel();
return retval;
}

Expand Down
5 changes: 3 additions & 2 deletions drivers/ieee1394/dv1394.c
Original file line number Diff line number Diff line change
Expand Up @@ -1789,12 +1789,13 @@ static int dv1394_open(struct inode *inode, struct file *file)
} else {
/* look up the card by ID */
unsigned long flags;
int idx = ieee1394_file_to_instance(file);

spin_lock_irqsave(&dv1394_cards_lock, flags);
if (!list_empty(&dv1394_cards)) {
struct video_card *p;
list_for_each_entry(p, &dv1394_cards, list) {
if ((p->id) == ieee1394_file_to_instance(file)) {
if ((p->id) == idx) {
video = p;
break;
}
Expand All @@ -1803,7 +1804,7 @@ static int dv1394_open(struct inode *inode, struct file *file)
spin_unlock_irqrestore(&dv1394_cards_lock, flags);

if (!video) {
debug_printk("dv1394: OHCI card %d not found", ieee1394_file_to_instance(file));
debug_printk("dv1394: OHCI card %d not found", idx);
return -ENODEV;
}

Expand Down
6 changes: 5 additions & 1 deletion drivers/ieee1394/ieee1394_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <linux/fs.h>
#include <linux/list.h>
#include <linux/types.h>
#include <linux/cdev.h>
#include <asm/atomic.h>

#include "hosts.h"
Expand Down Expand Up @@ -155,7 +156,10 @@ void hpsb_packet_received(struct hpsb_host *host, quadlet_t *data, size_t size,
*/
static inline unsigned char ieee1394_file_to_instance(struct file *file)
{
return file->f_path.dentry->d_inode->i_cindex;
int idx = cdev_index(file->f_path.dentry->d_inode);
if (idx < 0)
idx = 0;
return idx;
}

extern int hpsb_disable_irm;
Expand Down
5 changes: 5 additions & 0 deletions drivers/usb/core/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <linux/parser.h>
#include <linux/notifier.h>
#include <linux/seq_file.h>
#include <linux/smp_lock.h>
#include <asm/byteorder.h>
#include "usb.h"
#include "hcd.h"
Expand Down Expand Up @@ -265,9 +266,13 @@ static int remount(struct super_block *sb, int *flags, char *data)
return -EINVAL;
}

lock_kernel();

if (usbfs_mount && usbfs_mount->mnt_sb)
update_sb(usbfs_mount->mnt_sb);

unlock_kernel();

return 0;
}

Expand Down
4 changes: 3 additions & 1 deletion fs/adfs/adfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ struct adfs_dir_ops {
int (*update)(struct adfs_dir *dir, struct object_info *obj);
int (*create)(struct adfs_dir *dir, struct object_info *obj);
int (*remove)(struct adfs_dir *dir, struct object_info *obj);
int (*sync)(struct adfs_dir *dir);
void (*free)(struct adfs_dir *dir);
};

Expand Down Expand Up @@ -90,7 +91,8 @@ extern const struct dentry_operations adfs_dentry_operations;
extern struct adfs_dir_ops adfs_f_dir_ops;
extern struct adfs_dir_ops adfs_fplus_dir_ops;

extern int adfs_dir_update(struct super_block *sb, struct object_info *obj);
extern int adfs_dir_update(struct super_block *sb, struct object_info *obj,
int wait);

/* file.c */
extern const struct inode_operations adfs_file_inode_operations;
Expand Down
10 changes: 8 additions & 2 deletions fs/adfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ adfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
}

int
adfs_dir_update(struct super_block *sb, struct object_info *obj)
adfs_dir_update(struct super_block *sb, struct object_info *obj, int wait)
{
int ret = -EINVAL;
#ifdef CONFIG_ADFS_FS_RW
Expand All @@ -106,6 +106,12 @@ adfs_dir_update(struct super_block *sb, struct object_info *obj)
ret = ops->update(&dir, obj);
write_unlock(&adfs_dir_lock);

if (wait) {
int err = ops->sync(&dir);
if (!ret)
ret = err;
}

ops->free(&dir);
out:
#endif
Expand Down Expand Up @@ -199,7 +205,7 @@ const struct file_operations adfs_dir_operations = {
.read = generic_read_dir,
.llseek = generic_file_llseek,
.readdir = adfs_readdir,
.fsync = file_fsync,
.fsync = simple_fsync,
};

static int
Expand Down
17 changes: 17 additions & 0 deletions fs/adfs/dir_f.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,22 @@ adfs_f_update(struct adfs_dir *dir, struct object_info *obj)
#endif
}

static int
adfs_f_sync(struct adfs_dir *dir)
{
int err = 0;
int i;

for (i = dir->nr_buffers - 1; i >= 0; i--) {
struct buffer_head *bh = dir->bh[i];
sync_dirty_buffer(bh);
if (buffer_req(bh) && !buffer_uptodate(bh))
err = -EIO;
}

return err;
}

static void
adfs_f_free(struct adfs_dir *dir)
{
Expand All @@ -456,5 +472,6 @@ struct adfs_dir_ops adfs_f_dir_ops = {
.setpos = adfs_f_setpos,
.getnext = adfs_f_getnext,
.update = adfs_f_update,
.sync = adfs_f_sync,
.free = adfs_f_free
};
17 changes: 17 additions & 0 deletions fs/adfs/dir_fplus.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,22 @@ adfs_fplus_getnext(struct adfs_dir *dir, struct object_info *obj)
return ret;
}

static int
adfs_fplus_sync(struct adfs_dir *dir)
{
int err = 0;
int i;

for (i = dir->nr_buffers - 1; i >= 0; i--) {
struct buffer_head *bh = dir->bh[i];
sync_dirty_buffer(bh);
if (buffer_req(bh) && !buffer_uptodate(bh))
err = -EIO;
}

return err;
}

static void
adfs_fplus_free(struct adfs_dir *dir)
{
Expand All @@ -175,5 +191,6 @@ struct adfs_dir_ops adfs_fplus_dir_ops = {
.read = adfs_fplus_read,
.setpos = adfs_fplus_setpos,
.getnext = adfs_fplus_getnext,
.sync = adfs_fplus_sync,
.free = adfs_fplus_free
};
2 changes: 1 addition & 1 deletion fs/adfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const struct file_operations adfs_file_operations = {
.read = do_sync_read,
.aio_read = generic_file_aio_read,
.mmap = generic_file_mmap,
.fsync = file_fsync,
.fsync = simple_fsync,
.write = do_sync_write,
.aio_write = generic_file_aio_write,
.splice_read = generic_file_splice_read,
Expand Down
4 changes: 2 additions & 2 deletions fs/adfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ adfs_notify_change(struct dentry *dentry, struct iattr *attr)
* The adfs-specific inode data has already been updated by
* adfs_notify_change()
*/
int adfs_write_inode(struct inode *inode, int unused)
int adfs_write_inode(struct inode *inode, int wait)
{
struct super_block *sb = inode->i_sb;
struct object_info obj;
Expand All @@ -391,7 +391,7 @@ int adfs_write_inode(struct inode *inode, int unused)
obj.attr = ADFS_I(inode)->attr;
obj.size = inode->i_size;

ret = adfs_dir_update(sb, &obj);
ret = adfs_dir_update(sb, &obj, wait);
unlock_kernel();
return ret;
}
Expand Down
2 changes: 1 addition & 1 deletion fs/adfs/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static DEFINE_RWLOCK(adfs_map_lock);
#define GET_FRAG_ID(_map,_start,_idmask) \
({ \
unsigned char *_m = _map + (_start >> 3); \
u32 _frag = get_unaligned((u32 *)_m); \
u32 _frag = get_unaligned_le32(_m); \
_frag >>= (_start & 7); \
_frag & _idmask; \
})
Expand Down
4 changes: 4 additions & 0 deletions fs/adfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,15 @@ static void adfs_put_super(struct super_block *sb)
int i;
struct adfs_sb_info *asb = ADFS_SB(sb);

lock_kernel();

for (i = 0; i < asb->s_map_size; i++)
brelse(asb->s_map[i].dm_bh);
kfree(asb->s_map);
kfree(asb);
sb->s_fs_info = NULL;

unlock_kernel();
}

static int adfs_show_options(struct seq_file *seq, struct vfsmount *mnt)
Expand Down
1 change: 1 addition & 0 deletions fs/affs/affs.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ extern int affs_add_entry(struct inode *dir, struct inode *inode, struct dent

void affs_free_prealloc(struct inode *inode);
extern void affs_truncate(struct inode *);
int affs_file_fsync(struct file *, struct dentry *, int);

/* dir.c */

Expand Down
2 changes: 1 addition & 1 deletion fs/affs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const struct file_operations affs_dir_operations = {
.read = generic_read_dir,
.llseek = generic_file_llseek,
.readdir = affs_readdir,
.fsync = file_fsync,
.fsync = affs_file_fsync,
};

/*
Expand Down
14 changes: 13 additions & 1 deletion fs/affs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const struct file_operations affs_file_operations = {
.mmap = generic_file_mmap,
.open = affs_file_open,
.release = affs_file_release,
.fsync = file_fsync,
.fsync = affs_file_fsync,
.splice_read = generic_file_splice_read,
};

Expand Down Expand Up @@ -915,3 +915,15 @@ affs_truncate(struct inode *inode)
}
affs_free_prealloc(inode);
}

int affs_file_fsync(struct file *filp, struct dentry *dentry, int datasync)
{
struct inode * inode = dentry->d_inode;
int ret, err;

ret = write_inode_now(inode, 0);
err = sync_blockdev(inode->i_sb->s_bdev);
if (!ret)
ret = err;
return ret;
}
Loading

0 comments on commit 4b4f1d0

Please sign in to comment.