diff options
Diffstat (limited to 'drivers/char/mem.c')
-rw-r--r-- | drivers/char/mem.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c index a074fceb67d..fba76fb55ab 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c @@ -5,7 +5,7 @@ * * Added devfs support. * Jan-11-1998, C. Scott Ananian <cananian@alumni.princeton.edu> - * Shared /dev/zero mmaping support, Feb 2000, Kanoj Sarcar <kanoj@sgi.com> + * Shared /dev/zero mmapping support, Feb 2000, Kanoj Sarcar <kanoj@sgi.com> */ #include <linux/mm.h> @@ -26,7 +26,6 @@ #include <linux/bootmem.h> #include <linux/splice.h> #include <linux/pfn.h> -#include <linux/smp_lock.h> #include <asm/uaccess.h> #include <asm/io.h> @@ -44,7 +43,7 @@ static inline int uncached_access(struct file *file, unsigned long addr) { #if defined(CONFIG_IA64) /* - * On ia64, we ignore O_SYNC because we cannot tolerate memory attribute aliases. + * On ia64, we ignore O_DSYNC because we cannot tolerate memory attribute aliases. */ return !(efi_mem_attributes(addr) & EFI_MEMORY_WB); #elif defined(CONFIG_MIPS) @@ -57,9 +56,9 @@ static inline int uncached_access(struct file *file, unsigned long addr) #else /* * Accessing memory above the top the kernel knows about or through a file pointer - * that was marked O_SYNC will be done non-cached. + * that was marked O_DSYNC will be done non-cached. */ - if (file->f_flags & O_SYNC) + if (file->f_flags & O_DSYNC) return 1; return addr >= __pa(high_memory); #endif @@ -892,29 +891,23 @@ static int memory_open(struct inode *inode, struct file *filp) { int minor; const struct memdev *dev; - int ret = -ENXIO; - - lock_kernel(); minor = iminor(inode); if (minor >= ARRAY_SIZE(devlist)) - goto out; + return -ENXIO; dev = &devlist[minor]; if (!dev->fops) - goto out; + return -ENXIO; filp->f_op = dev->fops; if (dev->dev_info) filp->f_mapping->backing_dev_info = dev->dev_info; if (dev->fops->open) - ret = dev->fops->open(inode, filp); - else - ret = 0; -out: - unlock_kernel(); - return ret; + return dev->fops->open(inode, filp); + + return 0; } static const struct file_operations memory_fops = { |