- 04 Jan, 2005 40 commits
-
-
Stephen Rothwell authored
Since asm-generic/siginfo.h was created, the architectures have been slowly fixed/modified until noone uses HAVE_ARCH_SI_CODES or HAVE_ARCH_SIGEVENT_T any more, so this patch removes the checks for them. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Franz Pletz authored
With Andries Brouwer <Andries.Brouwer@cwi.nl> Fix various recursion scenarios wherein it was possible to mount a loop device on itself, either directly or via intermediate loops devices. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Pekka Enberg authored
This patch removes unused includes from drivers/block/noop-iosched.c. Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Pekka Enberg authored
This patch makes code static in drivers/block/noop-iosched.c and adds __init and __exit for module initialization and cleanup functions. Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Randy Dunlap authored
When setting the 'cpu_isolated_map' mask, check that the user input value is valid (in range 0 .. NR_CPUS - 1). Also fix up kernel-parameters.txt for this parameter. Signed-off-by: Randy Dunlap <rddunlap@osdl.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Zwane Mwaikambo authored
__handle_sysrq was modified to do a spin_lock_irqsave so we were entering smp_send_stop with interrupts. So reenable interrupts to prevent the possible smp_call_function() deadlock. (It's still deadlocky if the sysrq handler is against called via an interrupt from a different device, but that seems unlikely). Signed-off-by: Zwane Mwaikambo <zwane@holomorphy.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Prasanna Meda authored
A while back we added the PR_SET_NAME prctl, but no PR_GET_NAME. I guess we should add this, if only to enable testing of PR_SET_NAME. Signed-off-by: Prasanna Meda <pmeda@akamai.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Randy Dunlap authored
Move 'panic_timeout' to linux/kernel.h. ipmi_watchdog.c wanted to know why panic_timeout isn't in some header file. However, ipmi_watchdog.c doesn't even use it, so that reference was deleted. Other references now use kernel.h instead of straight extern int. Signed-off-by: Randy Dunlap <rddunlap@osdl.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Matt Domsch authored
EDD: add edd=off and edd=skipmbr command line options New command line options edd=off (or edd=of) edd=skipmbr (or edd=sk) runtime options for disabling all EDD int13 calls completely, or for skipping the int13 READ SECTOR calls, respectively. These are provided to allow Linux distributions to include CONFIG_EDD=m, yet allow end-users to disable parts of EDD which may not work well with their system's BIOS. I incorporated comments from Randy Dunlap, and got an ack from Andi Kleen. Signed-off-by: Matt Domsch <Matt_Domsch@dell.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
J. A. Magallon authored
I need this to make gconfig work under gtk-2.4. Without this, it just coredumps. There is some problem with pixmap creation/usage from XPM in the way it is done in gconf, so I just added some stock icons. It is even prettier..;) Could someone test this still works on gtk-2.0 or 2.2 ? Changes: - change the wiget class 'button' in glade files to something known to glade (GtkToolButton) - use 'stock-id' property for toolbar buttons instead of "stock_pixmap" - change unknown signal "pressed" to "clicked" - remove manual setting of icons in gconf.c Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Rusty Russell authored
Return EINVAL for invalid sched_setaffinity on UP. I was a little surprised that sys_sched_setaffinity for CPU 1 didn't fail on my UP box. With CONFIG_SMP it would have. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Tvrtko A. Ursulin authored
Correctly propagate the return value from smb_open(). Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Manfred Spraul authored
Based on an initial patch from Oleg Nesterov <oleg@tv-sign.ru> rcu_data.last_qsctr is not needed. Actually, not even a counter is needed, just a flag that indicates that there was a quiescent state. Signed-Off-By: Manfred Spraul <manfred@colorfullife.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Manfred Spraul authored
The patch below makes two needlessly global structs static. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Manfred Spraul <manfred@colorfullife.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Oleg Nesterov authored
rcu_ctrlblk.lock is used to read the ->cur and ->next_pending atomically in __rcu_process_callbacks(). It can be replaced by a couple of memory barriers. rcu_start_batch: rcp->next_pending = 0; smp_wmb(); rcp->cur++; __rcu_process_callbacks: rdp->batch = rcp->cur + 1; smp_rmb(); if (!rcp->next_pending) rcu_start_batch(rcp, rsp, 1); This way, if __rcu_process_callbacks() sees incremented ->cur value, it must also see that ->next_pending == 0 (or rcu_start_batch() is already in progress on another cpu). Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Adrian Bunk authored
drivers/char/ip2/ contained three programs. Besides shipping programs at this place doesn't sound like a good idea, they didn't even all compile. The patch below removes them. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Andi Kleen authored
This patch corrects a problem that was originally added with the nanosecond timestamps in stat patch. The problem is that some file systems don't have enough space in their on disk inode to save nanosecond timestamps, so they truncate the c/a/mtime to seconds when flushing an dirty node. In core the inode would have full jiffies granuality. This can be observed by programs as a timestamp that jumps backwards under specific loads when an inode is flushed and then reloaded from disk. The problem was already known when the original patch went in, but it wasn't deemed important enough at that time. So far there has been only one report of it causing problems. Now Tridge is worried that it will break running Excel over samba4 because Excel seems to do very anal timestamp checking and samba4 will supply 100ns timestamps over the network. This patch solves it by putting the time resolution into the superblock of a fs and always rounding the in core timestamps to that granuality. This also supercedes some previous ext2/3 hacks to flush the inode less often when only the subsecond timestamp changes. I tried to keep the overhead low, in particular it tries to keep divisions out of fast paths as far as possible. The patch is quite big but 99% of it is just relatively straight forward search'n'replace in a lot of fs. Unconverted filesystems will default to a 1ns granuality, but may still show the problem if they continue to use CURRENT_TIME. I converted all in tree fs. One possible future extension of this would be to have two time granualities per superblock - one that specifies the visible resolution, and the other to specify how often timestamps should be flushed to disk, which could be tuned with a mount option per fs (e.g. often m/atimes don't need to be flushed every second). Would be easy to do as an addon if someone is interested. Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Martin Schwidefsky authored
I realized that the best way to get the sys_time/sys_stime problem fixed is to make sys_time 64 bit safe by using "time_t *" instead of "int *" and to introduce two proper compat functions compat_sys_time and compat_sys_stime. The prototype change of sys_time is transparent for 32 bit architectures because both "int" and "time_t" are 32 bit. For 64 bit the type change would be wrong but luckily no 64 bit architecture uses sys_time/sys_stime in 64 bit mode. The patch makes the following change: ia64 : Remove sys32_time, use compat_sys_time and add (!!) compat_sys_stime to compat syscall table. mips : Use compat_sys_time/compat_sys_stime in 32 bit syscall table. Add #ifdef magic to compile sys_time/sys_stime and compat_sys_time/compat_sys_stime only if needed. parisc : Remove sys32_time, use compat_sys_time and compat_sys_stime. ppc64 : remove sys32_time, ppc64_sys32_stime and ppc64_sys_stime. Use common compat_sys_time, compat_sys_stime and sys_stime. s390 : Use compat_sys_stime. Add #ifdef magic to compile sys_time/sys_stime and compat_sys_time/compat_sys_stime only if needed. sparc64 : Use compat_sys_time/compat_Sys_stime in 32 bit syscall table. um : Remove um_time and um_stime. Use common functions sys_time and sys_stime. This adds a CAP_SYS_TIME check to UMs stime call. x86_64 : Remove sys32_time. Use compat_sys_time and compat_sys_stime in 32 bit syscall table. The original stime bug is fixed for mips, parisc, s390, sparc64 and x86_64. Can the arch-maintainers please take a look at this? From: Martin Schwidefsky <schwidefsky@de.ibm.com> Convert compat_time_t to time_t in 32 bit emulation for sys_stime and consolidate all the different implementation of sys_time, sys_stime and their 32-bit emulation parts. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Adrian Bunk authored
For the kernel, it would be logical to use -ffreestanding. The kernel is not a hosted environment with a standard C library. The gcc option -ffreestanding is supported by both gcc 2.95 and 3.4, which covers the whole range of currently supported compilers. Regarding changes caused by this patch: Andi Kleen reported: Newer gcc rewrites sprintf(buf,"%s",str) to strcpy(buf,str) transparently. This is only true with unit-at-a-time (disabled on i386 but enabled on x86_64). The Linux kernel doesn't offer a standard C library, and such transparent replacements of kernel functions with builtins are quite fragile. Even with -ffreestanding, it's still possilble to explicitely use a gcc builtin if desired. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Alexander Nyberg authored
This fixes a theoretical bug indicated in: http://bugme.osdl.org/show_bug.cgi?id=240 It prevents overflow in case the required buffer is larger than the passed buffer. This I found to be the minimally intrusive change. Signed-off-by: Alexander Nyberg <alexn@dsv.su.se> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Alex Tomas authored
1) intent of the patch is to get possibility to store EAs in the body of large inode. it saves space and improves performance in some cases 2) the patch is quite simple: it works the same way original xattr does, but using other storage (inode body). body has priority over separate block. original routines (ext3_xattr_get, ext3_xattr_list, ext3_xattr_set) are renamed to ext3_xattr_block_*. new routines that handle inode storate are added (ext3_xattr_ibody_get, ext3_xattr_ibody_list, ext3_xattr_ibody_set). routines ext3_xattr_get, ext3_xattr_list and ext3_xattr_set allow user to accesss both the storages transparently 3) the change makes sense on filesystem with inode size >= 256 bytes only. 2.4 kernels don't support such a filesystems, AFAIK. 2.6 kernels do support and ignore EAs stored in a body w/o the patch 4) debugfs and e2fsck need to be patched to deal with EAs in inode the patch will be sent later 5) testing results: a) Andrew Samba Master (tridge) has done successful tests b) we've been using ea-in-inode feature in Lustre for many months Signed-off-by: Andreas Dilger <adilger@clusterfs.com> Signed-off-by: Alex Tomas <alex@clusterfs.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Andrew Morton authored
We hold i_sem during the various sync() operations to prevent livelocks: if another thread is dirtying the file, a sync() may never return. Or at least, that used to be true when we were using the per-address_space page lists. Since writeback has used radix tree traversal it is not possible to livelock the sync() operations, because they only visit each page a single time. sync_page_range() (used by O_SYNC writes) has not been holding i_sem for quite some time, for the above reasons. The patch converts fsync(), fdatasync() and msync() to also not hold i_sem during the radix-tree-based writeback. Now, we _do_ still need to hold i_sem across the file->f_op->fsync() call, because that is still based on a list_head walk, and is still livelockable. But in the case of msync() I deliberately left i_sem untaken. This is because we're currently deadlockable in msync, because mmap_sem is already held, and mmap_sem nexts inside i_sem, due to direct-io.c. And yes, the ranking of down_read() veruss down() does matter: Task A Task B Task C down_read(rwsem) down(sem) down_write(rwsem) down(sem) down_read(rwsem) C's down_write() will cause B's down_read to block. B holds `sem', so A will never release `rwsem'. So the patch fixes a hard-to-hit triple-task deadlock, but adds a possible livelock in msync(). It is possible to fix sys_msync() so that it takes i_sem outside i_mmap_sem. Later. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Andrew Morton authored
We can call might_sleep() functions on the oops handling path (under do_exit). There seem little point in emitting spurious might_sleep() warnings into the logs after the kernel has oopsed. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Prasanna Meda authored
Bring the total_forks under tasklist_lock. When most of the fork code icluding nr_threads is moved to copy_process() from do_fork() code in 2.6, this is left out. Althought accuracy of total_forks is not important, it would be nice to add this. It does not involve additional cost, and the code will be cleaner if it is grouped with nr_threads. The difference is, total_forks will increase on fork, but nr_threads will increase on fork and decrease on the exit. I also moved extern decleration to sched.h from proc_misc.c. Signed-off-by: Prasanna Meda <pmeda@akamai.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Li Shaohua authored
After resume from S3, 'date' shows time run too fast. Signed-off-by: Li Shaohua <shaohua.li@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Matthew Dobson authored
In the course of another patch I've been working on, I stumbled across some weirdness with some of the SD_*_INIT sched_domains initializers. A day or so of digging narrowed it down to the CPU_MASK_NONE initializer nested inside the sched_domain initializers. The errors I got were: kernel/sched.c:4812: error: initializer element is not constant kernel/sched.c:4812: error: (near initialization for `sched_domain_dummy') kernel/sched.c:4812: error: initializer element is not constant which was this line: static struct sched_domain sched_domain_dummy = SD_CPU_INIT; Janis Johnson, a GCC hacker, told me the following:
-
Stephen C. Tweedie authored
This patch improves ext3's ability to deal with corruption on-disk. If we try to delete a metadata block twice, we confuse ext3's internal revoke error-checking, resulting in a BUG(). But this can occur in practice due to a corrupt indirect block, so we should attempt to fail gracefully. Downgrade the assert failure to a JH_EXPECT_BH failure, and return EIO when it occurs. This is easily reproduced with a sample ext3 fs image containing an inode which references the same indirect block more than once. Deleting that inode will BUG() an unfixed kernel with: Assertion failure in journal_revoke() at fs/jbd/revoke.c:379: "!buffer_revoked(bh)" With the fix, ext3 recovers gracefully. Signed-off-by: Stephen Tweedie <sct@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Stephen C. Tweedie authored
This patch improves ext3's ability to deal with corruption on-disk. If we ever get a corrupt inode or indirect block, then an attempt to delete it can end up trying to remove any block on the fs, including bitmap blocks. This can cause ext3 to assert-fail as we end up trying to do an ext3_forget on a buffer with b_committed_data set. The fix is to downgrade this to an IO error and journal abort, so that we take the filesystem readonly but don't bring down the whole kernel. Make J_EXPECT_JH() return a value so it can be easily tested and yet still retained as an assert failure if we build ext3 with full internal debugging enabled. Make journal_forget() return an error code so that in this case the error can be passed up to the caller. This is easily reproduced with a sample ext3 fs image containing an inode whose direct and indirect blocks refer to a block bitmap block. Allocating new blocks and then deleting that inode will BUG() with: Assertion failure in journal_forget() at fs/jbd/transaction.c:1228: "!jh->b_committed_data" With the fix, ext3 recovers gracefully. Signed-off-by: Stephen Tweedie <sct@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Stephen C. Tweedie authored
This patch improves ext3's error logging when we encounter an on-disk corruption. Previously, a transaction (such as a truncate) which encountered many corruptions (eg. a single highly-corrupt indirect block) would emit copious "aborting transaction" errors to the log. Even worse, encountering an aborted journal can count as such an error, leading to a flood of spurious "aborting transaction: Journal has aborted" errors. With the fix, only emit that message on the first error. The patch also restores a missing \n in that printk path. Signed-off-by: Stephen Tweedie <sct@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Adrian Bunk authored
All blk.h users were converted in 2.5, and at the same time blk.h began giving a warning. The patch below removes this obsolete file. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Corey Minyard authored
This patch removes some unneeded cruft that Adrian found, and also turns off the shutdown of the timer when removing the module. Since the timer is shutdown when the driver is closed (unless no way out is specified) this is unnecessary and defeats the no way out option. - remove some completely unused code - make some needlessly global code static - removal of some EXPORT_SYMBOL'ed code with zero users. - Removal of the timer shutdown on module removal Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Corey Minyard <minyard@acm.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Robin Holt authored
Testing revealed long pauses of the entire system while autofs initiated umounts as a result of timing out the mounts. It was noticed that during a umount, the BKL is held while scanning the inode_list and removing and inodes that are candidates. This patch moves locking until after the first pass had gone through the inode_list. Testing revelead that on an ia64 machine with a filesystem that had 8.4 Million inodes, there were no observable pauses during the umount. This was down from over 4 seconds without this patch. Signed-Off-By: Robin Holt <holt@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Christoph Hellwig authored
The only common field in irq_cpustat is __softirq_pending, i386 and ppc have some of their own. Remove all unused obsolete fields from various architectures. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Christoph Hellwig authored
This code is the same for all architectures with the following invariants: - arm gurantees irqs are disabled when calling irq_exit so it can call __do_softirq directly instead of do_softirq - arm26 is totally broken for about half a year, I didn't care for it - some architectures use softirq_pending(smp_processor_id()) instead of local_softirq_pending, but they always evaluate to the same This patch moves the out of line irq_exit implementation from kernel/irq/handle.c which depends on CONFIG_GENERIC_HARDIRQS to kernel/softirq.c which is always compiled, tweaks it for the arm special case and moves the irq_enter/irq_exit/nmi_enter/nmi_exit bits from asm-*/hardirq.h to linux/hardirq.h Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Randy Dunlap authored
Fix module parameter quote handling. Module parameter strings (with spaces) are quoted like so: "modprm=this test" and not like this: modprm="this test" Signed-off-by: Randy Dunlap <rddunlap@osdl.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Kirill Korotaev authored
This patch fixes incorrect address range check in do_getname(). Theoretically this can lead to do_getname() failure on kernel address space string on the TASK_SIZE boundary addresses when 4GB split is ON. (akpm: I don't see why this check exists at all, actually. afaict the only effect of removing it is that we'll then generate -EFAULT on a non-null-terminated pathname which ends exactly at TASK_SIZE). Signed-Off-By: Kirill Korotaev <dev@sw.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Jay Lan authored
This patch is to offer common accounting data collection method at memory usage for various accounting packages including BSD accounting, ELSA, CSA and any other acct packages that use a common layer of data collection. New struct fields are added to mm_struct to save high watermarks of rss usage as well as virtual memory usage. New struct fields are added to task_struct to collect accumulated rss usage and vm usages. These data are collected on per process basis. Signed-off-by: Jay Lan <jlan@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Jay Lan authored
This patch is to offer common accounting data collection method at I/O for various accounting packages including BSD accounting, ELSA, CSA and any other acct packages that use a common layer of data collection. Patch is made to fs/read_write.c to collect per process data on character read/written in bytes and number of read/write syscalls made. New struct fields are added to task_struct to store the data. These data are collected on per process basis. Signed-off-by: Jay Lan <jlan@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
David Howells authored
The attached patch includes prio-tree support and adds cross-referencing of VMAs with address spaces back in, as is done under normal MMU Linux. Signed-Off-By: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
David Howells authored
The attached patch applies some further fixes and extensions to the nommu mmap implementation: (1) /proc/maps distinguishes shareable private mappings and real shared mappings by marking the former with 's' and the latter with 'S'. (2) Rearrange and optimise the checking portion of do_mmap_pgoff() to make it easier to follow. (3) Only set VM_SHARED on MAP_SHARED mappings. Its presence indicates that the backing memory is supplied by the underlying file or chardev. VM_MAYSHARE indicates that a VMA may be shared if it's a private VMA. The memory for a private VMA is allocated by do_mmap_pgoff() from a kmalloc slab and then the file contents are read into it before returning. (4) Permit MAP_SHARED + PROT_WRITE on memory-backed files[*] and chardevs to indicate a contiguous area of memory when its get_unmapped_area() is called if the backing fs/chardev is willing. [*] file->f_mapping->backing_dev_info->memory_backed == 1 (5) Require chardevs and files that support to provide a get_unmapped_area() file operation. (6) Made sure a private mapping of /dev/zero is possible. Shared mappings of /dev/zero are not currently supported because this'd need greater interaction of mmap with the chardev driver than is currently supported. (7) Add in some extra checks from mm/mmap.c: security, file having write access for a writable shared mapping, file not being in append mode. (8) Only account the mapping memory if it's allocated here; memory belonging to a shared chardev or file is not accounted. With this patch it should be possible to map contiguous flash files directly out of ROM simply by providing get_unmapped_area() for a read-only/shared mapping. I think that it might be worth splitting do_mmap_pgoff() up into smaller subfunctions: one to handle the checking, one to handle shared mappings and one to handle private mappings. Signed-Off-By: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-