diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-08 15:19:57 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-08 15:19:57 -0500 |
commit | 972b2c719990f91eb3b2310d44ef8a2d38955a14 (patch) | |
tree | b25a250ec5bec4b7b6355d214642d8b57c5cab32 /drivers/usb | |
parent | 02550d61f49266930e674286379d3601006b2893 (diff) | |
parent | c3aa077648e147783a7a53b409578234647db853 (diff) |
Merge branch 'for-linus2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
* 'for-linus2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (165 commits)
reiserfs: Properly display mount options in /proc/mounts
vfs: prevent remount read-only if pending removes
vfs: count unlinked inodes
vfs: protect remounting superblock read-only
vfs: keep list of mounts for each superblock
vfs: switch ->show_options() to struct dentry *
vfs: switch ->show_path() to struct dentry *
vfs: switch ->show_devname() to struct dentry *
vfs: switch ->show_stats to struct dentry *
switch security_path_chmod() to struct path *
vfs: prefer ->dentry->d_sb to ->mnt->mnt_sb
vfs: trim includes a bit
switch mnt_namespace ->root to struct mount
vfs: take /proc/*/mounts and friends to fs/proc_namespace.c
vfs: opencode mntget() mnt_set_mountpoint()
vfs: spread struct mount - remaining argument of next_mnt()
vfs: move fsnotify junk to struct mount
vfs: move mnt_devname
vfs: move mnt_list to struct mount
vfs: switch pnode.h macros to struct mount *
...
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/class/usblp.c | 2 | ||||
-rw-r--r-- | drivers/usb/core/file.c | 2 | ||||
-rw-r--r-- | drivers/usb/core/inode.c | 31 | ||||
-rw-r--r-- | drivers/usb/core/sysfs.c | 4 | ||||
-rw-r--r-- | drivers/usb/core/usb.c | 2 | ||||
-rw-r--r-- | drivers/usb/misc/iowarrior.c | 2 | ||||
-rw-r--r-- | drivers/usb/misc/legousbtower.c | 2 |
7 files changed, 21 insertions, 24 deletions
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c index 81ef2e207a8d..a68c1a63dc65 100644 --- a/drivers/usb/class/usblp.c +++ b/drivers/usb/class/usblp.c | |||
@@ -1045,7 +1045,7 @@ static const struct file_operations usblp_fops = { | |||
1045 | .llseek = noop_llseek, | 1045 | .llseek = noop_llseek, |
1046 | }; | 1046 | }; |
1047 | 1047 | ||
1048 | static char *usblp_devnode(struct device *dev, mode_t *mode) | 1048 | static char *usblp_devnode(struct device *dev, umode_t *mode) |
1049 | { | 1049 | { |
1050 | return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); | 1050 | return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); |
1051 | } | 1051 | } |
diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c index 99458c843d60..d95760de9e8b 100644 --- a/drivers/usb/core/file.c +++ b/drivers/usb/core/file.c | |||
@@ -66,7 +66,7 @@ static struct usb_class { | |||
66 | struct class *class; | 66 | struct class *class; |
67 | } *usb_class; | 67 | } *usb_class; |
68 | 68 | ||
69 | static char *usb_devnode(struct device *dev, mode_t *mode) | 69 | static char *usb_devnode(struct device *dev, umode_t *mode) |
70 | { | 70 | { |
71 | struct usb_class_driver *drv; | 71 | struct usb_class_driver *drv; |
72 | 72 | ||
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c index 2278dad886e2..9e186f3da839 100644 --- a/drivers/usb/core/inode.c +++ b/drivers/usb/core/inode.c | |||
@@ -65,7 +65,7 @@ static umode_t devmode = USBFS_DEFAULT_DEVMODE; | |||
65 | static umode_t busmode = USBFS_DEFAULT_BUSMODE; | 65 | static umode_t busmode = USBFS_DEFAULT_BUSMODE; |
66 | static umode_t listmode = USBFS_DEFAULT_LISTMODE; | 66 | static umode_t listmode = USBFS_DEFAULT_LISTMODE; |
67 | 67 | ||
68 | static int usbfs_show_options(struct seq_file *seq, struct vfsmount *mnt) | 68 | static int usbfs_show_options(struct seq_file *seq, struct dentry *root) |
69 | { | 69 | { |
70 | if (devuid != 0) | 70 | if (devuid != 0) |
71 | seq_printf(seq, ",devuid=%u", devuid); | 71 | seq_printf(seq, ",devuid=%u", devuid); |
@@ -264,21 +264,19 @@ static int remount(struct super_block *sb, int *flags, char *data) | |||
264 | return -EINVAL; | 264 | return -EINVAL; |
265 | } | 265 | } |
266 | 266 | ||
267 | if (usbfs_mount && usbfs_mount->mnt_sb) | 267 | if (usbfs_mount) |
268 | update_sb(usbfs_mount->mnt_sb); | 268 | update_sb(usbfs_mount->mnt_sb); |
269 | 269 | ||
270 | return 0; | 270 | return 0; |
271 | } | 271 | } |
272 | 272 | ||
273 | static struct inode *usbfs_get_inode (struct super_block *sb, int mode, dev_t dev) | 273 | static struct inode *usbfs_get_inode (struct super_block *sb, umode_t mode, dev_t dev) |
274 | { | 274 | { |
275 | struct inode *inode = new_inode(sb); | 275 | struct inode *inode = new_inode(sb); |
276 | 276 | ||
277 | if (inode) { | 277 | if (inode) { |
278 | inode->i_ino = get_next_ino(); | 278 | inode->i_ino = get_next_ino(); |
279 | inode->i_mode = mode; | 279 | inode_init_owner(inode, NULL, mode); |
280 | inode->i_uid = current_fsuid(); | ||
281 | inode->i_gid = current_fsgid(); | ||
282 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 280 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
283 | switch (mode & S_IFMT) { | 281 | switch (mode & S_IFMT) { |
284 | default: | 282 | default: |
@@ -300,7 +298,7 @@ static struct inode *usbfs_get_inode (struct super_block *sb, int mode, dev_t de | |||
300 | } | 298 | } |
301 | 299 | ||
302 | /* SMP-safe */ | 300 | /* SMP-safe */ |
303 | static int usbfs_mknod (struct inode *dir, struct dentry *dentry, int mode, | 301 | static int usbfs_mknod (struct inode *dir, struct dentry *dentry, umode_t mode, |
304 | dev_t dev) | 302 | dev_t dev) |
305 | { | 303 | { |
306 | struct inode *inode = usbfs_get_inode(dir->i_sb, mode, dev); | 304 | struct inode *inode = usbfs_get_inode(dir->i_sb, mode, dev); |
@@ -317,7 +315,7 @@ static int usbfs_mknod (struct inode *dir, struct dentry *dentry, int mode, | |||
317 | return error; | 315 | return error; |
318 | } | 316 | } |
319 | 317 | ||
320 | static int usbfs_mkdir (struct inode *dir, struct dentry *dentry, int mode) | 318 | static int usbfs_mkdir (struct inode *dir, struct dentry *dentry, umode_t mode) |
321 | { | 319 | { |
322 | int res; | 320 | int res; |
323 | 321 | ||
@@ -328,7 +326,7 @@ static int usbfs_mkdir (struct inode *dir, struct dentry *dentry, int mode) | |||
328 | return res; | 326 | return res; |
329 | } | 327 | } |
330 | 328 | ||
331 | static int usbfs_create (struct inode *dir, struct dentry *dentry, int mode) | 329 | static int usbfs_create (struct inode *dir, struct dentry *dentry, umode_t mode) |
332 | { | 330 | { |
333 | mode = (mode & S_IALLUGO) | S_IFREG; | 331 | mode = (mode & S_IALLUGO) | S_IFREG; |
334 | return usbfs_mknod (dir, dentry, mode, 0); | 332 | return usbfs_mknod (dir, dentry, mode, 0); |
@@ -489,7 +487,7 @@ static int usbfs_fill_super(struct super_block *sb, void *data, int silent) | |||
489 | * | 487 | * |
490 | * This function handles both regular files and directories. | 488 | * This function handles both regular files and directories. |
491 | */ | 489 | */ |
492 | static int fs_create_by_name (const char *name, mode_t mode, | 490 | static int fs_create_by_name (const char *name, umode_t mode, |
493 | struct dentry *parent, struct dentry **dentry) | 491 | struct dentry *parent, struct dentry **dentry) |
494 | { | 492 | { |
495 | int error = 0; | 493 | int error = 0; |
@@ -500,9 +498,8 @@ static int fs_create_by_name (const char *name, mode_t mode, | |||
500 | * have around. | 498 | * have around. |
501 | */ | 499 | */ |
502 | if (!parent ) { | 500 | if (!parent ) { |
503 | if (usbfs_mount && usbfs_mount->mnt_sb) { | 501 | if (usbfs_mount) |
504 | parent = usbfs_mount->mnt_sb->s_root; | 502 | parent = usbfs_mount->mnt_root; |
505 | } | ||
506 | } | 503 | } |
507 | 504 | ||
508 | if (!parent) { | 505 | if (!parent) { |
@@ -514,7 +511,7 @@ static int fs_create_by_name (const char *name, mode_t mode, | |||
514 | mutex_lock(&parent->d_inode->i_mutex); | 511 | mutex_lock(&parent->d_inode->i_mutex); |
515 | *dentry = lookup_one_len(name, parent, strlen(name)); | 512 | *dentry = lookup_one_len(name, parent, strlen(name)); |
516 | if (!IS_ERR(*dentry)) { | 513 | if (!IS_ERR(*dentry)) { |
517 | if ((mode & S_IFMT) == S_IFDIR) | 514 | if (S_ISDIR(mode)) |
518 | error = usbfs_mkdir (parent->d_inode, *dentry, mode); | 515 | error = usbfs_mkdir (parent->d_inode, *dentry, mode); |
519 | else | 516 | else |
520 | error = usbfs_create (parent->d_inode, *dentry, mode); | 517 | error = usbfs_create (parent->d_inode, *dentry, mode); |
@@ -525,7 +522,7 @@ static int fs_create_by_name (const char *name, mode_t mode, | |||
525 | return error; | 522 | return error; |
526 | } | 523 | } |
527 | 524 | ||
528 | static struct dentry *fs_create_file (const char *name, mode_t mode, | 525 | static struct dentry *fs_create_file (const char *name, umode_t mode, |
529 | struct dentry *parent, void *data, | 526 | struct dentry *parent, void *data, |
530 | const struct file_operations *fops, | 527 | const struct file_operations *fops, |
531 | uid_t uid, gid_t gid) | 528 | uid_t uid, gid_t gid) |
@@ -608,7 +605,7 @@ static int create_special_files (void) | |||
608 | 605 | ||
609 | ignore_mount = 0; | 606 | ignore_mount = 0; |
610 | 607 | ||
611 | parent = usbfs_mount->mnt_sb->s_root; | 608 | parent = usbfs_mount->mnt_root; |
612 | devices_usbfs_dentry = fs_create_file ("devices", | 609 | devices_usbfs_dentry = fs_create_file ("devices", |
613 | listmode | S_IFREG, parent, | 610 | listmode | S_IFREG, parent, |
614 | NULL, &usbfs_devices_fops, | 611 | NULL, &usbfs_devices_fops, |
@@ -662,7 +659,7 @@ static void usbfs_add_bus(struct usb_bus *bus) | |||
662 | 659 | ||
663 | sprintf (name, "%03d", bus->busnum); | 660 | sprintf (name, "%03d", bus->busnum); |
664 | 661 | ||
665 | parent = usbfs_mount->mnt_sb->s_root; | 662 | parent = usbfs_mount->mnt_root; |
666 | bus->usbfs_dentry = fs_create_file (name, busmode | S_IFDIR, parent, | 663 | bus->usbfs_dentry = fs_create_file (name, busmode | S_IFDIR, parent, |
667 | bus, NULL, busuid, busgid); | 664 | bus, NULL, busuid, busgid); |
668 | if (bus->usbfs_dentry == NULL) { | 665 | if (bus->usbfs_dentry == NULL) { |
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index 662c0cf3a3e1..9e491ca2e5c4 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c | |||
@@ -642,7 +642,7 @@ static struct attribute *dev_string_attrs[] = { | |||
642 | NULL | 642 | NULL |
643 | }; | 643 | }; |
644 | 644 | ||
645 | static mode_t dev_string_attrs_are_visible(struct kobject *kobj, | 645 | static umode_t dev_string_attrs_are_visible(struct kobject *kobj, |
646 | struct attribute *a, int n) | 646 | struct attribute *a, int n) |
647 | { | 647 | { |
648 | struct device *dev = container_of(kobj, struct device, kobj); | 648 | struct device *dev = container_of(kobj, struct device, kobj); |
@@ -877,7 +877,7 @@ static struct attribute *intf_assoc_attrs[] = { | |||
877 | NULL, | 877 | NULL, |
878 | }; | 878 | }; |
879 | 879 | ||
880 | static mode_t intf_assoc_attrs_are_visible(struct kobject *kobj, | 880 | static umode_t intf_assoc_attrs_are_visible(struct kobject *kobj, |
881 | struct attribute *a, int n) | 881 | struct attribute *a, int n) |
882 | { | 882 | { |
883 | struct device *dev = container_of(kobj, struct device, kobj); | 883 | struct device *dev = container_of(kobj, struct device, kobj); |
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 73cd90012ec5..1382c90d0834 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c | |||
@@ -326,7 +326,7 @@ static const struct dev_pm_ops usb_device_pm_ops = { | |||
326 | #endif /* CONFIG_PM */ | 326 | #endif /* CONFIG_PM */ |
327 | 327 | ||
328 | 328 | ||
329 | static char *usb_devnode(struct device *dev, mode_t *mode) | 329 | static char *usb_devnode(struct device *dev, umode_t *mode) |
330 | { | 330 | { |
331 | struct usb_device *usb_dev; | 331 | struct usb_device *usb_dev; |
332 | 332 | ||
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c index 7676b5b7e171..2453a39b4794 100644 --- a/drivers/usb/misc/iowarrior.c +++ b/drivers/usb/misc/iowarrior.c | |||
@@ -734,7 +734,7 @@ static const struct file_operations iowarrior_fops = { | |||
734 | .llseek = noop_llseek, | 734 | .llseek = noop_llseek, |
735 | }; | 735 | }; |
736 | 736 | ||
737 | static char *iowarrior_devnode(struct device *dev, mode_t *mode) | 737 | static char *iowarrior_devnode(struct device *dev, umode_t *mode) |
738 | { | 738 | { |
739 | return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); | 739 | return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); |
740 | } | 740 | } |
diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c index 16937da31cd8..575222042767 100644 --- a/drivers/usb/misc/legousbtower.c +++ b/drivers/usb/misc/legousbtower.c | |||
@@ -269,7 +269,7 @@ static const struct file_operations tower_fops = { | |||
269 | .llseek = tower_llseek, | 269 | .llseek = tower_llseek, |
270 | }; | 270 | }; |
271 | 271 | ||
272 | static char *legousbtower_devnode(struct device *dev, mode_t *mode) | 272 | static char *legousbtower_devnode(struct device *dev, umode_t *mode) |
273 | { | 273 | { |
274 | return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); | 274 | return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); |
275 | } | 275 | } |