Commit d9c0ffee authored by Linus Torvalds's avatar Linus Torvalds

Import 2.1.128

parent c2ef85f5
......@@ -1136,7 +1136,7 @@ osf_select(int n, fd_set *inp, fd_set *outp, fd_set *exp,
unsigned long timeout;
int ret;
timeout = ~0UL;
timeout = MAX_SCHEDULE_TIMEOUT;
if (tvp) {
time_t sec, usec;
......@@ -1147,8 +1147,6 @@ osf_select(int n, fd_set *inp, fd_set *outp, fd_set *exp,
timeout = (usec + 1000000/HZ - 1) / (1000000/HZ);
timeout += sec * HZ;
if (timeout)
timeout += jiffies + 1;
}
ret = -ENOMEM;
......@@ -1168,7 +1166,7 @@ osf_select(int n, fd_set *inp, fd_set *outp, fd_set *exp,
zero_fd_set(n, fds->res_out);
zero_fd_set(n, fds->res_ex);
ret = do_select(n, fds, timeout);
ret = do_select(n, fds, &timeout);
/* OSF does not copy back the remaining time. */
......
......@@ -331,10 +331,16 @@ void add_request(struct blk_dev_struct * dev, struct request * req)
goto out;
}
for ( ; tmp->next ; tmp = tmp->next) {
if ((IN_ORDER(tmp,req) ||
!IN_ORDER(tmp,tmp->next)) &&
IN_ORDER(req,tmp->next))
break;
const int after_current = IN_ORDER(tmp,req);
const int before_next = IN_ORDER(req,tmp->next);
if (!IN_ORDER(tmp,tmp->next)) {
if (after_current || before_next)
break;
} else {
if (after_current && before_next)
break;
}
}
req->next = tmp->next;
tmp->next = req;
......
......@@ -445,9 +445,9 @@ static int exec_mmap(void)
/*
* This function makes sure the current process has its own signal table,
* so that flush_old_signals can later reset the signals without disturbing
* other processes. (Other processes might share the signal table via
* the CLONE_SIGHAND option to clone().)
* so that flush_signal_handlers can later reset the handlers without
* disturbing other processes. (Other processes might share the signal
* table via the CLONE_SIGHAND option to clone().)
*/
static inline int make_private_signals(void)
......@@ -485,13 +485,6 @@ static inline void release_old_signals(struct signal_struct * oldsig)
* These functions flushes out all traces of the currently running executable
* so that a new one can be started
*/
static inline void flush_old_signals(struct task_struct *t)
{
#if 0
flush_signals(t);
#endif
flush_signal_handlers(t);
}
static inline void flush_old_files(struct files_struct * files)
{
......@@ -554,7 +547,7 @@ int flush_old_exec(struct linux_binprm * bprm)
permission(bprm->dentry->d_inode,MAY_READ))
current->dumpable = 0;
flush_old_signals(current);
flush_signal_handlers(current);
flush_old_files(current->files);
return 0;
......
......@@ -59,7 +59,7 @@ struct inode_operations isofs_dir_inode_operations =
NULL, /* follow_link */
NULL, /* readpage */
NULL, /* writepage */
isofs_bmap, /* bmap */
NULL, /* bmap */
NULL, /* truncate */
NULL /* permission */
};
......
......@@ -144,7 +144,7 @@ static int V1_sync_dindirect(struct inode *inode, unsigned short *diblock,
return err;
}
int V1_minix_sync_file(struct inode * inode, struct file * file)
static int V1_minix_sync_file(struct inode * inode, struct file * file)
{
int wait, err = 0;
......@@ -305,7 +305,7 @@ static int V2_sync_tindirect(struct inode *inode, unsigned long *tiblock,
return err;
}
int V2_minix_sync_file(struct inode * inode, struct file * file)
static int V2_minix_sync_file(struct inode * inode, struct file * file)
{
int wait, err = 0;
......
......@@ -40,7 +40,7 @@ static void minix_commit_super (struct super_block * sb,
sb->s_dirt = 0;
}
void minix_write_super (struct super_block * sb)
static void minix_write_super (struct super_block * sb)
{
struct minix_super_block * ms;
......@@ -55,7 +55,7 @@ void minix_write_super (struct super_block * sb)
}
void minix_put_super(struct super_block *sb)
static void minix_put_super(struct super_block *sb)
{
int i;
......@@ -86,7 +86,7 @@ static struct super_operations minix_sops = {
minix_remount
};
int minix_remount (struct super_block * sb, int * flags, char * data)
static int minix_remount (struct super_block * sb, int * flags, char * data)
{
struct minix_super_block * ms;
......@@ -162,7 +162,7 @@ static const char * minix_checkroot(struct super_block *s, struct inode *dir)
return errmsg;
}
struct super_block *minix_read_super(struct super_block *s, void *data,
static struct super_block *minix_read_super(struct super_block *s, void *data,
int silent)
{
struct buffer_head *bh;
......@@ -326,7 +326,7 @@ struct super_block *minix_read_super(struct super_block *s, void *data,
return NULL;
}
int minix_statfs(struct super_block *sb, struct statfs *buf, int bufsiz)
static int minix_statfs(struct super_block *sb, struct statfs *buf, int bufsiz)
{
struct statfs tmp;
......@@ -830,7 +830,7 @@ static void V2_minix_read_inode(struct inode * inode)
/*
* The global function to read an inode.
*/
void minix_read_inode(struct inode * inode)
static void minix_read_inode(struct inode * inode)
{
if (INODE_VERSION(inode) == MINIX_V1)
V1_minix_read_inode(inode);
......@@ -916,7 +916,7 @@ static struct buffer_head * V2_minix_update_inode(struct inode * inode)
return bh;
}
struct buffer_head *minix_update_inode(struct inode *inode)
static struct buffer_head *minix_update_inode(struct inode *inode)
{
if (INODE_VERSION(inode) == MINIX_V1)
return V1_minix_update_inode(inode);
......@@ -924,7 +924,7 @@ struct buffer_head *minix_update_inode(struct inode *inode)
return V2_minix_update_inode(inode);
}
void minix_write_inode(struct inode * inode)
static void minix_write_inode(struct inode * inode)
{
struct buffer_head *bh;
......
......@@ -176,7 +176,7 @@ static int V1_trunc_dindirect(struct inode * inode, int offset, unsigned short *
return retry;
}
void V1_minix_truncate(struct inode * inode)
static void V1_minix_truncate(struct inode * inode)
{
int retry;
......
......@@ -993,7 +993,7 @@ struct inode_operations msdos_dir_inode_operations = {
NULL, /* follow_link */
NULL, /* readpage */
NULL, /* writepage */
fat_bmap, /* bmap */
NULL, /* bmap */
NULL, /* truncate */
NULL, /* permission */
NULL, /* smap */
......
......@@ -230,6 +230,17 @@ nfs_readpage(struct file *file, struct page *page)
dprintk("NFS: nfs_readpage (%p %ld@%ld)\n",
page, PAGE_SIZE, page->offset);
set_bit(PG_locked, &page->flags);
/*
* Try to flush any pending writes to the file..
*
* NOTE! Because we own the page lock, there cannot
* be any new pending writes generated at this point.
*/
error = nfs_flush_pages(inode, 0, 0, 0);
if (error)
return error;
atomic_inc(&page->count);
if (!IS_SWAPFILE(inode) && !PageError(page) &&
NFS_SERVER(inode)->rsize >= PAGE_SIZE)
......
This diff is collapsed.
......@@ -180,11 +180,7 @@ static struct file_operations qnx4_file_operations =
struct inode_operations qnx4_file_inode_operations =
{
&qnx4_file_operations, /* default file operations */
#ifdef CONFIG_QNX4FS_RW
qnx4_create, /* create */
#else
NULL,
#endif
NULL, /* create? It's not a directory */
NULL, /* lookup */
NULL, /* link */
NULL, /* unlink */
......
......@@ -32,11 +32,7 @@ static struct dentry *qnx4_follow_link(struct dentry *, struct dentry *);
struct inode_operations qnx4_symlink_inode_operations =
{
NULL, /* no file-operations */
#ifdef CONFIG_QNX4FS_RW
qnx4_create, /* create */
#else
NULL,
#endif
NULL, /* create */
NULL, /* lookup */
NULL, /* link */
NULL, /* unlink */
......
......@@ -6,12 +6,9 @@
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/stat.h>
#include <linux/file.h>
#include <linux/kernel.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <asm/uaccess.h>
......
......@@ -195,40 +195,15 @@ smb_writepage(struct file *file, struct page *page)
}
static int
smb_updatepage(struct file *file, struct page *page, const char *buffer,
unsigned long offset, unsigned int count, int sync)
smb_updatepage(struct file *file, struct page *page, unsigned long offset, unsigned int count, int sync)
{
struct dentry *dentry = file->f_dentry;
unsigned long page_addr = page_address(page);
int result;
pr_debug("SMBFS: smb_updatepage(%s/%s %d@%ld, sync=%d)\n",
dentry->d_parent->d_name.name, dentry->d_name.name,
count, page->offset+offset, sync);
#ifdef SMBFS_PARANOIA
if (test_bit(PG_locked, &page->flags))
printk("smb_updatepage: page already locked!\n");
#endif
set_bit(PG_locked, &page->flags);
atomic_inc(&page->count);
if (copy_from_user((char *) page_addr + offset, buffer, count))
goto bad_fault;
result = smb_writepage_sync(dentry, page, offset, count);
out:
free_page(page_addr);
return result;
bad_fault:
#ifdef SMBFS_PARANOIA
printk("smb_updatepage: fault at addr=%lu, offset=%lu, buffer=%p\n",
page_addr, offset, buffer);
#endif
result = -EFAULT;
clear_bit(PG_uptodate, &page->flags);
smb_unlock_page(page);
goto out;
return smb_writepage_sync(dentry, page, offset, count);
}
static ssize_t
......
......@@ -220,7 +220,7 @@ struct inode_operations ufs_dir_inode_operations = {
NULL, /* follow_link */
NULL, /* readpage */
NULL, /* writepage */
ufs_bmap, /* bmap */
NULL, /* bmap */
NULL, /* truncate */
ufs_permission, /* permission */
NULL, /* smap */
......
......@@ -1846,7 +1846,7 @@ struct inode_operations vfat_dir_inode_operations = {
NULL, /* followlink */
NULL, /* readpage */
NULL, /* writepage */
fat_bmap, /* bmap */
NULL, /* bmap */
NULL, /* truncate */
NULL /* permission */
};
......
......@@ -101,31 +101,29 @@ struct nfs_wreq {
struct dentry * wb_dentry; /* dentry referenced */
struct inode * wb_inode; /* inode referenced */
struct page * wb_page; /* page to be written */
struct wait_queue * wb_wait; /* wait for completion */
unsigned int wb_offset; /* offset within page */
unsigned int wb_bytes; /* dirty range */
unsigned int wb_count; /* user count */
int wb_status;
pid_t wb_pid; /* owner process */
unsigned short wb_flags; /* status flags */
struct nfs_writeargs wb_args; /* NFS RPC stuff */
struct nfs_fattr wb_fattr; /* file attributes */
};
#define wb_status wb_task.tk_status
#define WB_NEXT(req) ((struct nfs_wreq *) ((req)->wb_list.next))
/*
* Various flags for wb_flags
*/
#define NFS_WRITE_WANTLOCK 0x0001 /* needs to lock page */
#define NFS_WRITE_LOCKED 0x0002 /* holds lock on page */
#define NFS_WRITE_CANCELLED 0x0004 /* has been cancelled */
#define NFS_WRITE_UNCOMMITTED 0x0008 /* written but uncommitted (NFSv3) */
#define NFS_WRITE_INVALIDATE 0x0010 /* invalidate after write */
#define NFS_WRITE_INPROGRESS 0x0100 /* RPC call in progress */
#define NFS_WRITE_COMPLETE 0x0200 /* RPC call completed */
#define WB_WANTLOCK(req) ((req)->wb_flags & NFS_WRITE_WANTLOCK)
#define WB_HAVELOCK(req) ((req)->wb_flags & NFS_WRITE_LOCKED)
#define WB_CANCELLED(req) ((req)->wb_flags & NFS_WRITE_CANCELLED)
#define WB_UNCOMMITTED(req) ((req)->wb_flags & NFS_WRITE_UNCOMMITTED)
#define WB_INVALIDATE(req) ((req)->wb_flags & NFS_WRITE_INVALIDATE)
......@@ -217,6 +215,7 @@ extern int nfs_writepage(struct file *, struct page *);
extern int nfs_find_dentry_request(struct inode *, struct dentry *);
extern int nfs_check_failed_request(struct inode *);
extern int nfs_check_error(struct inode *);
extern int nfs_flush_pages(struct inode *, pid_t, off_t, off_t);
extern int nfs_flush_dirty_pages(struct inode *, pid_t, off_t, off_t);
extern int nfs_truncate_dirty_pages(struct inode *, unsigned long);
extern void nfs_invalidate_pages(struct inode *);
......@@ -245,13 +244,10 @@ nfs_revalidate_inode(struct nfs_server *server, struct dentry *dentry)
return _nfs_revalidate_inode(server, dentry);
}
extern struct nfs_wreq * nfs_failed_requests;
static inline int
nfs_write_error(struct inode *inode)
{
if (nfs_failed_requests == NULL)
return 0;
return nfs_check_error(inode);
return NFS_WRITEBACK(inode) && nfs_check_error(inode);
}
/* NFS root */
......
......@@ -20,7 +20,6 @@ extern unsigned long event;
#include <linux/tty.h>
#include <linux/sem.h>
#include <linux/signal.h>
#include <linux/capability.h>
#include <linux/securebits.h>
/*
......@@ -65,11 +64,9 @@ extern int nr_running, nr_tasks;
extern int last_pid;
#include <linux/fs.h>
#include <linux/signal.h>
#include <linux/time.h>
#include <linux/param.h>
#include <linux/resource.h>
#include <linux/ptrace.h>
#include <linux/timer.h>
#include <asm/processor.h>
......
......@@ -11,16 +11,11 @@
#define __KERNEL_SYSCALLS__
#include <linux/types.h>
#include <linux/sched.h>
#include <linux/fcntl.h>
#include <linux/config.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/tty.h>
#include <linux/unistd.h>
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/fs.h>
#include <linux/proc_fs.h>
#include <linux/ctype.h>
#include <linux/delay.h>
......@@ -34,7 +29,6 @@
#include <linux/init.h>
#include <linux/smp_lock.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/bugs.h>
......
......@@ -45,18 +45,13 @@
#include <linux/kernel.h>
#ifdef CONFIG_BSD_PROCESS_ACCT
#include <linux/fs.h>
#include <linux/sched.h>
#include <linux/vfs.h>
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/stat.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/timer.h>
#include <linux/tty.h>
#include <linux/acct.h>
#include <linux/major.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/file.h>
......
......@@ -6,10 +6,8 @@
*/
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/capability.h>
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/string.h>
#include <asm/uaccess.h>
......
#include <linux/personality.h>
#include <linux/ptrace.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/module.h>
......
......@@ -7,16 +7,12 @@
#include <linux/config.h>
#include <linux/wait.h>
#include <linux/errno.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/resource.h>
#include <linux/mm.h>
#include <linux/tty.h>
#include <linux/malloc.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/module.h>
#include <linux/slab.h>
......
......@@ -14,17 +14,13 @@
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/unistd.h>
#include <linux/ptrace.h>
#include <linux/malloc.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/module.h>
#include <asm/system.h>
#include <asm/pgtable.h>
#include <asm/mmu_context.h>
#include <asm/uaccess.h>
......
......@@ -9,10 +9,8 @@
#include <linux/sched.h>
#include <linux/string.h>
#include <linux/unistd.h>
#include <linux/types.h>
#include <linux/mm.h>
#include <linux/swap.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <asm/uaccess.h>
......
......@@ -6,13 +6,10 @@
/* These are all the functions necessary to implement itimers */
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/time.h>
#include <linux/mm.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <asm/uaccess.h>
......
......@@ -12,10 +12,8 @@
#define __KERNEL_SYSCALLS__
#include <linux/sched.h>
#include <linux/types.h>
#include <linux/unistd.h>
#include <linux/smp_lock.h>
#include <linux/signal.h>
#include <asm/uaccess.h>
......
......@@ -11,32 +11,24 @@
#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/sched.h>
#include <linux/blkdev.h>
#include <linux/cdrom.h>
#include <linux/sched.h>
#include <linux/kernel_stat.h>
#include <linux/mm.h>
#include <linux/malloc.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/ptrace.h>
#include <linux/sys.h>
#include <linux/utsname.h>
#include <linux/interrupt.h>
#include <linux/ioport.h>
#include <linux/timer.h>
#include <linux/binfmts.h>
#include <linux/personality.h>
#include <linux/termios.h>
#include <linux/tqueue.h>
#include <linux/tty.h>
#include <linux/serial.h>
#include <linux/locks.h>
#include <linux/string.h>
#include <linux/delay.h>
#include <linux/sem.h>
#include <linux/minix_fs.h>
#include <linux/ext2_fs.h>
#include <linux/random.h>
......@@ -51,9 +43,6 @@
#include <linux/ctype.h>
#include <linux/file.h>
#include <linux/console.h>
#include <linux/time.h>
#include <asm/spinlock.h>
#if defined(CONFIG_PROC_FS)
#include <linux/proc_fs.h>
......@@ -62,9 +51,6 @@
#include <linux/kmod.h>
#endif
#include <asm/irq.h>
#ifdef __SMP__
#include <linux/smp.h>
#endif
extern char *get_options(char *str, int *ints);
extern void set_device_ro(kdev_t dev,int flag);
......
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/mm.h> /* defines GFP_KERNEL */
#include <linux/string.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/config.h>
#include <asm/uaccess.h>
#include <linux/vmalloc.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <asm/pgtable.h>
......
......@@ -10,10 +10,8 @@
*/
#include <stdarg.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/delay.h>
#include <linux/smp.h>
#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/sysrq.h>
......
......@@ -16,16 +16,12 @@
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/tty.h>
#include <linux/tty_driver.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/console.h>
#include <linux/init.h>
#include <asm/system.h>
#include <asm/uaccess.h>
#define LOG_BUF_LEN (16384)
......
......@@ -8,9 +8,7 @@
*/
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/ioport.h>
#include <linux/init.h>
......
......@@ -16,25 +16,18 @@
* current-task
*/
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/timer.h>
#include <linux/kernel.h>
#include <linux/kernel_stat.h>
#include <linux/fdreg.h>
#include <linux/errno.h>
#include <linux/time.h>
#include <linux/ptrace.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/tqueue.h>
#include <linux/resource.h>
#include <linux/mm.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/init.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
......
......@@ -8,14 +8,10 @@
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/signal.h>
#include <linux/errno.h>
#include <linux/wait.h>
#include <linux/ptrace.h>
#include <linux/unistd.h>
#include <linux/mm.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/slab.h>
#include <linux/init.h>
......@@ -333,10 +329,10 @@ printk("SIG queue (%s:%d): %d ", t->comm, t->pid, sig);
if (nr_queued_signals < max_queued_signals) {
q = (struct signal_queue *)
kmem_cache_alloc(signal_queue_cachep, GFP_KERNEL);
nr_queued_signals++;
}
if (q) {
nr_queued_signals++;
q->next = NULL;
*t->sigqueue_tail = q;
t->sigqueue_tail = &q->next;
......
......@@ -8,17 +8,13 @@
* bottom_half handler need not be re-entrant.
*/
#include <linux/ptrace.h>
#include <linux/errno.h>
#include <linux/kernel_stat.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/kernel_stat.h>
#include <linux/interrupt.h>
#include <linux/mm.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/bitops.h>
......
......@@ -6,20 +6,13 @@
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/times.h>
#include <linux/utsname.h>
#include <linux/param.h>
#include <linux/resource.h>
#include <linux/signal.h>
#include <linux/string.h>
#include <linux/ptrace.h>
#include <linux/stat.h>
#include <linux/mman.h>
#include <linux/mm.h>
#include <linux/fcntl.h>
#include <linux/tty.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
......
......@@ -22,10 +22,8 @@
#include <linux/ctype.h>
#include <linux/utsname.h>
#include <linux/swapctl.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <asm/bitops.h>
#include <asm/uaccess.h>
......
......@@ -20,12 +20,9 @@
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/param.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/timex.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <asm/uaccess.h>
......
......@@ -1567,7 +1567,8 @@ generic_file_write(struct file *file, const char *buf,
bytes = count;
hash = page_hash(inode, pgpos);
if (!(page = __find_page(inode, pgpos, *hash))) {
page = __find_page(inode, pgpos, *hash);
if (!page) {
if (!page_cache) {
page_cache = __get_free_page(GFP_USER);
if (page_cache)
......@@ -1580,21 +1581,25 @@ generic_file_write(struct file *file, const char *buf,
page_cache = 0;
}
/* Get exclusive IO access to the page.. */
wait_on_page(page);
set_bit(PG_locked, &page->flags);
/*
* Do the real work.. If the writer ends up delaying the write,
* the writer needs to increment the page use counts until he
* is done with the page.
*/
bytes -= copy_from_user((u8*)page_address(page) + offset, buf, bytes);
if (!bytes) {
status = -EFAULT;
clear_bit(PG_locked, &page->flags);
wake_up(&page->wait);
__free_page(page);
break;
}
status = inode->i_op->updatepage(file, page, offset, bytes, sync);
status = -EFAULT;
if (bytes)
status = inode->i_op->updatepage(file, page, offset, bytes, sync);
/* Mark it unlocked again and drop the page.. */
clear_bit(PG_locked, &page->flags);
wake_up(&page->wait);
__free_page(page);
if (status < 0)
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment