aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-08 15:19:57 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-08 15:19:57 -0500
commit972b2c719990f91eb3b2310d44ef8a2d38955a14 (patch)
treeb25a250ec5bec4b7b6355d214642d8b57c5cab32 /drivers
parent02550d61f49266930e674286379d3601006b2893 (diff)
parentc3aa077648e147783a7a53b409578234647db853 (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')
-rw-r--r--drivers/acpi/battery.c2
-rw-r--r--drivers/acpi/ec_sys.c2
-rw-r--r--drivers/base/core.c4
-rw-r--r--drivers/base/devtmpfs.c8
-rw-r--r--drivers/block/amiflop.c2
-rw-r--r--drivers/block/aoe/aoechr.c2
-rw-r--r--drivers/block/brd.c9
-rw-r--r--drivers/block/floppy.c1
-rw-r--r--drivers/block/loop.c1
-rw-r--r--drivers/block/pktcdvd.c2
-rw-r--r--drivers/cdrom/cdrom.c1
-rw-r--r--drivers/char/mem.c4
-rw-r--r--drivers/char/misc.c2
-rw-r--r--drivers/char/raw.c2
-rw-r--r--drivers/char/tile-srom.c2
-rw-r--r--drivers/firmware/iscsi_ibft.c12
-rw-r--r--drivers/gpu/drm/drm_sysfs.c2
-rw-r--r--drivers/hid/usbhid/hiddev.c2
-rw-r--r--drivers/hwmon/dme1737.c6
-rw-r--r--drivers/hwmon/jc42.c2
-rw-r--r--drivers/hwmon/max1668.c4
-rw-r--r--drivers/hwmon/max6650.c2
-rw-r--r--drivers/hwmon/tmp421.c2
-rw-r--r--drivers/infiniband/core/cm.c2
-rw-r--r--drivers/infiniband/core/user_mad.c2
-rw-r--r--drivers/infiniband/core/uverbs_main.c2
-rw-r--r--drivers/infiniband/hw/ipath/ipath_fs.c6
-rw-r--r--drivers/infiniband/hw/qib/qib_fs.c6
-rw-r--r--drivers/infiniband/ulp/iser/iscsi_iser.c2
-rw-r--r--drivers/input/input.c2
-rw-r--r--drivers/input/touchscreen/ad7877.c4
-rw-r--r--drivers/input/touchscreen/tsc2005.c4
-rw-r--r--drivers/md/dm.c1
-rw-r--r--drivers/md/md.c3
-rw-r--r--drivers/media/dvb/ddbridge/ddbridge-core.c2
-rw-r--r--drivers/media/dvb/dvb-core/dvbdev.c2
-rw-r--r--drivers/media/rc/rc-main.c2
-rw-r--r--drivers/message/i2o/i2o_proc.c2
-rw-r--r--drivers/misc/sgi-gru/gruprocfs.c2
-rw-r--r--drivers/mmc/card/mmc_test.c2
-rw-r--r--drivers/mtd/devices/block2mtd.c1
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c2
-rw-r--r--drivers/net/wireless/ath/carl9170/debug.c2
-rw-r--r--drivers/net/wireless/libertas/debugfs.c2
-rw-r--r--drivers/pci/pci-label.c4
-rw-r--r--drivers/platform/x86/asus-laptop.c2
-rw-r--r--drivers/platform/x86/asus-wmi.c4
-rw-r--r--drivers/platform/x86/asus_acpi.c4
-rw-r--r--drivers/platform/x86/ideapad-laptop.c2
-rw-r--r--drivers/platform/x86/intel_menlow.c2
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c4
-rw-r--r--drivers/power/power_supply_sysfs.c4
-rw-r--r--drivers/s390/block/dasd.c5
-rw-r--r--drivers/scsi/be2iscsi/be_iscsi.c2
-rw-r--r--drivers/scsi/be2iscsi/be_iscsi.h2
-rw-r--r--drivers/scsi/be2iscsi/be_main.c12
-rw-r--r--drivers/scsi/bfa/bfad_debugfs.c2
-rw-r--r--drivers/scsi/bnx2i/bnx2i_iscsi.c2
-rw-r--r--drivers/scsi/cxgbi/libcxgbi.c2
-rw-r--r--drivers/scsi/cxgbi/libcxgbi.h2
-rw-r--r--drivers/scsi/iscsi_boot_sysfs.c14
-rw-r--r--drivers/scsi/iscsi_tcp.c2
-rw-r--r--drivers/scsi/qla4xxx/ql4_os.c10
-rw-r--r--drivers/scsi/scsi_transport_iscsi.c8
-rw-r--r--drivers/scsi/scsi_transport_spi.c2
-rw-r--r--drivers/scsi/scsicam.c1
-rw-r--r--drivers/scsi/sg.c7
-rw-r--r--drivers/staging/iio/adc/ad7192.c4
-rw-r--r--drivers/staging/iio/adc/ad7606_core.c4
-rw-r--r--drivers/staging/iio/dac/ad5446.c4
-rw-r--r--drivers/staging/iio/dds/ad9834.c4
-rw-r--r--drivers/staging/pohmelfs/dir.c11
-rw-r--r--drivers/staging/pohmelfs/inode.c9
-rw-r--r--drivers/staging/pohmelfs/netfs.h2
-rw-r--r--drivers/tty/sysrq.c2
-rw-r--r--drivers/tty/tty_io.c2
-rw-r--r--drivers/usb/class/usblp.c2
-rw-r--r--drivers/usb/core/file.c2
-rw-r--r--drivers/usb/core/inode.c31
-rw-r--r--drivers/usb/core/sysfs.c4
-rw-r--r--drivers/usb/core/usb.c2
-rw-r--r--drivers/usb/misc/iowarrior.c2
-rw-r--r--drivers/usb/misc/legousbtower.c2
83 files changed, 151 insertions, 164 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 7711d94a0409..86933ca8b472 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -873,7 +873,7 @@ DECLARE_FILE_FUNCTIONS(alarm);
873 873
874static const struct battery_file { 874static const struct battery_file {
875 struct file_operations ops; 875 struct file_operations ops;
876 mode_t mode; 876 umode_t mode;
877 const char *name; 877 const char *name;
878} acpi_battery_file[] = { 878} acpi_battery_file[] = {
879 FILE_DESCRIPTION_RO(info), 879 FILE_DESCRIPTION_RO(info),
diff --git a/drivers/acpi/ec_sys.c b/drivers/acpi/ec_sys.c
index 6c47ae9793a7..b258cab9061c 100644
--- a/drivers/acpi/ec_sys.c
+++ b/drivers/acpi/ec_sys.c
@@ -105,7 +105,7 @@ int acpi_ec_add_debugfs(struct acpi_ec *ec, unsigned int ec_device_count)
105{ 105{
106 struct dentry *dev_dir; 106 struct dentry *dev_dir;
107 char name[64]; 107 char name[64];
108 mode_t mode = 0400; 108 umode_t mode = 0400;
109 109
110 if (ec_device_count == 0) { 110 if (ec_device_count == 0) {
111 acpi_ec_debugfs_dir = debugfs_create_dir("ec", NULL); 111 acpi_ec_debugfs_dir = debugfs_create_dir("ec", NULL);
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 4dac58aa4a0a..4a67cc0c8b37 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -248,7 +248,7 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj,
248 if (MAJOR(dev->devt)) { 248 if (MAJOR(dev->devt)) {
249 const char *tmp; 249 const char *tmp;
250 const char *name; 250 const char *name;
251 mode_t mode = 0; 251 umode_t mode = 0;
252 252
253 add_uevent_var(env, "MAJOR=%u", MAJOR(dev->devt)); 253 add_uevent_var(env, "MAJOR=%u", MAJOR(dev->devt));
254 add_uevent_var(env, "MINOR=%u", MINOR(dev->devt)); 254 add_uevent_var(env, "MINOR=%u", MINOR(dev->devt));
@@ -1235,7 +1235,7 @@ static struct device *next_device(struct klist_iter *i)
1235 * freed by the caller. 1235 * freed by the caller.
1236 */ 1236 */
1237const char *device_get_devnode(struct device *dev, 1237const char *device_get_devnode(struct device *dev,
1238 mode_t *mode, const char **tmp) 1238 umode_t *mode, const char **tmp)
1239{ 1239{
1240 char *s; 1240 char *s;
1241 1241
diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
index 2bb4bff3af7d..8493536ea55b 100644
--- a/drivers/base/devtmpfs.c
+++ b/drivers/base/devtmpfs.c
@@ -40,7 +40,7 @@ static struct req {
40 struct completion done; 40 struct completion done;
41 int err; 41 int err;
42 const char *name; 42 const char *name;
43 mode_t mode; /* 0 => delete */ 43 umode_t mode; /* 0 => delete */
44 struct device *dev; 44 struct device *dev;
45} *requests; 45} *requests;
46 46
@@ -142,7 +142,7 @@ int devtmpfs_delete_node(struct device *dev)
142 return req.err; 142 return req.err;
143} 143}
144 144
145static int dev_mkdir(const char *name, mode_t mode) 145static int dev_mkdir(const char *name, umode_t mode)
146{ 146{
147 struct dentry *dentry; 147 struct dentry *dentry;
148 struct path path; 148 struct path path;
@@ -189,7 +189,7 @@ static int create_path(const char *nodepath)
189 return err; 189 return err;
190} 190}
191 191
192static int handle_create(const char *nodename, mode_t mode, struct device *dev) 192static int handle_create(const char *nodename, umode_t mode, struct device *dev)
193{ 193{
194 struct dentry *dentry; 194 struct dentry *dentry;
195 struct path path; 195 struct path path;
@@ -378,7 +378,7 @@ int devtmpfs_mount(const char *mntdir)
378 378
379static DECLARE_COMPLETION(setup_done); 379static DECLARE_COMPLETION(setup_done);
380 380
381static int handle(const char *name, mode_t mode, struct device *dev) 381static int handle(const char *name, umode_t mode, struct device *dev)
382{ 382{
383 if (mode) 383 if (mode)
384 return handle_create(name, mode, dev); 384 return handle_create(name, mode, dev);
diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c
index 8eba86bba599..386146d792d1 100644
--- a/drivers/block/amiflop.c
+++ b/drivers/block/amiflop.c
@@ -63,7 +63,7 @@
63#include <linux/mutex.h> 63#include <linux/mutex.h>
64#include <linux/amifdreg.h> 64#include <linux/amifdreg.h>
65#include <linux/amifd.h> 65#include <linux/amifd.h>
66#include <linux/buffer_head.h> 66#include <linux/fs.h>
67#include <linux/blkdev.h> 67#include <linux/blkdev.h>
68#include <linux/elevator.h> 68#include <linux/elevator.h>
69#include <linux/interrupt.h> 69#include <linux/interrupt.h>
diff --git a/drivers/block/aoe/aoechr.c b/drivers/block/aoe/aoechr.c
index 5f8e39c43ae5..e86d2062a164 100644
--- a/drivers/block/aoe/aoechr.c
+++ b/drivers/block/aoe/aoechr.c
@@ -270,7 +270,7 @@ static const struct file_operations aoe_fops = {
270 .llseek = noop_llseek, 270 .llseek = noop_llseek,
271}; 271};
272 272
273static char *aoe_devnode(struct device *dev, mode_t *mode) 273static char *aoe_devnode(struct device *dev, umode_t *mode)
274{ 274{
275 return kasprintf(GFP_KERNEL, "etherd/%s", dev_name(dev)); 275 return kasprintf(GFP_KERNEL, "etherd/%s", dev_name(dev));
276} 276}
diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index d22119d49e53..ec246437f5a4 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -17,7 +17,7 @@
17#include <linux/highmem.h> 17#include <linux/highmem.h>
18#include <linux/mutex.h> 18#include <linux/mutex.h>
19#include <linux/radix-tree.h> 19#include <linux/radix-tree.h>
20#include <linux/buffer_head.h> /* invalidate_bh_lrus() */ 20#include <linux/fs.h>
21#include <linux/slab.h> 21#include <linux/slab.h>
22 22
23#include <asm/uaccess.h> 23#include <asm/uaccess.h>
@@ -402,14 +402,13 @@ static int brd_ioctl(struct block_device *bdev, fmode_t mode,
402 error = -EBUSY; 402 error = -EBUSY;
403 if (bdev->bd_openers <= 1) { 403 if (bdev->bd_openers <= 1) {
404 /* 404 /*
405 * Invalidate the cache first, so it isn't written 405 * Kill the cache first, so it isn't written back to the
406 * back to the device. 406 * device.
407 * 407 *
408 * Another thread might instantiate more buffercache here, 408 * Another thread might instantiate more buffercache here,
409 * but there is not much we can do to close that race. 409 * but there is not much we can do to close that race.
410 */ 410 */
411 invalidate_bh_lrus(); 411 kill_bdev(bdev);
412 truncate_inode_pages(bdev->bd_inode->i_mapping, 0);
413 brd_free_pages(brd); 412 brd_free_pages(brd);
414 error = 0; 413 error = 0;
415 } 414 }
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 9955a53733b2..510fb10ec45a 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -188,7 +188,6 @@ static int print_unex = 1;
188#include <linux/init.h> 188#include <linux/init.h>
189#include <linux/platform_device.h> 189#include <linux/platform_device.h>
190#include <linux/mod_devicetable.h> 190#include <linux/mod_devicetable.h>
191#include <linux/buffer_head.h> /* for invalidate_buffers() */
192#include <linux/mutex.h> 191#include <linux/mutex.h>
193#include <linux/io.h> 192#include <linux/io.h>
194#include <linux/uaccess.h> 193#include <linux/uaccess.h>
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 1e888c9e85b3..f00257782fcc 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -69,7 +69,6 @@
69#include <linux/freezer.h> 69#include <linux/freezer.h>
70#include <linux/mutex.h> 70#include <linux/mutex.h>
71#include <linux/writeback.h> 71#include <linux/writeback.h>
72#include <linux/buffer_head.h> /* for invalidate_bdev() */
73#include <linux/completion.h> 72#include <linux/completion.h>
74#include <linux/highmem.h> 73#include <linux/highmem.h>
75#include <linux/kthread.h> 74#include <linux/kthread.h>
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index a63b0a2b7805..d59edeabd93f 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -2817,7 +2817,7 @@ static const struct block_device_operations pktcdvd_ops = {
2817 .check_events = pkt_check_events, 2817 .check_events = pkt_check_events,
2818}; 2818};
2819 2819
2820static char *pktcdvd_devnode(struct gendisk *gd, mode_t *mode) 2820static char *pktcdvd_devnode(struct gendisk *gd, umode_t *mode)
2821{ 2821{
2822 return kasprintf(GFP_KERNEL, "pktcdvd/%s", gd->disk_name); 2822 return kasprintf(GFP_KERNEL, "pktcdvd/%s", gd->disk_name);
2823} 2823}
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index f997c27d79e2..2118211aff99 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -267,7 +267,6 @@
267 267
268#include <linux/module.h> 268#include <linux/module.h>
269#include <linux/fs.h> 269#include <linux/fs.h>
270#include <linux/buffer_head.h>
271#include <linux/major.h> 270#include <linux/major.h>
272#include <linux/types.h> 271#include <linux/types.h>
273#include <linux/errno.h> 272#include <linux/errno.h>
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 145179033716..d6e9d081c8b1 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -847,7 +847,7 @@ static const struct file_operations kmsg_fops = {
847 847
848static const struct memdev { 848static const struct memdev {
849 const char *name; 849 const char *name;
850 mode_t mode; 850 umode_t mode;
851 const struct file_operations *fops; 851 const struct file_operations *fops;
852 struct backing_dev_info *dev_info; 852 struct backing_dev_info *dev_info;
853} devlist[] = { 853} devlist[] = {
@@ -901,7 +901,7 @@ static const struct file_operations memory_fops = {
901 .llseek = noop_llseek, 901 .llseek = noop_llseek,
902}; 902};
903 903
904static char *mem_devnode(struct device *dev, mode_t *mode) 904static char *mem_devnode(struct device *dev, umode_t *mode)
905{ 905{
906 if (mode && devlist[MINOR(dev->devt)].mode) 906 if (mode && devlist[MINOR(dev->devt)].mode)
907 *mode = devlist[MINOR(dev->devt)].mode; 907 *mode = devlist[MINOR(dev->devt)].mode;
diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index 778273c93242..522136d40843 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -258,7 +258,7 @@ int misc_deregister(struct miscdevice *misc)
258EXPORT_SYMBOL(misc_register); 258EXPORT_SYMBOL(misc_register);
259EXPORT_SYMBOL(misc_deregister); 259EXPORT_SYMBOL(misc_deregister);
260 260
261static char *misc_devnode(struct device *dev, mode_t *mode) 261static char *misc_devnode(struct device *dev, umode_t *mode)
262{ 262{
263 struct miscdevice *c = dev_get_drvdata(dev); 263 struct miscdevice *c = dev_get_drvdata(dev);
264 264
diff --git a/drivers/char/raw.c b/drivers/char/raw.c
index b6de2c047145..54a3a6d09819 100644
--- a/drivers/char/raw.c
+++ b/drivers/char/raw.c
@@ -308,7 +308,7 @@ static const struct file_operations raw_ctl_fops = {
308 308
309static struct cdev raw_cdev; 309static struct cdev raw_cdev;
310 310
311static char *raw_devnode(struct device *dev, mode_t *mode) 311static char *raw_devnode(struct device *dev, umode_t *mode)
312{ 312{
313 return kasprintf(GFP_KERNEL, "raw/%s", dev_name(dev)); 313 return kasprintf(GFP_KERNEL, "raw/%s", dev_name(dev));
314} 314}
diff --git a/drivers/char/tile-srom.c b/drivers/char/tile-srom.c
index cf3ee008dca2..4dc019408fac 100644
--- a/drivers/char/tile-srom.c
+++ b/drivers/char/tile-srom.c
@@ -329,7 +329,7 @@ static struct device_attribute srom_dev_attrs[] = {
329 __ATTR_NULL 329 __ATTR_NULL
330}; 330};
331 331
332static char *srom_devnode(struct device *dev, mode_t *mode) 332static char *srom_devnode(struct device *dev, umode_t *mode)
333{ 333{
334 *mode = S_IRUGO | S_IWUSR; 334 *mode = S_IRUGO | S_IWUSR;
335 return kasprintf(GFP_KERNEL, "srom/%s", dev_name(dev)); 335 return kasprintf(GFP_KERNEL, "srom/%s", dev_name(dev));
diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
index 2cce44a1d7d0..3ee852c9925b 100644
--- a/drivers/firmware/iscsi_ibft.c
+++ b/drivers/firmware/iscsi_ibft.c
@@ -433,11 +433,11 @@ static int __init ibft_check_device(void)
433 * Helper routiners to check to determine if the entry is valid 433 * Helper routiners to check to determine if the entry is valid
434 * in the proper iBFT structure. 434 * in the proper iBFT structure.
435 */ 435 */
436static mode_t ibft_check_nic_for(void *data, int type) 436static umode_t ibft_check_nic_for(void *data, int type)
437{ 437{
438 struct ibft_kobject *entry = data; 438 struct ibft_kobject *entry = data;
439 struct ibft_nic *nic = entry->nic; 439 struct ibft_nic *nic = entry->nic;
440 mode_t rc = 0; 440 umode_t rc = 0;
441 441
442 switch (type) { 442 switch (type) {
443 case ISCSI_BOOT_ETH_INDEX: 443 case ISCSI_BOOT_ETH_INDEX:
@@ -488,11 +488,11 @@ static mode_t ibft_check_nic_for(void *data, int type)
488 return rc; 488 return rc;
489} 489}
490 490
491static mode_t __init ibft_check_tgt_for(void *data, int type) 491static umode_t __init ibft_check_tgt_for(void *data, int type)
492{ 492{
493 struct ibft_kobject *entry = data; 493 struct ibft_kobject *entry = data;
494 struct ibft_tgt *tgt = entry->tgt; 494 struct ibft_tgt *tgt = entry->tgt;
495 mode_t rc = 0; 495 umode_t rc = 0;
496 496
497 switch (type) { 497 switch (type) {
498 case ISCSI_BOOT_TGT_INDEX: 498 case ISCSI_BOOT_TGT_INDEX:
@@ -524,11 +524,11 @@ static mode_t __init ibft_check_tgt_for(void *data, int type)
524 return rc; 524 return rc;
525} 525}
526 526
527static mode_t __init ibft_check_initiator_for(void *data, int type) 527static umode_t __init ibft_check_initiator_for(void *data, int type)
528{ 528{
529 struct ibft_kobject *entry = data; 529 struct ibft_kobject *entry = data;
530 struct ibft_initiator *init = entry->initiator; 530 struct ibft_initiator *init = entry->initiator;
531 mode_t rc = 0; 531 umode_t rc = 0;
532 532
533 switch (type) { 533 switch (type) {
534 case ISCSI_BOOT_INI_INDEX: 534 case ISCSI_BOOT_INI_INDEX:
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
index 0f9ef9bf6730..62c3675045ac 100644
--- a/drivers/gpu/drm/drm_sysfs.c
+++ b/drivers/gpu/drm/drm_sysfs.c
@@ -72,7 +72,7 @@ static int drm_class_resume(struct device *dev)
72 return 0; 72 return 0;
73} 73}
74 74
75static char *drm_devnode(struct device *dev, mode_t *mode) 75static char *drm_devnode(struct device *dev, umode_t *mode)
76{ 76{
77 return kasprintf(GFP_KERNEL, "dri/%s", dev_name(dev)); 77 return kasprintf(GFP_KERNEL, "dri/%s", dev_name(dev));
78} 78}
diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c
index 4ef02b269a71..7c297d305d5d 100644
--- a/drivers/hid/usbhid/hiddev.c
+++ b/drivers/hid/usbhid/hiddev.c
@@ -859,7 +859,7 @@ static const struct file_operations hiddev_fops = {
859 .llseek = noop_llseek, 859 .llseek = noop_llseek,
860}; 860};
861 861
862static char *hiddev_devnode(struct device *dev, mode_t *mode) 862static char *hiddev_devnode(struct device *dev, umode_t *mode)
863{ 863{
864 return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); 864 return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev));
865} 865}
diff --git a/drivers/hwmon/dme1737.c b/drivers/hwmon/dme1737.c
index d9c592713919..d9803958e49f 100644
--- a/drivers/hwmon/dme1737.c
+++ b/drivers/hwmon/dme1737.c
@@ -1223,7 +1223,7 @@ static ssize_t show_pwm(struct device *dev, struct device_attribute *attr,
1223} 1223}
1224 1224
1225static struct attribute *dme1737_pwm_chmod_attr[]; 1225static struct attribute *dme1737_pwm_chmod_attr[];
1226static void dme1737_chmod_file(struct device*, struct attribute*, mode_t); 1226static void dme1737_chmod_file(struct device*, struct attribute*, umode_t);
1227 1227
1228static ssize_t set_pwm(struct device *dev, struct device_attribute *attr, 1228static ssize_t set_pwm(struct device *dev, struct device_attribute *attr,
1229 const char *buf, size_t count) 1229 const char *buf, size_t count)
@@ -1961,7 +1961,7 @@ static inline void dme1737_sio_outb(int sio_cip, int reg, int val)
1961static int dme1737_i2c_get_features(int, struct dme1737_data*); 1961static int dme1737_i2c_get_features(int, struct dme1737_data*);
1962 1962
1963static void dme1737_chmod_file(struct device *dev, 1963static void dme1737_chmod_file(struct device *dev,
1964 struct attribute *attr, mode_t mode) 1964 struct attribute *attr, umode_t mode)
1965{ 1965{
1966 if (sysfs_chmod_file(&dev->kobj, attr, mode)) { 1966 if (sysfs_chmod_file(&dev->kobj, attr, mode)) {
1967 dev_warn(dev, "Failed to change permissions of %s.\n", 1967 dev_warn(dev, "Failed to change permissions of %s.\n",
@@ -1971,7 +1971,7 @@ static void dme1737_chmod_file(struct device *dev,
1971 1971
1972static void dme1737_chmod_group(struct device *dev, 1972static void dme1737_chmod_group(struct device *dev,
1973 const struct attribute_group *group, 1973 const struct attribute_group *group,
1974 mode_t mode) 1974 umode_t mode)
1975{ 1975{
1976 struct attribute **attr; 1976 struct attribute **attr;
1977 1977
diff --git a/drivers/hwmon/jc42.c b/drivers/hwmon/jc42.c
index 2d3d72805ff4..1a92951f4031 100644
--- a/drivers/hwmon/jc42.c
+++ b/drivers/hwmon/jc42.c
@@ -413,7 +413,7 @@ static struct attribute *jc42_attributes[] = {
413 NULL 413 NULL
414}; 414};
415 415
416static mode_t jc42_attribute_mode(struct kobject *kobj, 416static umode_t jc42_attribute_mode(struct kobject *kobj,
417 struct attribute *attr, int index) 417 struct attribute *attr, int index)
418{ 418{
419 struct device *dev = container_of(kobj, struct device, kobj); 419 struct device *dev = container_of(kobj, struct device, kobj);
diff --git a/drivers/hwmon/max1668.c b/drivers/hwmon/max1668.c
index 20d1b2ddffb6..6914195cfd35 100644
--- a/drivers/hwmon/max1668.c
+++ b/drivers/hwmon/max1668.c
@@ -335,10 +335,10 @@ static struct attribute *max1668_attribute_unique[] = {
335 NULL 335 NULL
336}; 336};
337 337
338static mode_t max1668_attribute_mode(struct kobject *kobj, 338static umode_t max1668_attribute_mode(struct kobject *kobj,
339 struct attribute *attr, int index) 339 struct attribute *attr, int index)
340{ 340{
341 int ret = S_IRUGO; 341 umode_t ret = S_IRUGO;
342 if (read_only) 342 if (read_only)
343 return ret; 343 return ret;
344 if (attr == &sensor_dev_attr_temp1_max.dev_attr.attr || 344 if (attr == &sensor_dev_attr_temp1_max.dev_attr.attr ||
diff --git a/drivers/hwmon/max6650.c b/drivers/hwmon/max6650.c
index ece3aafa54b3..2fc034aeca09 100644
--- a/drivers/hwmon/max6650.c
+++ b/drivers/hwmon/max6650.c
@@ -464,7 +464,7 @@ static SENSOR_DEVICE_ATTR(gpio1_alarm, S_IRUGO, get_alarm, NULL,
464static SENSOR_DEVICE_ATTR(gpio2_alarm, S_IRUGO, get_alarm, NULL, 464static SENSOR_DEVICE_ATTR(gpio2_alarm, S_IRUGO, get_alarm, NULL,
465 MAX6650_ALRM_GPIO2); 465 MAX6650_ALRM_GPIO2);
466 466
467static mode_t max6650_attrs_visible(struct kobject *kobj, struct attribute *a, 467static umode_t max6650_attrs_visible(struct kobject *kobj, struct attribute *a,
468 int n) 468 int n)
469{ 469{
470 struct device *dev = container_of(kobj, struct device, kobj); 470 struct device *dev = container_of(kobj, struct device, kobj);
diff --git a/drivers/hwmon/tmp421.c b/drivers/hwmon/tmp421.c
index 0517a8f09d35..c48381f2cd02 100644
--- a/drivers/hwmon/tmp421.c
+++ b/drivers/hwmon/tmp421.c
@@ -157,7 +157,7 @@ static ssize_t show_fault(struct device *dev,
157 return sprintf(buf, "0\n"); 157 return sprintf(buf, "0\n");
158} 158}
159 159
160static mode_t tmp421_is_visible(struct kobject *kobj, struct attribute *a, 160static umode_t tmp421_is_visible(struct kobject *kobj, struct attribute *a,
161 int n) 161 int n)
162{ 162{
163 struct device *dev = container_of(kobj, struct device, kobj); 163 struct device *dev = container_of(kobj, struct device, kobj);
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index 8b72f39202fb..c889aaef3416 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -3659,7 +3659,7 @@ static struct kobj_type cm_port_obj_type = {
3659 .release = cm_release_port_obj 3659 .release = cm_release_port_obj
3660}; 3660};
3661 3661
3662static char *cm_devnode(struct device *dev, mode_t *mode) 3662static char *cm_devnode(struct device *dev, umode_t *mode)
3663{ 3663{
3664 if (mode) 3664 if (mode)
3665 *mode = 0666; 3665 *mode = 0666;
diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c
index 07db22997e97..f0d588f8859e 100644
--- a/drivers/infiniband/core/user_mad.c
+++ b/drivers/infiniband/core/user_mad.c
@@ -1175,7 +1175,7 @@ static void ib_umad_remove_one(struct ib_device *device)
1175 kref_put(&umad_dev->ref, ib_umad_release_dev); 1175 kref_put(&umad_dev->ref, ib_umad_release_dev);
1176} 1176}
1177 1177
1178static char *umad_devnode(struct device *dev, mode_t *mode) 1178static char *umad_devnode(struct device *dev, umode_t *mode)
1179{ 1179{
1180 return kasprintf(GFP_KERNEL, "infiniband/%s", dev_name(dev)); 1180 return kasprintf(GFP_KERNEL, "infiniband/%s", dev_name(dev));
1181} 1181}
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index 879636746373..604556d73d25 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -846,7 +846,7 @@ static void ib_uverbs_remove_one(struct ib_device *device)
846 kfree(uverbs_dev); 846 kfree(uverbs_dev);
847} 847}
848 848
849static char *uverbs_devnode(struct device *dev, mode_t *mode) 849static char *uverbs_devnode(struct device *dev, umode_t *mode)
850{ 850{
851 if (mode) 851 if (mode)
852 *mode = 0666; 852 *mode = 0666;
diff --git a/drivers/infiniband/hw/ipath/ipath_fs.c b/drivers/infiniband/hw/ipath/ipath_fs.c
index 31ae1b108aea..b7d4216db3c3 100644
--- a/drivers/infiniband/hw/ipath/ipath_fs.c
+++ b/drivers/infiniband/hw/ipath/ipath_fs.c
@@ -46,7 +46,7 @@
46static struct super_block *ipath_super; 46static struct super_block *ipath_super;
47 47
48static int ipathfs_mknod(struct inode *dir, struct dentry *dentry, 48static int ipathfs_mknod(struct inode *dir, struct dentry *dentry,
49 int mode, const struct file_operations *fops, 49 umode_t mode, const struct file_operations *fops,
50 void *data) 50 void *data)
51{ 51{
52 int error; 52 int error;
@@ -61,7 +61,7 @@ static int ipathfs_mknod(struct inode *dir, struct dentry *dentry,
61 inode->i_mode = mode; 61 inode->i_mode = mode;
62 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 62 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
63 inode->i_private = data; 63 inode->i_private = data;
64 if ((mode & S_IFMT) == S_IFDIR) { 64 if (S_ISDIR(mode)) {
65 inode->i_op = &simple_dir_inode_operations; 65 inode->i_op = &simple_dir_inode_operations;
66 inc_nlink(inode); 66 inc_nlink(inode);
67 inc_nlink(dir); 67 inc_nlink(dir);
@@ -76,7 +76,7 @@ bail:
76 return error; 76 return error;
77} 77}
78 78
79static int create_file(const char *name, mode_t mode, 79static int create_file(const char *name, umode_t mode,
80 struct dentry *parent, struct dentry **dentry, 80 struct dentry *parent, struct dentry **dentry,
81 const struct file_operations *fops, void *data) 81 const struct file_operations *fops, void *data)
82{ 82{
diff --git a/drivers/infiniband/hw/qib/qib_fs.c b/drivers/infiniband/hw/qib/qib_fs.c
index df7fa251dcdc..05e0f17c5b44 100644
--- a/drivers/infiniband/hw/qib/qib_fs.c
+++ b/drivers/infiniband/hw/qib/qib_fs.c
@@ -47,7 +47,7 @@ static struct super_block *qib_super;
47#define private2dd(file) ((file)->f_dentry->d_inode->i_private) 47#define private2dd(file) ((file)->f_dentry->d_inode->i_private)
48 48
49static int qibfs_mknod(struct inode *dir, struct dentry *dentry, 49static int qibfs_mknod(struct inode *dir, struct dentry *dentry,
50 int mode, const struct file_operations *fops, 50 umode_t mode, const struct file_operations *fops,
51 void *data) 51 void *data)
52{ 52{
53 int error; 53 int error;
@@ -67,7 +67,7 @@ static int qibfs_mknod(struct inode *dir, struct dentry *dentry,
67 inode->i_mtime = inode->i_atime; 67 inode->i_mtime = inode->i_atime;
68 inode->i_ctime = inode->i_atime; 68 inode->i_ctime = inode->i_atime;
69 inode->i_private = data; 69 inode->i_private = data;
70 if ((mode & S_IFMT) == S_IFDIR) { 70 if (S_ISDIR(mode)) {
71 inode->i_op = &simple_dir_inode_operations; 71 inode->i_op = &simple_dir_inode_operations;
72 inc_nlink(inode); 72 inc_nlink(inode);
73 inc_nlink(dir); 73 inc_nlink(dir);
@@ -82,7 +82,7 @@ bail:
82 return error; 82 return error;
83} 83}
84 84
85static int create_file(const char *name, mode_t mode, 85static int create_file(const char *name, umode_t mode,
86 struct dentry *parent, struct dentry **dentry, 86 struct dentry *parent, struct dentry **dentry,
87 const struct file_operations *fops, void *data) 87 const struct file_operations *fops, void *data)
88{ 88{
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c
index 7e7373a700e6..9a43cb07f294 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.c
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.c
@@ -638,7 +638,7 @@ iscsi_iser_ep_disconnect(struct iscsi_endpoint *ep)
638 iser_conn_terminate(ib_conn); 638 iser_conn_terminate(ib_conn);
639} 639}
640 640
641static mode_t iser_attr_is_visible(int param_type, int param) 641static umode_t iser_attr_is_visible(int param_type, int param)
642{ 642{
643 switch (param_type) { 643 switch (param_type) {
644 case ISCSI_HOST_PARAM: 644 case ISCSI_HOST_PARAM:
diff --git a/drivers/input/input.c b/drivers/input/input.c
index da38d97a51b1..1f78c957a75a 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -1624,7 +1624,7 @@ static struct device_type input_dev_type = {
1624#endif 1624#endif
1625}; 1625};
1626 1626
1627static char *input_devnode(struct device *dev, mode_t *mode) 1627static char *input_devnode(struct device *dev, umode_t *mode)
1628{ 1628{
1629 return kasprintf(GFP_KERNEL, "input/%s", dev_name(dev)); 1629 return kasprintf(GFP_KERNEL, "input/%s", dev_name(dev));
1630} 1630}
diff --git a/drivers/input/touchscreen/ad7877.c b/drivers/input/touchscreen/ad7877.c
index 400131df677b..baa43df6502d 100644
--- a/drivers/input/touchscreen/ad7877.c
+++ b/drivers/input/touchscreen/ad7877.c
@@ -612,10 +612,10 @@ static struct attribute *ad7877_attributes[] = {
612 NULL 612 NULL
613}; 613};
614 614
615static mode_t ad7877_attr_is_visible(struct kobject *kobj, 615static umode_t ad7877_attr_is_visible(struct kobject *kobj,
616 struct attribute *attr, int n) 616 struct attribute *attr, int n)
617{ 617{
618 mode_t mode = attr->mode; 618 umode_t mode = attr->mode;
619 619
620 if (attr == &dev_attr_aux3.attr) { 620 if (attr == &dev_attr_aux3.attr) {
621 if (gpio3) 621 if (gpio3)
diff --git a/drivers/input/touchscreen/tsc2005.c b/drivers/input/touchscreen/tsc2005.c
index cbf0ff322676..067d95662997 100644
--- a/drivers/input/touchscreen/tsc2005.c
+++ b/drivers/input/touchscreen/tsc2005.c
@@ -450,13 +450,13 @@ static struct attribute *tsc2005_attrs[] = {
450 NULL 450 NULL
451}; 451};
452 452
453static mode_t tsc2005_attr_is_visible(struct kobject *kobj, 453static umode_t tsc2005_attr_is_visible(struct kobject *kobj,
454 struct attribute *attr, int n) 454 struct attribute *attr, int n)
455{ 455{
456 struct device *dev = container_of(kobj, struct device, kobj); 456 struct device *dev = container_of(kobj, struct device, kobj);
457 struct spi_device *spi = to_spi_device(dev); 457 struct spi_device *spi = to_spi_device(dev);
458 struct tsc2005 *ts = spi_get_drvdata(spi); 458 struct tsc2005 *ts = spi_get_drvdata(spi);
459 mode_t mode = attr->mode; 459 umode_t mode = attr->mode;
460 460
461 if (attr == &dev_attr_selftest.attr) { 461 if (attr == &dev_attr_selftest.attr) {
462 if (!ts->set_reset) 462 if (!ts->set_reset)
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 4720f68f817e..b89c548ec3f8 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -14,7 +14,6 @@
14#include <linux/moduleparam.h> 14#include <linux/moduleparam.h>
15#include <linux/blkpg.h> 15#include <linux/blkpg.h>
16#include <linux/bio.h> 16#include <linux/bio.h>
17#include <linux/buffer_head.h>
18#include <linux/mempool.h> 17#include <linux/mempool.h>
19#include <linux/slab.h> 18#include <linux/slab.h>
20#include <linux/idr.h> 19#include <linux/idr.h>
diff --git a/drivers/md/md.c b/drivers/md/md.c
index f47f1f8ac44b..5d1b6762f108 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -36,8 +36,7 @@
36#include <linux/blkdev.h> 36#include <linux/blkdev.h>
37#include <linux/sysctl.h> 37#include <linux/sysctl.h>
38#include <linux/seq_file.h> 38#include <linux/seq_file.h>
39#include <linux/mutex.h> 39#include <linux/fs.h>
40#include <linux/buffer_head.h> /* for invalidate_bdev */
41#include <linux/poll.h> 40#include <linux/poll.h>
42#include <linux/ctype.h> 41#include <linux/ctype.h>
43#include <linux/string.h> 42#include <linux/string.h>
diff --git a/drivers/media/dvb/ddbridge/ddbridge-core.c b/drivers/media/dvb/ddbridge/ddbridge-core.c
index ba9a643b9c6a..d1e91bc80e78 100644
--- a/drivers/media/dvb/ddbridge/ddbridge-core.c
+++ b/drivers/media/dvb/ddbridge/ddbridge-core.c
@@ -1480,7 +1480,7 @@ static const struct file_operations ddb_fops = {
1480 .open = ddb_open, 1480 .open = ddb_open,
1481}; 1481};
1482 1482
1483static char *ddb_devnode(struct device *device, mode_t *mode) 1483static char *ddb_devnode(struct device *device, umode_t *mode)
1484{ 1484{
1485 struct ddb *dev = dev_get_drvdata(device); 1485 struct ddb *dev = dev_get_drvdata(device);
1486 1486
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c
index f73287775953..00a67326c193 100644
--- a/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/drivers/media/dvb/dvb-core/dvbdev.c
@@ -450,7 +450,7 @@ static int dvb_uevent(struct device *dev, struct kobj_uevent_env *env)
450 return 0; 450 return 0;
451} 451}
452 452
453static char *dvb_devnode(struct device *dev, mode_t *mode) 453static char *dvb_devnode(struct device *dev, umode_t *mode)
454{ 454{
455 struct dvb_device *dvbdev = dev_get_drvdata(dev); 455 struct dvb_device *dvbdev = dev_get_drvdata(dev);
456 456
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index 29f900065d8a..f5db8b949bc3 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -715,7 +715,7 @@ static void ir_close(struct input_dev *idev)
715} 715}
716 716
717/* class for /sys/class/rc */ 717/* class for /sys/class/rc */
718static char *ir_devnode(struct device *dev, mode_t *mode) 718static char *ir_devnode(struct device *dev, umode_t *mode)
719{ 719{
720 return kasprintf(GFP_KERNEL, "rc/%s", dev_name(dev)); 720 return kasprintf(GFP_KERNEL, "rc/%s", dev_name(dev));
721} 721}
diff --git a/drivers/message/i2o/i2o_proc.c b/drivers/message/i2o/i2o_proc.c
index 07dbeaf9df99..6d115c7208ab 100644
--- a/drivers/message/i2o/i2o_proc.c
+++ b/drivers/message/i2o/i2o_proc.c
@@ -56,7 +56,7 @@
56/* Structure used to define /proc entries */ 56/* Structure used to define /proc entries */
57typedef struct _i2o_proc_entry_t { 57typedef struct _i2o_proc_entry_t {
58 char *name; /* entry name */ 58 char *name; /* entry name */
59 mode_t mode; /* mode */ 59 umode_t mode; /* mode */
60 const struct file_operations *fops; /* open function */ 60 const struct file_operations *fops; /* open function */
61} i2o_proc_entry; 61} i2o_proc_entry;
62 62
diff --git a/drivers/misc/sgi-gru/gruprocfs.c b/drivers/misc/sgi-gru/gruprocfs.c
index 7768b87d995b..950dbe9ecb36 100644
--- a/drivers/misc/sgi-gru/gruprocfs.c
+++ b/drivers/misc/sgi-gru/gruprocfs.c
@@ -324,7 +324,7 @@ static const struct file_operations gru_fops = {
324 324
325static struct proc_entry { 325static struct proc_entry {
326 char *name; 326 char *name;
327 int mode; 327 umode_t mode;
328 const struct file_operations *fops; 328 const struct file_operations *fops;
329 struct proc_dir_entry *entry; 329 struct proc_dir_entry *entry;
330} proc_files[] = { 330} proc_files[] = {
diff --git a/drivers/mmc/card/mmc_test.c b/drivers/mmc/card/mmc_test.c
index b038c4a9468b..e99bdc18002d 100644
--- a/drivers/mmc/card/mmc_test.c
+++ b/drivers/mmc/card/mmc_test.c
@@ -2949,7 +2949,7 @@ static void mmc_test_free_dbgfs_file(struct mmc_card *card)
2949} 2949}
2950 2950
2951static int __mmc_test_register_dbgfs_file(struct mmc_card *card, 2951static int __mmc_test_register_dbgfs_file(struct mmc_card *card,
2952 const char *name, mode_t mode, const struct file_operations *fops) 2952 const char *name, umode_t mode, const struct file_operations *fops)
2953{ 2953{
2954 struct dentry *file = NULL; 2954 struct dentry *file = NULL;
2955 struct mmc_test_dbgfs_file *df; 2955 struct mmc_test_dbgfs_file *df;
diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c
index b78f23169d4e..ebeabc727f70 100644
--- a/drivers/mtd/devices/block2mtd.c
+++ b/drivers/mtd/devices/block2mtd.c
@@ -14,7 +14,6 @@
14#include <linux/list.h> 14#include <linux/list.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/mtd/mtd.h> 16#include <linux/mtd/mtd.h>
17#include <linux/buffer_head.h>
18#include <linux/mutex.h> 17#include <linux/mutex.h>
19#include <linux/mount.h> 18#include <linux/mount.h>
20#include <linux/slab.h> 19#include <linux/slab.h>
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
index 5ca73671830b..e53365a71484 100644
--- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
@@ -2003,7 +2003,7 @@ static const struct file_operations interfaces_proc_fops = {
2003 */ 2003 */
2004struct cxgb4vf_debugfs_entry { 2004struct cxgb4vf_debugfs_entry {
2005 const char *name; /* name of debugfs node */ 2005 const char *name; /* name of debugfs node */
2006 mode_t mode; /* file system mode */ 2006 umode_t mode; /* file system mode */
2007 const struct file_operations *fops; 2007 const struct file_operations *fops;
2008}; 2008};
2009 2009
diff --git a/drivers/net/wireless/ath/carl9170/debug.c b/drivers/net/wireless/ath/carl9170/debug.c
index de57f90e1d5f..3c164226687f 100644
--- a/drivers/net/wireless/ath/carl9170/debug.c
+++ b/drivers/net/wireless/ath/carl9170/debug.c
@@ -56,7 +56,7 @@ static int carl9170_debugfs_open(struct inode *inode, struct file *file)
56 56
57struct carl9170_debugfs_fops { 57struct carl9170_debugfs_fops {
58 unsigned int read_bufsize; 58 unsigned int read_bufsize;
59 mode_t attr; 59 umode_t attr;
60 char *(*read)(struct ar9170 *ar, char *buf, size_t bufsize, 60 char *(*read)(struct ar9170 *ar, char *buf, size_t bufsize,
61 ssize_t *len); 61 ssize_t *len);
62 ssize_t (*write)(struct ar9170 *aru, const char *buf, size_t size); 62 ssize_t (*write)(struct ar9170 *aru, const char *buf, size_t size);
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index d8d8f0d0899f..c192671610fc 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -704,7 +704,7 @@ out_unlock:
704 704
705struct lbs_debugfs_files { 705struct lbs_debugfs_files {
706 const char *name; 706 const char *name;
707 int perm; 707 umode_t perm;
708 struct file_operations fops; 708 struct file_operations fops;
709}; 709};
710 710
diff --git a/drivers/pci/pci-label.c b/drivers/pci/pci-label.c
index 81525ae5d869..edaed6f4da6c 100644
--- a/drivers/pci/pci-label.c
+++ b/drivers/pci/pci-label.c
@@ -89,7 +89,7 @@ find_smbios_instance_string(struct pci_dev *pdev, char *buf,
89 return 0; 89 return 0;
90} 90}
91 91
92static mode_t 92static umode_t
93smbios_instance_string_exist(struct kobject *kobj, struct attribute *attr, 93smbios_instance_string_exist(struct kobject *kobj, struct attribute *attr,
94 int n) 94 int n)
95{ 95{
@@ -275,7 +275,7 @@ device_has_dsm(struct device *dev)
275 return FALSE; 275 return FALSE;
276} 276}
277 277
278static mode_t 278static umode_t
279acpi_index_string_exist(struct kobject *kobj, struct attribute *attr, int n) 279acpi_index_string_exist(struct kobject *kobj, struct attribute *attr, int n)
280{ 280{
281 struct device *dev; 281 struct device *dev;
diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
index edaccad9b5bf..b7944f903886 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -1477,7 +1477,7 @@ static struct attribute *asus_attributes[] = {
1477 NULL 1477 NULL
1478}; 1478};
1479 1479
1480static mode_t asus_sysfs_is_visible(struct kobject *kobj, 1480static umode_t asus_sysfs_is_visible(struct kobject *kobj,
1481 struct attribute *attr, 1481 struct attribute *attr,
1482 int idx) 1482 int idx)
1483{ 1483{
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index d1049ee3c9e8..72d731c21d45 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -992,7 +992,7 @@ static struct attribute *hwmon_attributes[] = {
992 NULL 992 NULL
993}; 993};
994 994
995static mode_t asus_hwmon_sysfs_is_visible(struct kobject *kobj, 995static umode_t asus_hwmon_sysfs_is_visible(struct kobject *kobj,
996 struct attribute *attr, int idx) 996 struct attribute *attr, int idx)
997{ 997{
998 struct device *dev = container_of(kobj, struct device, kobj); 998 struct device *dev = container_of(kobj, struct device, kobj);
@@ -1357,7 +1357,7 @@ static struct attribute *platform_attributes[] = {
1357 NULL 1357 NULL
1358}; 1358};
1359 1359
1360static mode_t asus_sysfs_is_visible(struct kobject *kobj, 1360static umode_t asus_sysfs_is_visible(struct kobject *kobj,
1361 struct attribute *attr, int idx) 1361 struct attribute *attr, int idx)
1362{ 1362{
1363 struct device *dev = container_of(kobj, struct device, kobj); 1363 struct device *dev = container_of(kobj, struct device, kobj);
diff --git a/drivers/platform/x86/asus_acpi.c b/drivers/platform/x86/asus_acpi.c
index d9312b3073e5..6f966d6c062b 100644
--- a/drivers/platform/x86/asus_acpi.c
+++ b/drivers/platform/x86/asus_acpi.c
@@ -1053,7 +1053,7 @@ static const struct file_operations disp_proc_fops = {
1053}; 1053};
1054 1054
1055static int 1055static int
1056asus_proc_add(char *name, const struct file_operations *proc_fops, mode_t mode, 1056asus_proc_add(char *name, const struct file_operations *proc_fops, umode_t mode,
1057 struct acpi_device *device) 1057 struct acpi_device *device)
1058{ 1058{
1059 struct proc_dir_entry *proc; 1059 struct proc_dir_entry *proc;
@@ -1072,7 +1072,7 @@ asus_proc_add(char *name, const struct file_operations *proc_fops, mode_t mode,
1072static int asus_hotk_add_fs(struct acpi_device *device) 1072static int asus_hotk_add_fs(struct acpi_device *device)
1073{ 1073{
1074 struct proc_dir_entry *proc; 1074 struct proc_dir_entry *proc;
1075 mode_t mode; 1075 umode_t mode;
1076 1076
1077 if ((asus_uid == 0) && (asus_gid == 0)) { 1077 if ((asus_uid == 0) && (asus_gid == 0)) {
1078 mode = S_IFREG | S_IRUGO | S_IWUSR | S_IWGRP; 1078 mode = S_IFREG | S_IRUGO | S_IWUSR | S_IWGRP;
diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index a36addf106a0..ac902f7a9baa 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -368,7 +368,7 @@ static struct attribute *ideapad_attributes[] = {
368 NULL 368 NULL
369}; 369};
370 370
371static mode_t ideapad_is_visible(struct kobject *kobj, 371static umode_t ideapad_is_visible(struct kobject *kobj,
372 struct attribute *attr, 372 struct attribute *attr,
373 int idx) 373 int idx)
374{ 374{
diff --git a/drivers/platform/x86/intel_menlow.c b/drivers/platform/x86/intel_menlow.c
index abddc83e9fd7..3271ac85115e 100644
--- a/drivers/platform/x86/intel_menlow.c
+++ b/drivers/platform/x86/intel_menlow.c
@@ -389,7 +389,7 @@ static ssize_t bios_enabled_show(struct device *dev,
389 return sprintf(buf, "%s\n", bios_enabled ? "enabled" : "disabled"); 389 return sprintf(buf, "%s\n", bios_enabled ? "enabled" : "disabled");
390} 390}
391 391
392static int intel_menlow_add_one_attribute(char *name, int mode, void *show, 392static int intel_menlow_add_one_attribute(char *name, umode_t mode, void *show,
393 void *store, struct device *dev, 393 void *store, struct device *dev,
394 acpi_handle handle) 394 acpi_handle handle)
395{ 395{
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 7b828680b21d..455e1522253e 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -297,7 +297,7 @@ struct ibm_init_struct {
297 char param[32]; 297 char param[32];
298 298
299 int (*init) (struct ibm_init_struct *); 299 int (*init) (struct ibm_init_struct *);
300 mode_t base_procfs_mode; 300 umode_t base_procfs_mode;
301 struct ibm_struct *data; 301 struct ibm_struct *data;
302}; 302};
303 303
@@ -8542,7 +8542,7 @@ static int __init ibm_init(struct ibm_init_struct *iibm)
8542 "%s installed\n", ibm->name); 8542 "%s installed\n", ibm->name);
8543 8543
8544 if (ibm->read) { 8544 if (ibm->read) {
8545 mode_t mode = iibm->base_procfs_mode; 8545 umode_t mode = iibm->base_procfs_mode;
8546 8546
8547 if (!mode) 8547 if (!mode)
8548 mode = S_IRUGO; 8548 mode = S_IRUGO;
diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c
index e15d4c9d3988..e95cd657dac2 100644
--- a/drivers/power/power_supply_sysfs.c
+++ b/drivers/power/power_supply_sysfs.c
@@ -176,13 +176,13 @@ static struct device_attribute power_supply_attrs[] = {
176static struct attribute * 176static struct attribute *
177__power_supply_attrs[ARRAY_SIZE(power_supply_attrs) + 1]; 177__power_supply_attrs[ARRAY_SIZE(power_supply_attrs) + 1];
178 178
179static mode_t power_supply_attr_is_visible(struct kobject *kobj, 179static umode_t power_supply_attr_is_visible(struct kobject *kobj,
180 struct attribute *attr, 180 struct attribute *attr,
181 int attrno) 181 int attrno)
182{ 182{
183 struct device *dev = container_of(kobj, struct device, kobj); 183 struct device *dev = container_of(kobj, struct device, kobj);
184 struct power_supply *psy = dev_get_drvdata(dev); 184 struct power_supply *psy = dev_get_drvdata(dev);
185 mode_t mode = S_IRUSR | S_IRGRP | S_IROTH; 185 umode_t mode = S_IRUSR | S_IRGRP | S_IROTH;
186 int i; 186 int i;
187 187
188 if (attrno == POWER_SUPPLY_PROP_TYPE) 188 if (attrno == POWER_SUPPLY_PROP_TYPE)
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index 65894f05a801..eef27a197c00 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -17,7 +17,6 @@
17#include <linux/ctype.h> 17#include <linux/ctype.h>
18#include <linux/major.h> 18#include <linux/major.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <linux/buffer_head.h>
21#include <linux/hdreg.h> 20#include <linux/hdreg.h>
22#include <linux/async.h> 21#include <linux/async.h>
23#include <linux/mutex.h> 22#include <linux/mutex.h>
@@ -1073,7 +1072,7 @@ static const struct file_operations dasd_stats_global_fops = {
1073static void dasd_profile_init(struct dasd_profile *profile, 1072static void dasd_profile_init(struct dasd_profile *profile,
1074 struct dentry *base_dentry) 1073 struct dentry *base_dentry)
1075{ 1074{
1076 mode_t mode; 1075 umode_t mode;
1077 struct dentry *pde; 1076 struct dentry *pde;
1078 1077
1079 if (!base_dentry) 1078 if (!base_dentry)
@@ -1112,7 +1111,7 @@ static void dasd_statistics_removeroot(void)
1112 1111
1113static void dasd_statistics_createroot(void) 1112static void dasd_statistics_createroot(void)
1114{ 1113{
1115 mode_t mode; 1114 umode_t mode;
1116 struct dentry *pde; 1115 struct dentry *pde;
1117 1116
1118 dasd_debugfs_root_entry = NULL; 1117 dasd_debugfs_root_entry = NULL;
diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c
index 8b002f6db6ca..33c8f09c7ac1 100644
--- a/drivers/scsi/be2iscsi/be_iscsi.c
+++ b/drivers/scsi/be2iscsi/be_iscsi.c
@@ -733,7 +733,7 @@ void beiscsi_ep_disconnect(struct iscsi_endpoint *ep)
733 iscsi_destroy_endpoint(beiscsi_ep->openiscsi_ep); 733 iscsi_destroy_endpoint(beiscsi_ep->openiscsi_ep);
734} 734}
735 735
736mode_t be2iscsi_attr_is_visible(int param_type, int param) 736umode_t be2iscsi_attr_is_visible(int param_type, int param)
737{ 737{
738 switch (param_type) { 738 switch (param_type) {
739 case ISCSI_HOST_PARAM: 739 case ISCSI_HOST_PARAM:
diff --git a/drivers/scsi/be2iscsi/be_iscsi.h b/drivers/scsi/be2iscsi/be_iscsi.h
index 4a1f2e393f31..5c45be134501 100644
--- a/drivers/scsi/be2iscsi/be_iscsi.h
+++ b/drivers/scsi/be2iscsi/be_iscsi.h
@@ -26,7 +26,7 @@
26#define BE2_IPV4 0x1 26#define BE2_IPV4 0x1
27#define BE2_IPV6 0x10 27#define BE2_IPV6 0x10
28 28
29mode_t be2iscsi_attr_is_visible(int param_type, int param); 29umode_t be2iscsi_attr_is_visible(int param_type, int param);
30 30
31void beiscsi_offload_connection(struct beiscsi_conn *beiscsi_conn, 31void beiscsi_offload_connection(struct beiscsi_conn *beiscsi_conn,
32 struct beiscsi_offload_params *params); 32 struct beiscsi_offload_params *params);
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 379c696dac19..797a43994b55 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -325,9 +325,9 @@ static ssize_t beiscsi_show_boot_eth_info(void *data, int type, char *buf)
325} 325}
326 326
327 327
328static mode_t beiscsi_tgt_get_attr_visibility(void *data, int type) 328static umode_t beiscsi_tgt_get_attr_visibility(void *data, int type)
329{ 329{
330 int rc; 330 umode_t rc;
331 331
332 switch (type) { 332 switch (type) {
333 case ISCSI_BOOT_TGT_NAME: 333 case ISCSI_BOOT_TGT_NAME:
@@ -348,9 +348,9 @@ static mode_t beiscsi_tgt_get_attr_visibility(void *data, int type)
348 return rc; 348 return rc;
349} 349}
350 350
351static mode_t beiscsi_ini_get_attr_visibility(void *data, int type) 351static umode_t beiscsi_ini_get_attr_visibility(void *data, int type)
352{ 352{
353 int rc; 353 umode_t rc;
354 354
355 switch (type) { 355 switch (type) {
356 case ISCSI_BOOT_INI_INITIATOR_NAME: 356 case ISCSI_BOOT_INI_INITIATOR_NAME:
@@ -364,9 +364,9 @@ static mode_t beiscsi_ini_get_attr_visibility(void *data, int type)
364} 364}
365 365
366 366
367static mode_t beiscsi_eth_get_attr_visibility(void *data, int type) 367static umode_t beiscsi_eth_get_attr_visibility(void *data, int type)
368{ 368{
369 int rc; 369 umode_t rc;
370 370
371 switch (type) { 371 switch (type) {
372 case ISCSI_BOOT_ETH_FLAGS: 372 case ISCSI_BOOT_ETH_FLAGS:
diff --git a/drivers/scsi/bfa/bfad_debugfs.c b/drivers/scsi/bfa/bfad_debugfs.c
index dee1a094c2c2..caca9b7c8309 100644
--- a/drivers/scsi/bfa/bfad_debugfs.c
+++ b/drivers/scsi/bfa/bfad_debugfs.c
@@ -472,7 +472,7 @@ static const struct file_operations bfad_debugfs_op_regwr = {
472 472
473struct bfad_debugfs_entry { 473struct bfad_debugfs_entry {
474 const char *name; 474 const char *name;
475 mode_t mode; 475 umode_t mode;
476 const struct file_operations *fops; 476 const struct file_operations *fops;
477}; 477};
478 478
diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c
index d1e697190970..1a44b45e7bef 100644
--- a/drivers/scsi/bnx2i/bnx2i_iscsi.c
+++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c
@@ -2177,7 +2177,7 @@ static int bnx2i_nl_set_path(struct Scsi_Host *shost, struct iscsi_path *params)
2177 return 0; 2177 return 0;
2178} 2178}
2179 2179
2180static mode_t bnx2i_attr_is_visible(int param_type, int param) 2180static umode_t bnx2i_attr_is_visible(int param_type, int param)
2181{ 2181{
2182 switch (param_type) { 2182 switch (param_type) {
2183 case ISCSI_HOST_PARAM: 2183 case ISCSI_HOST_PARAM:
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index 1d25a87aa47b..c5360ffb4bed 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -2575,7 +2575,7 @@ void cxgbi_iscsi_cleanup(struct iscsi_transport *itp,
2575} 2575}
2576EXPORT_SYMBOL_GPL(cxgbi_iscsi_cleanup); 2576EXPORT_SYMBOL_GPL(cxgbi_iscsi_cleanup);
2577 2577
2578mode_t cxgbi_attr_is_visible(int param_type, int param) 2578umode_t cxgbi_attr_is_visible(int param_type, int param)
2579{ 2579{
2580 switch (param_type) { 2580 switch (param_type) {
2581 case ISCSI_HOST_PARAM: 2581 case ISCSI_HOST_PARAM:
diff --git a/drivers/scsi/cxgbi/libcxgbi.h b/drivers/scsi/cxgbi/libcxgbi.h
index 20c88279c7a6..80fa99b3d384 100644
--- a/drivers/scsi/cxgbi/libcxgbi.h
+++ b/drivers/scsi/cxgbi/libcxgbi.h
@@ -709,7 +709,7 @@ int cxgbi_conn_xmit_pdu(struct iscsi_task *);
709 709
710void cxgbi_cleanup_task(struct iscsi_task *task); 710void cxgbi_cleanup_task(struct iscsi_task *task);
711 711
712mode_t cxgbi_attr_is_visible(int param_type, int param); 712umode_t cxgbi_attr_is_visible(int param_type, int param);
713void cxgbi_get_conn_stats(struct iscsi_cls_conn *, struct iscsi_stats *); 713void cxgbi_get_conn_stats(struct iscsi_cls_conn *, struct iscsi_stats *);
714int cxgbi_set_conn_param(struct iscsi_cls_conn *, 714int cxgbi_set_conn_param(struct iscsi_cls_conn *,
715 enum iscsi_param, char *, int); 715 enum iscsi_param, char *, int);
diff --git a/drivers/scsi/iscsi_boot_sysfs.c b/drivers/scsi/iscsi_boot_sysfs.c
index 89700cbca16e..14c1c8f6a95e 100644
--- a/drivers/scsi/iscsi_boot_sysfs.c
+++ b/drivers/scsi/iscsi_boot_sysfs.c
@@ -112,7 +112,7 @@ static struct attribute *target_attrs[] = {
112 NULL 112 NULL
113}; 113};
114 114
115static mode_t iscsi_boot_tgt_attr_is_visible(struct kobject *kobj, 115static umode_t iscsi_boot_tgt_attr_is_visible(struct kobject *kobj,
116 struct attribute *attr, int i) 116 struct attribute *attr, int i)
117{ 117{
118 struct iscsi_boot_kobj *boot_kobj = 118 struct iscsi_boot_kobj *boot_kobj =
@@ -193,7 +193,7 @@ static struct attribute *ethernet_attrs[] = {
193 NULL 193 NULL
194}; 194};
195 195
196static mode_t iscsi_boot_eth_attr_is_visible(struct kobject *kobj, 196static umode_t iscsi_boot_eth_attr_is_visible(struct kobject *kobj,
197 struct attribute *attr, int i) 197 struct attribute *attr, int i)
198{ 198{
199 struct iscsi_boot_kobj *boot_kobj = 199 struct iscsi_boot_kobj *boot_kobj =
@@ -265,7 +265,7 @@ static struct attribute *initiator_attrs[] = {
265 NULL 265 NULL
266}; 266};
267 267
268static mode_t iscsi_boot_ini_attr_is_visible(struct kobject *kobj, 268static umode_t iscsi_boot_ini_attr_is_visible(struct kobject *kobj,
269 struct attribute *attr, int i) 269 struct attribute *attr, int i)
270{ 270{
271 struct iscsi_boot_kobj *boot_kobj = 271 struct iscsi_boot_kobj *boot_kobj =
@@ -306,7 +306,7 @@ iscsi_boot_create_kobj(struct iscsi_boot_kset *boot_kset,
306 struct attribute_group *attr_group, 306 struct attribute_group *attr_group,
307 const char *name, int index, void *data, 307 const char *name, int index, void *data,
308 ssize_t (*show) (void *data, int type, char *buf), 308 ssize_t (*show) (void *data, int type, char *buf),
309 mode_t (*is_visible) (void *data, int type), 309 umode_t (*is_visible) (void *data, int type),
310 void (*release) (void *data)) 310 void (*release) (void *data))
311{ 311{
312 struct iscsi_boot_kobj *boot_kobj; 312 struct iscsi_boot_kobj *boot_kobj;
@@ -369,7 +369,7 @@ struct iscsi_boot_kobj *
369iscsi_boot_create_target(struct iscsi_boot_kset *boot_kset, int index, 369iscsi_boot_create_target(struct iscsi_boot_kset *boot_kset, int index,
370 void *data, 370 void *data,
371 ssize_t (*show) (void *data, int type, char *buf), 371 ssize_t (*show) (void *data, int type, char *buf),
372 mode_t (*is_visible) (void *data, int type), 372 umode_t (*is_visible) (void *data, int type),
373 void (*release) (void *data)) 373 void (*release) (void *data))
374{ 374{
375 return iscsi_boot_create_kobj(boot_kset, &iscsi_boot_target_attr_group, 375 return iscsi_boot_create_kobj(boot_kset, &iscsi_boot_target_attr_group,
@@ -394,7 +394,7 @@ struct iscsi_boot_kobj *
394iscsi_boot_create_initiator(struct iscsi_boot_kset *boot_kset, int index, 394iscsi_boot_create_initiator(struct iscsi_boot_kset *boot_kset, int index,
395 void *data, 395 void *data,
396 ssize_t (*show) (void *data, int type, char *buf), 396 ssize_t (*show) (void *data, int type, char *buf),
397 mode_t (*is_visible) (void *data, int type), 397 umode_t (*is_visible) (void *data, int type),
398 void (*release) (void *data)) 398 void (*release) (void *data))
399{ 399{
400 return iscsi_boot_create_kobj(boot_kset, 400 return iscsi_boot_create_kobj(boot_kset,
@@ -420,7 +420,7 @@ struct iscsi_boot_kobj *
420iscsi_boot_create_ethernet(struct iscsi_boot_kset *boot_kset, int index, 420iscsi_boot_create_ethernet(struct iscsi_boot_kset *boot_kset, int index,
421 void *data, 421 void *data,
422 ssize_t (*show) (void *data, int type, char *buf), 422 ssize_t (*show) (void *data, int type, char *buf),
423 mode_t (*is_visible) (void *data, int type), 423 umode_t (*is_visible) (void *data, int type),
424 void (*release) (void *data)) 424 void (*release) (void *data))
425{ 425{
426 return iscsi_boot_create_kobj(boot_kset, 426 return iscsi_boot_create_kobj(boot_kset,
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index 7c34d8e7cc75..db47158e0dde 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -873,7 +873,7 @@ static void iscsi_sw_tcp_session_destroy(struct iscsi_cls_session *cls_session)
873 iscsi_host_free(shost); 873 iscsi_host_free(shost);
874} 874}
875 875
876static mode_t iscsi_sw_tcp_attr_is_visible(int param_type, int param) 876static umode_t iscsi_sw_tcp_attr_is_visible(int param_type, int param)
877{ 877{
878 switch (param_type) { 878 switch (param_type) {
879 case ISCSI_HOST_PARAM: 879 case ISCSI_HOST_PARAM:
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 4169c8baa112..78bf700b365f 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -128,7 +128,7 @@ static int qla4xxx_eh_host_reset(struct scsi_cmnd *cmd);
128static int qla4xxx_slave_alloc(struct scsi_device *device); 128static int qla4xxx_slave_alloc(struct scsi_device *device);
129static int qla4xxx_slave_configure(struct scsi_device *device); 129static int qla4xxx_slave_configure(struct scsi_device *device);
130static void qla4xxx_slave_destroy(struct scsi_device *sdev); 130static void qla4xxx_slave_destroy(struct scsi_device *sdev);
131static mode_t ql4_attr_is_visible(int param_type, int param); 131static umode_t ql4_attr_is_visible(int param_type, int param);
132static int qla4xxx_host_reset(struct Scsi_Host *shost, int reset_type); 132static int qla4xxx_host_reset(struct Scsi_Host *shost, int reset_type);
133 133
134static struct qla4_8xxx_legacy_intr_set legacy_intr[] = 134static struct qla4_8xxx_legacy_intr_set legacy_intr[] =
@@ -197,7 +197,7 @@ static struct iscsi_transport qla4xxx_iscsi_transport = {
197 197
198static struct scsi_transport_template *qla4xxx_scsi_transport; 198static struct scsi_transport_template *qla4xxx_scsi_transport;
199 199
200static mode_t ql4_attr_is_visible(int param_type, int param) 200static umode_t ql4_attr_is_visible(int param_type, int param)
201{ 201{
202 switch (param_type) { 202 switch (param_type) {
203 case ISCSI_HOST_PARAM: 203 case ISCSI_HOST_PARAM:
@@ -3039,7 +3039,7 @@ static ssize_t qla4xxx_show_boot_eth_info(void *data, int type, char *buf)
3039 return rc; 3039 return rc;
3040} 3040}
3041 3041
3042static mode_t qla4xxx_eth_get_attr_visibility(void *data, int type) 3042static umode_t qla4xxx_eth_get_attr_visibility(void *data, int type)
3043{ 3043{
3044 int rc; 3044 int rc;
3045 3045
@@ -3073,7 +3073,7 @@ static ssize_t qla4xxx_show_boot_ini_info(void *data, int type, char *buf)
3073 return rc; 3073 return rc;
3074} 3074}
3075 3075
3076static mode_t qla4xxx_ini_get_attr_visibility(void *data, int type) 3076static umode_t qla4xxx_ini_get_attr_visibility(void *data, int type)
3077{ 3077{
3078 int rc; 3078 int rc;
3079 3079
@@ -3160,7 +3160,7 @@ static ssize_t qla4xxx_show_boot_tgt_sec_info(void *data, int type, char *buf)
3160 return qla4xxx_show_boot_tgt_info(boot_sess, type, buf); 3160 return qla4xxx_show_boot_tgt_info(boot_sess, type, buf);
3161} 3161}
3162 3162
3163static mode_t qla4xxx_tgt_get_attr_visibility(void *data, int type) 3163static umode_t qla4xxx_tgt_get_attr_visibility(void *data, int type)
3164{ 3164{
3165 int rc; 3165 int rc;
3166 3166
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index 96029e6d027f..e8447fbc31f3 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -328,7 +328,7 @@ iscsi_iface_net_attr(iface, vlan_enabled, ISCSI_NET_PARAM_VLAN_ENABLED);
328iscsi_iface_net_attr(iface, mtu, ISCSI_NET_PARAM_MTU); 328iscsi_iface_net_attr(iface, mtu, ISCSI_NET_PARAM_MTU);
329iscsi_iface_net_attr(iface, port, ISCSI_NET_PARAM_PORT); 329iscsi_iface_net_attr(iface, port, ISCSI_NET_PARAM_PORT);
330 330
331static mode_t iscsi_iface_attr_is_visible(struct kobject *kobj, 331static umode_t iscsi_iface_attr_is_visible(struct kobject *kobj,
332 struct attribute *attr, int i) 332 struct attribute *attr, int i)
333{ 333{
334 struct device *dev = container_of(kobj, struct device, kobj); 334 struct device *dev = container_of(kobj, struct device, kobj);
@@ -2199,7 +2199,7 @@ static struct attribute *iscsi_conn_attrs[] = {
2199 NULL, 2199 NULL,
2200}; 2200};
2201 2201
2202static mode_t iscsi_conn_attr_is_visible(struct kobject *kobj, 2202static umode_t iscsi_conn_attr_is_visible(struct kobject *kobj,
2203 struct attribute *attr, int i) 2203 struct attribute *attr, int i)
2204{ 2204{
2205 struct device *cdev = container_of(kobj, struct device, kobj); 2205 struct device *cdev = container_of(kobj, struct device, kobj);
@@ -2370,7 +2370,7 @@ static struct attribute *iscsi_session_attrs[] = {
2370 NULL, 2370 NULL,
2371}; 2371};
2372 2372
2373static mode_t iscsi_session_attr_is_visible(struct kobject *kobj, 2373static umode_t iscsi_session_attr_is_visible(struct kobject *kobj,
2374 struct attribute *attr, int i) 2374 struct attribute *attr, int i)
2375{ 2375{
2376 struct device *cdev = container_of(kobj, struct device, kobj); 2376 struct device *cdev = container_of(kobj, struct device, kobj);
@@ -2468,7 +2468,7 @@ static struct attribute *iscsi_host_attrs[] = {
2468 NULL, 2468 NULL,
2469}; 2469};
2470 2470
2471static mode_t iscsi_host_attr_is_visible(struct kobject *kobj, 2471static umode_t iscsi_host_attr_is_visible(struct kobject *kobj,
2472 struct attribute *attr, int i) 2472 struct attribute *attr, int i)
2473{ 2473{
2474 struct device *cdev = container_of(kobj, struct device, kobj); 2474 struct device *cdev = container_of(kobj, struct device, kobj);
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c
index 5fbeadd96819..a2715c31e754 100644
--- a/drivers/scsi/scsi_transport_spi.c
+++ b/drivers/scsi/scsi_transport_spi.c
@@ -1434,7 +1434,7 @@ static int spi_host_configure(struct transport_container *tc,
1434 (si->f->show_##name ? S_IRUGO : 0) | \ 1434 (si->f->show_##name ? S_IRUGO : 0) | \
1435 (si->f->set_##name ? S_IWUSR : 0) 1435 (si->f->set_##name ? S_IWUSR : 0)
1436 1436
1437static mode_t target_attribute_is_visible(struct kobject *kobj, 1437static umode_t target_attribute_is_visible(struct kobject *kobj,
1438 struct attribute *attr, int i) 1438 struct attribute *attr, int i)
1439{ 1439{
1440 struct device *cdev = container_of(kobj, struct device, kobj); 1440 struct device *cdev = container_of(kobj, struct device, kobj);
diff --git a/drivers/scsi/scsicam.c b/drivers/scsi/scsicam.c
index 6803b1e26ecc..92d24d6dcb39 100644
--- a/drivers/scsi/scsicam.c
+++ b/drivers/scsi/scsicam.c
@@ -16,7 +16,6 @@
16#include <linux/genhd.h> 16#include <linux/genhd.h>
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/blkdev.h> 18#include <linux/blkdev.h>
19#include <linux/buffer_head.h>
20#include <asm/unaligned.h> 19#include <asm/unaligned.h>
21 20
22#include <scsi/scsicam.h> 21#include <scsi/scsicam.h>
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 441a1c5b8974..02d99982a74d 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -2325,16 +2325,15 @@ static struct sg_proc_leaf sg_proc_leaf_arr[] = {
2325static int 2325static int
2326sg_proc_init(void) 2326sg_proc_init(void)
2327{ 2327{
2328 int k, mask;
2329 int num_leaves = ARRAY_SIZE(sg_proc_leaf_arr); 2328 int num_leaves = ARRAY_SIZE(sg_proc_leaf_arr);
2330 struct sg_proc_leaf * leaf; 2329 int k;
2331 2330
2332 sg_proc_sgp = proc_mkdir(sg_proc_sg_dirname, NULL); 2331 sg_proc_sgp = proc_mkdir(sg_proc_sg_dirname, NULL);
2333 if (!sg_proc_sgp) 2332 if (!sg_proc_sgp)
2334 return 1; 2333 return 1;
2335 for (k = 0; k < num_leaves; ++k) { 2334 for (k = 0; k < num_leaves; ++k) {
2336 leaf = &sg_proc_leaf_arr[k]; 2335 struct sg_proc_leaf *leaf = &sg_proc_leaf_arr[k];
2337 mask = leaf->fops->write ? S_IRUGO | S_IWUSR : S_IRUGO; 2336 umode_t mask = leaf->fops->write ? S_IRUGO | S_IWUSR : S_IRUGO;
2338 proc_create(leaf->name, mask, sg_proc_sgp, leaf->fops); 2337 proc_create(leaf->name, mask, sg_proc_sgp, leaf->fops);
2339 } 2338 }
2340 return 0; 2339 return 0;
diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
index a6a4a4e1f183..797e65cd03e8 100644
--- a/drivers/staging/iio/adc/ad7192.c
+++ b/drivers/staging/iio/adc/ad7192.c
@@ -838,14 +838,14 @@ static struct attribute *ad7192_attributes[] = {
838 NULL 838 NULL
839}; 839};
840 840
841static mode_t ad7192_attr_is_visible(struct kobject *kobj, 841static umode_t ad7192_attr_is_visible(struct kobject *kobj,
842 struct attribute *attr, int n) 842 struct attribute *attr, int n)
843{ 843{
844 struct device *dev = container_of(kobj, struct device, kobj); 844 struct device *dev = container_of(kobj, struct device, kobj);
845 struct iio_dev *indio_dev = dev_get_drvdata(dev); 845 struct iio_dev *indio_dev = dev_get_drvdata(dev);
846 struct ad7192_state *st = iio_priv(indio_dev); 846 struct ad7192_state *st = iio_priv(indio_dev);
847 847
848 mode_t mode = attr->mode; 848 umode_t mode = attr->mode;
849 849
850 if ((st->devid != ID_AD7195) && 850 if ((st->devid != ID_AD7195) &&
851 (attr == &iio_dev_attr_ac_excitation_en.dev_attr.attr)) 851 (attr == &iio_dev_attr_ac_excitation_en.dev_attr.attr))
diff --git a/drivers/staging/iio/adc/ad7606_core.c b/drivers/staging/iio/adc/ad7606_core.c
index 54423ab196fe..e3ecd3d2ef3a 100644
--- a/drivers/staging/iio/adc/ad7606_core.c
+++ b/drivers/staging/iio/adc/ad7606_core.c
@@ -205,14 +205,14 @@ static struct attribute *ad7606_attributes[] = {
205 NULL, 205 NULL,
206}; 206};
207 207
208static mode_t ad7606_attr_is_visible(struct kobject *kobj, 208static umode_t ad7606_attr_is_visible(struct kobject *kobj,
209 struct attribute *attr, int n) 209 struct attribute *attr, int n)
210{ 210{
211 struct device *dev = container_of(kobj, struct device, kobj); 211 struct device *dev = container_of(kobj, struct device, kobj);
212 struct iio_dev *indio_dev = dev_get_drvdata(dev); 212 struct iio_dev *indio_dev = dev_get_drvdata(dev);
213 struct ad7606_state *st = iio_priv(indio_dev); 213 struct ad7606_state *st = iio_priv(indio_dev);
214 214
215 mode_t mode = attr->mode; 215 umode_t mode = attr->mode;
216 216
217 if (!(gpio_is_valid(st->pdata->gpio_os0) && 217 if (!(gpio_is_valid(st->pdata->gpio_os0) &&
218 gpio_is_valid(st->pdata->gpio_os1) && 218 gpio_is_valid(st->pdata->gpio_os1) &&
diff --git a/drivers/staging/iio/dac/ad5446.c b/drivers/staging/iio/dac/ad5446.c
index ac3bc5f52dcc..ec701e939b6b 100644
--- a/drivers/staging/iio/dac/ad5446.c
+++ b/drivers/staging/iio/dac/ad5446.c
@@ -197,14 +197,14 @@ static struct attribute *ad5446_attributes[] = {
197 NULL, 197 NULL,
198}; 198};
199 199
200static mode_t ad5446_attr_is_visible(struct kobject *kobj, 200static umode_t ad5446_attr_is_visible(struct kobject *kobj,
201 struct attribute *attr, int n) 201 struct attribute *attr, int n)
202{ 202{
203 struct device *dev = container_of(kobj, struct device, kobj); 203 struct device *dev = container_of(kobj, struct device, kobj);
204 struct iio_dev *indio_dev = dev_get_drvdata(dev); 204 struct iio_dev *indio_dev = dev_get_drvdata(dev);
205 struct ad5446_state *st = iio_priv(indio_dev); 205 struct ad5446_state *st = iio_priv(indio_dev);
206 206
207 mode_t mode = attr->mode; 207 umode_t mode = attr->mode;
208 208
209 if (!st->chip_info->store_pwr_down && 209 if (!st->chip_info->store_pwr_down &&
210 (attr == &iio_dev_attr_out_voltage0_powerdown.dev_attr.attr || 210 (attr == &iio_dev_attr_out_voltage0_powerdown.dev_attr.attr ||
diff --git a/drivers/staging/iio/dds/ad9834.c b/drivers/staging/iio/dds/ad9834.c
index 2b31e3524826..51fda6f69815 100644
--- a/drivers/staging/iio/dds/ad9834.c
+++ b/drivers/staging/iio/dds/ad9834.c
@@ -281,14 +281,14 @@ static struct attribute *ad9834_attributes[] = {
281 NULL, 281 NULL,
282}; 282};
283 283
284static mode_t ad9834_attr_is_visible(struct kobject *kobj, 284static umode_t ad9834_attr_is_visible(struct kobject *kobj,
285 struct attribute *attr, int n) 285 struct attribute *attr, int n)
286{ 286{
287 struct device *dev = container_of(kobj, struct device, kobj); 287 struct device *dev = container_of(kobj, struct device, kobj);
288 struct iio_dev *indio_dev = dev_get_drvdata(dev); 288 struct iio_dev *indio_dev = dev_get_drvdata(dev);
289 struct ad9834_state *st = iio_priv(indio_dev); 289 struct ad9834_state *st = iio_priv(indio_dev);
290 290
291 mode_t mode = attr->mode; 291 umode_t mode = attr->mode;
292 292
293 if (((st->devid == ID_AD9833) || (st->devid == ID_AD9837)) && 293 if (((st->devid == ID_AD9833) || (st->devid == ID_AD9837)) &&
294 ((attr == &iio_dev_attr_dds0_out1_enable.dev_attr.attr) || 294 ((attr == &iio_dev_attr_dds0_out1_enable.dev_attr.attr) ||
diff --git a/drivers/staging/pohmelfs/dir.c b/drivers/staging/pohmelfs/dir.c
index 7598e77672a5..2ee4491b7136 100644
--- a/drivers/staging/pohmelfs/dir.c
+++ b/drivers/staging/pohmelfs/dir.c
@@ -590,13 +590,13 @@ out:
590 * during writeback for given inode. 590 * during writeback for given inode.
591 */ 591 */
592struct pohmelfs_inode *pohmelfs_create_entry_local(struct pohmelfs_sb *psb, 592struct pohmelfs_inode *pohmelfs_create_entry_local(struct pohmelfs_sb *psb,
593 struct pohmelfs_inode *parent, struct qstr *str, u64 start, int mode) 593 struct pohmelfs_inode *parent, struct qstr *str, u64 start, umode_t mode)
594{ 594{
595 struct pohmelfs_inode *npi; 595 struct pohmelfs_inode *npi;
596 int err = -ENOMEM; 596 int err = -ENOMEM;
597 struct netfs_inode_info info; 597 struct netfs_inode_info info;
598 598
599 dprintk("%s: name: '%s', mode: %o, start: %llu.\n", 599 dprintk("%s: name: '%s', mode: %ho, start: %llu.\n",
600 __func__, str->name, mode, start); 600 __func__, str->name, mode, start);
601 601
602 info.mode = mode; 602 info.mode = mode;
@@ -630,7 +630,8 @@ err_out_unlock:
630/* 630/*
631 * Create local object and bind it to dentry. 631 * Create local object and bind it to dentry.
632 */ 632 */
633static int pohmelfs_create_entry(struct inode *dir, struct dentry *dentry, u64 start, int mode) 633static int pohmelfs_create_entry(struct inode *dir, struct dentry *dentry,
634 u64 start, umode_t mode)
634{ 635{
635 struct pohmelfs_sb *psb = POHMELFS_SB(dir->i_sb); 636 struct pohmelfs_sb *psb = POHMELFS_SB(dir->i_sb);
636 struct pohmelfs_inode *npi, *parent; 637 struct pohmelfs_inode *npi, *parent;
@@ -661,13 +662,13 @@ static int pohmelfs_create_entry(struct inode *dir, struct dentry *dentry, u64 s
661/* 662/*
662 * VFS create and mkdir callbacks. 663 * VFS create and mkdir callbacks.
663 */ 664 */
664static int pohmelfs_create(struct inode *dir, struct dentry *dentry, int mode, 665static int pohmelfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
665 struct nameidata *nd) 666 struct nameidata *nd)
666{ 667{
667 return pohmelfs_create_entry(dir, dentry, 0, mode); 668 return pohmelfs_create_entry(dir, dentry, 0, mode);
668} 669}
669 670
670static int pohmelfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) 671static int pohmelfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
671{ 672{
672 int err; 673 int err;
673 674
diff --git a/drivers/staging/pohmelfs/inode.c b/drivers/staging/pohmelfs/inode.c
index 7a1955583b7d..807e3f324113 100644
--- a/drivers/staging/pohmelfs/inode.c
+++ b/drivers/staging/pohmelfs/inode.c
@@ -830,7 +830,6 @@ const struct address_space_operations pohmelfs_aops = {
830static void pohmelfs_i_callback(struct rcu_head *head) 830static void pohmelfs_i_callback(struct rcu_head *head)
831{ 831{
832 struct inode *inode = container_of(head, struct inode, i_rcu); 832 struct inode *inode = container_of(head, struct inode, i_rcu);
833 INIT_LIST_HEAD(&inode->i_dentry);
834 kmem_cache_free(pohmelfs_inode_cache, POHMELFS_I(inode)); 833 kmem_cache_free(pohmelfs_inode_cache, POHMELFS_I(inode));
835} 834}
836 835
@@ -1370,9 +1369,9 @@ static int pohmelfs_statfs(struct dentry *dentry, struct kstatfs *buf)
1370 return 0; 1369 return 0;
1371} 1370}
1372 1371
1373static int pohmelfs_show_options(struct seq_file *seq, struct vfsmount *vfs) 1372static int pohmelfs_show_options(struct seq_file *seq, struct dentry *root)
1374{ 1373{
1375 struct pohmelfs_sb *psb = POHMELFS_SB(vfs->mnt_sb); 1374 struct pohmelfs_sb *psb = POHMELFS_SB(root->d_sb);
1376 1375
1377 seq_printf(seq, ",idx=%u", psb->idx); 1376 seq_printf(seq, ",idx=%u", psb->idx);
1378 seq_printf(seq, ",trans_scan_timeout=%u", jiffies_to_msecs(psb->trans_scan_timeout)); 1377 seq_printf(seq, ",trans_scan_timeout=%u", jiffies_to_msecs(psb->trans_scan_timeout));
@@ -1760,11 +1759,11 @@ err_out_exit:
1760 return err; 1759 return err;
1761} 1760}
1762 1761
1763static int pohmelfs_show_stats(struct seq_file *m, struct vfsmount *mnt) 1762static int pohmelfs_show_stats(struct seq_file *m, struct dentry *root)
1764{ 1763{
1765 struct netfs_state *st; 1764 struct netfs_state *st;
1766 struct pohmelfs_ctl *ctl; 1765 struct pohmelfs_ctl *ctl;
1767 struct pohmelfs_sb *psb = POHMELFS_SB(mnt->mnt_sb); 1766 struct pohmelfs_sb *psb = POHMELFS_SB(root->d_sb);
1768 struct pohmelfs_config *c; 1767 struct pohmelfs_config *c;
1769 1768
1770 mutex_lock(&psb->state_lock); 1769 mutex_lock(&psb->state_lock);
diff --git a/drivers/staging/pohmelfs/netfs.h b/drivers/staging/pohmelfs/netfs.h
index 985b6b755d5d..f26894f2a57f 100644
--- a/drivers/staging/pohmelfs/netfs.h
+++ b/drivers/staging/pohmelfs/netfs.h
@@ -776,7 +776,7 @@ struct pohmelfs_name *pohmelfs_search_hash(struct pohmelfs_inode *pi, u32 hash);
776void pohmelfs_inode_del_inode(struct pohmelfs_sb *psb, struct pohmelfs_inode *pi); 776void pohmelfs_inode_del_inode(struct pohmelfs_sb *psb, struct pohmelfs_inode *pi);
777 777
778struct pohmelfs_inode *pohmelfs_create_entry_local(struct pohmelfs_sb *psb, 778struct pohmelfs_inode *pohmelfs_create_entry_local(struct pohmelfs_sb *psb,
779 struct pohmelfs_inode *parent, struct qstr *str, u64 start, int mode); 779 struct pohmelfs_inode *parent, struct qstr *str, u64 start, umode_t mode);
780 780
781int pohmelfs_write_create_inode(struct pohmelfs_inode *pi); 781int pohmelfs_write_create_inode(struct pohmelfs_inode *pi);
782 782
diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
index 43db715f1502..7867b7c4538e 100644
--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -32,7 +32,6 @@
32#include <linux/module.h> 32#include <linux/module.h>
33#include <linux/suspend.h> 33#include <linux/suspend.h>
34#include <linux/writeback.h> 34#include <linux/writeback.h>
35#include <linux/buffer_head.h> /* for fsync_bdev() */
36#include <linux/swap.h> 35#include <linux/swap.h>
37#include <linux/spinlock.h> 36#include <linux/spinlock.h>
38#include <linux/vt_kern.h> 37#include <linux/vt_kern.h>
@@ -41,6 +40,7 @@
41#include <linux/oom.h> 40#include <linux/oom.h>
42#include <linux/slab.h> 41#include <linux/slab.h>
43#include <linux/input.h> 42#include <linux/input.h>
43#include <linux/uaccess.h>
44 44
45#include <asm/ptrace.h> 45#include <asm/ptrace.h>
46#include <asm/irq_regs.h> 46#include <asm/irq_regs.h>
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 05085beb83db..3fdebd306b94 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -3267,7 +3267,7 @@ void __init console_init(void)
3267 } 3267 }
3268} 3268}
3269 3269
3270static char *tty_devnode(struct device *dev, mode_t *mode) 3270static char *tty_devnode(struct device *dev, umode_t *mode)
3271{ 3271{
3272 if (!mode) 3272 if (!mode)
3273 return NULL; 3273 return NULL;
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
1048static char *usblp_devnode(struct device *dev, mode_t *mode) 1048static 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
69static char *usb_devnode(struct device *dev, mode_t *mode) 69static 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;
65static umode_t busmode = USBFS_DEFAULT_BUSMODE; 65static umode_t busmode = USBFS_DEFAULT_BUSMODE;
66static umode_t listmode = USBFS_DEFAULT_LISTMODE; 66static umode_t listmode = USBFS_DEFAULT_LISTMODE;
67 67
68static int usbfs_show_options(struct seq_file *seq, struct vfsmount *mnt) 68static 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
273static struct inode *usbfs_get_inode (struct super_block *sb, int mode, dev_t dev) 273static 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 */
303static int usbfs_mknod (struct inode *dir, struct dentry *dentry, int mode, 301static 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
320static int usbfs_mkdir (struct inode *dir, struct dentry *dentry, int mode) 318static 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
331static int usbfs_create (struct inode *dir, struct dentry *dentry, int mode) 329static 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 */
492static int fs_create_by_name (const char *name, mode_t mode, 490static 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
528static struct dentry *fs_create_file (const char *name, mode_t mode, 525static 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
645static mode_t dev_string_attrs_are_visible(struct kobject *kobj, 645static 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
880static mode_t intf_assoc_attrs_are_visible(struct kobject *kobj, 880static 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
329static char *usb_devnode(struct device *dev, mode_t *mode) 329static 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
737static char *iowarrior_devnode(struct device *dev, mode_t *mode) 737static 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
272static char *legousbtower_devnode(struct device *dev, mode_t *mode) 272static 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}