Commit 932f485f authored by Linus Torvalds's avatar Linus Torvalds
Browse files

v2.4.9.7 -> v2.4.9.8

  - Christoph Hellwig: clean up personality handling a bit
  - Robert Love: update sysctl/vm documentation
  - make the three-argument (that everybody hates) "min()" be "min_t()",
  and introduce a type-anal "min()" that complains about arguments of
  different types.
parent 7df13152
......@@ -33,32 +33,29 @@ bdflush:
This file controls the operation of the bdflush kernel
daemon. The source code to this struct can be found in
linux/fs/buffer.c. It currently contains 9 integer values,
of which 6 are actually used by the kernel.
of which 4 are actually used by the kernel.
From linux/fs/buffer.c:
--------------------------------------------------------------
union bdflush_param{
struct {
int nfract; /* Percentage of buffer cache dirty to
activate bdflush */
int ndirty; /* Maximum number of dirty blocks to
write out per wake-cycle */
int nrefill; /* Number of clean buffers to try to
obtain each time we call refill */
int nref_dirt; /* Dirty buffer threshold for activating
bdflush when trying to refill buffers. */
int dummy1; /* unused */
int age_buffer; /* Time for normal buffer to age before
we flush it */
int age_super; /* Time for superblock to age before we
flush it */
int dummy2; /* unused */
int dummy3; /* unused */
} b_un;
unsigned int data[N_PARAM];
} bdf_prm = {{40, 500, 64, 256, 15, 30*HZ, 5*HZ, 1884, 2}};
union bdflush_param {
struct {
int nfract; /* Percentage of buffer cache dirty to
activate bdflush */
int dummy1; /* old "ndirty" */
int dummy2; /* old "nrefill" */
int dummy3; /* unused */
int interval; /* jiffies delay between kupdate flushes */
int age_buffer; /* Time for normal buffer to age */
int nfract_sync;/* Percentage of buffer cache dirty to
activate bdflush synchronously */
int dummy4; /* unused */
int dummy5; /* unused */
} b_un;
unsigned int data[N_PARAM];
} bdf_prm = {{30, 64, 64, 256, 5*HZ, 30*HZ, 60, 0, 0}};
--------------------------------------------------------------
int nfract:
The first parameter governs the maximum number of dirty
buffers in the buffer cache. Dirty means that the contents
of the buffer still have to be written to disk (as opposed
......@@ -66,32 +63,31 @@ to a clean buffer, which can just be forgotten about).
Setting this to a high value means that Linux can delay disk
writes for a long time, but it also means that it will have
to do a lot of I/O at once when memory becomes short. A low
value will spread out disk I/O more evenly.
The second parameter (ndirty) gives the maximum number of
dirty buffers that bdflush can write to the disk in one time.
A high value will mean delayed, bursty I/O, while a small
value can lead to memory shortage when bdflush isn't woken
up often enough...
The third parameter (nrefill) is the number of buffers that
bdflush will add to the list of free buffers when
refill_freelist() is called. It is necessary to allocate free
buffers beforehand, since the buffers often are of a different
size than memory pages and some bookkeeping needs to be done
beforehand. The higher the number, the more memory will be
wasted and the less often refill_freelist() will need to run.
When refill_freelist() comes across more than nref_dirt dirty
buffers, it will wake up bdflush.
Finally, the age_buffer and age_super parameters govern the
maximum time Linux waits before writing out a dirty buffer
to disk. The value is expressed in jiffies (clockticks), the
number of jiffies per second is 100, except on Alpha machines
(1024). Age_buffer is the maximum age for data blocks, while
age_super is for filesystem metadata.
value will spread out disk I/O more evenly, at the cost of
more frequent I/O operations. The default value is 30%,
the minimum is 0%, and the maximum is 100%.
int interval:
The fifth parameter, interval, is the minimum rate at
which kupdate will wake and flush. The value is expressed in
jiffies (clockticks), the number of jiffies per second is
normally 100 (Alpha is 1024). Thus, x*HZ is x seconds. The
default value is 5 seconds, the minimum is 0 seconds, and the
maximum is 600 seconds.
int age_buffer:
The sixth parameter, age_buffer, governs the maximum time
Linux waits before writing out a dirty buffer to disk. The
value is in jiffies. The default value is 30 seconds,
the minimum is 1 second, and the maximum 6,000 seconds.
int nfract_sync:
The seventh parameter, nfract_sync, governs the percentage
of buffer cache that is dirty before bdflush activates
synchronously. This can be viewed as the hard limit before
bdflush forces buffers to disk. The default is 60%, the
minimum is 0%, and the maximum is 100%.
==============================================================
buffermem:
......
VERSION = 2
PATCHLEVEL = 4
SUBLEVEL = 10
EXTRAVERSION =-pre7
EXTRAVERSION =-pre8
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
......
......@@ -65,7 +65,7 @@ static void arthur_lcall7(int nr, struct pt_regs *regs)
static struct exec_domain arthur_exec_domain = {
"Arthur", /* name */
(lcall7_func)arthur_lcall7,
arthur_lcall7,
PER_RISCOS, PER_RISCOS,
arthur_to_linux_signals,
linux_to_arthur_signals,
......
......@@ -19,6 +19,7 @@
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/spinlock.h>
#include <linux/personality.h>
#include <linux/ptrace.h>
#include <linux/elf.h>
#include <linux/init.h>
......
......@@ -2258,11 +2258,11 @@ static int etrax_rh_submit_urb(urb_t *urb)
case RH_GET_DESCRIPTOR:
switch ((wValue & 0xff00) >> 8) {
case (0x01): /* device descriptor */
len = min(unsigned int, leni, min(unsigned int, sizeof (root_hub_dev_des), wLength));
len = min_t(unsigned int, leni, min_t(unsigned int, sizeof (root_hub_dev_des), wLength));
memcpy (data, root_hub_dev_des, len);
OK (len);
case (0x02): /* configuration descriptor */
len = min(unsigned int, leni, min(unsigned int, sizeof (root_hub_config_des), wLength));
len = min_t(unsigned int, leni, min_t(unsigned int, sizeof (root_hub_config_des), wLength));
memcpy (data, root_hub_config_des, len);
OK (len);
case (0x03): /* string descriptors */
......@@ -2270,7 +2270,7 @@ static int etrax_rh_submit_urb(urb_t *urb)
0xff, "ETRAX 100LX",
data, wLength);
if (len > 0) {
OK(min(int, leni, len));
OK(min_t(int, leni, len));
} else
stat = -EPIPE;
}
......@@ -2278,7 +2278,7 @@ static int etrax_rh_submit_urb(urb_t *urb)
case RH_GET_DESCRIPTOR | RH_CLASS:
root_hub_hub_des[2] = hc->rh.numports;
len = min(unsigned int, leni, min(unsigned int, sizeof (root_hub_hub_des), wLength));
len = min_t(unsigned int, leni, min_t(unsigned int, sizeof (root_hub_hub_des), wLength));
memcpy (data, root_hub_hub_des, len);
OK (len);
......
......@@ -72,7 +72,7 @@ EXPORT_SYMBOL(get_cmos_time);
EXPORT_SYMBOL(apm_info);
EXPORT_SYMBOL(gdt);
#ifdef CONFIG_IO_DEBUG
#ifdef CONFIG_DEBUG_IOVIRT
EXPORT_SYMBOL(__io_virt_debug);
#endif
......
......@@ -19,6 +19,7 @@
#include <linux/unistd.h>
#include <linux/stddef.h>
#include <linux/tty.h>
#include <linux/personality.h>
#include <asm/ucontext.h>
#include <asm/uaccess.h>
#include <asm/i387.h>
......
......@@ -13,5 +13,6 @@ obj-y = checksum.o old-checksum.o delay.o \
obj-$(CONFIG_X86_USE_3DNOW) += mmx.o
obj-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o
obj-$(CONFIG_DEBUG_IOVIRT) += iodebug.o
include $(TOPDIR)/Rules.make
......@@ -709,7 +709,7 @@ extern long solaris_to_linux_signals[], linux_to_solaris_signals[];
struct exec_domain solaris_exec_domain = {
"Solaris",
(lcall7_func)NULL,
NULL,
1, 1, /* PER_SVR4 personality */
solaris_to_linux_signals,
linux_to_solaris_signals,
......
......@@ -699,7 +699,7 @@ int timod_getmsg(unsigned int fd, char *ctl_buf, int ctl_maxlen, s32 *ctl_len,
}
if (ctl_maxlen >= 0 && sock->pfirst) {
struct T_primsg *it = sock->pfirst;
int l = min(int, ctl_maxlen, it->length);
int l = min_t(int, ctl_maxlen, it->length);
SCHECK_MAGIC((char*)((u64)(((char *)&it->type)+sock->offset+it->length+7)&~7),MKCTL_MAGIC);
SOLD("purting ctl data");
if(copy_to_user(ctl_buf,
......
......@@ -1210,6 +1210,8 @@ static int mfm_ioctl(struct inode *inode, struct file *file, u_int cmd, u_long a
case BLKGETSIZE:
return put_user (mfm[minor].nr_sects, (long *)arg);
case BLKGETSIZE64:
return put_user ((u64)mfm[minor].nr_sects << 9, (u64 *)arg);
case BLKFRASET:
if (!capable(CAP_SYS_ADMIN))
......
......@@ -1059,7 +1059,7 @@ void acornscsi_dma_setup(AS_Host *host, dmadir_t direction)
/*
* Allocate some buffer space, limited to half the buffer size
*/
length = min(unsigned int, host->scsi.SCp.this_residual, DMAC_BUFFER_SIZE / 2);
length = min_t(unsigned int, host->scsi.SCp.this_residual, DMAC_BUFFER_SIZE / 2);
if (length) {
host->dma.start_addr = address = host->dma.free_addr;
host->dma.free_addr = (host->dma.free_addr + length) &
......@@ -1187,7 +1187,7 @@ void acornscsi_dma_intr(AS_Host *host)
/*
* Allocate some buffer space, limited to half the on-board RAM size
*/
length = min(unsigned int, host->scsi.SCp.this_residual, DMAC_BUFFER_SIZE / 2);
length = min_t(unsigned int, host->scsi.SCp.this_residual, DMAC_BUFFER_SIZE / 2);
if (length) {
host->dma.start_addr = address = host->dma.free_addr;
host->dma.free_addr = (host->dma.free_addr + length) &
......@@ -1656,8 +1656,8 @@ void acornscsi_message(AS_Host *host)
* to be in operation AFTER the target leaves message out phase.
*/
acornscsi_sbic_issuecmd(host, CMND_ASSERTATN);
period = max(unsigned int, message[3], sdtr_period / 4);
length = min(unsigned int, message[4], sdtr_size);
period = max_t(unsigned int, message[3], sdtr_period / 4);
length = min_t(unsigned int, message[4], sdtr_size);
msgqueue_addmsg(&host->scsi.msgs, 5, EXTENDED_MESSAGE, 3,
EXTENDED_SDTR, period, length);
host->device[host->SCpnt->target].sync_xfer =
......
......@@ -5074,10 +5074,12 @@ static int DAC960_IOCTL(Inode_T *Inode, File_T *File,
sizeof(DiskGeometry_T)) ? -EFAULT : 0);
case BLKGETSIZE:
/* Get Device Size. */
if ((long *) Argument == NULL) return -EINVAL;
return put_user(Controller->GenericDiskInfo.part[MINOR(Inode->i_rdev)]
.nr_sects,
(long *) Argument);
case BLKGETSIZE64:
return put_user((u64)Controller->GenericDiskInfo.part[MINOR(Inode->i_rdev)].nr_sects << 9,
(u64 *) Argument);
case BLKRAGET:
case BLKRASET:
case BLKFLSBUF:
......
......@@ -1138,6 +1138,10 @@ static int acsi_ioctl( struct inode *inode, struct file *file,
return put_user(acsi_part[MINOR(inode->i_rdev)].nr_sects,
(long *) arg);
case BLKGETSIZE64: /* Return device size */
return put_user((u64)acsi_part[MINOR(inode->i_rdev)].nr_sects << 9,
(u64 *) arg);
case BLKROSET:
case BLKROGET:
case BLKFLSBUF:
......
......@@ -1556,6 +1556,9 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
case BLKGETSIZE:
return put_user(unit[drive].blocks,(long *)param);
break;
case BLKGETSIZE64:
return put_user((u64)unit[drive].blocks << 9, (u64 *)param);
break;
case FDSETPRM:
case FDDEFPRM:
return -EINVAL;
......
......@@ -239,6 +239,7 @@ int blk_ioctl(kdev_t dev, unsigned int cmd, unsigned long arg)
case BLKGETSIZE:
/* Today get_gendisk() requires a linear scan;
add this when dev has pointer type. */
/* add BLKGETSIZE64 too */
g = get_gendisk(dev);
if (!g)
longval = 0;
......
......@@ -400,9 +400,11 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
put_user(hba[ctlr]->hd[MINOR(inode->i_rdev)].start_sect, &geo->start);
return 0;
case BLKGETSIZE:
if (!arg) return -EINVAL;
put_user(hba[ctlr]->hd[MINOR(inode->i_rdev)].nr_sects, (long*)arg);
return 0;
case BLKGETSIZE64:
put_user((u64)hba[ctlr]->hd[MINOR(inode->i_rdev)].nr_sects << 9, (u64*)arg);
return 0;
case BLKRRPART:
return revalidate_logvol(inode->i_rdev, 1);
case BLKFLSBUF:
......
......@@ -1216,9 +1216,9 @@ static int ida_ioctl(struct inode *inode, struct file *filep, unsigned int cmd,
case IDAGETDRVINFO:
return copy_to_user(&io->c.drv,&hba[ctlr]->drv[dsk],sizeof(drv_info_t));
case BLKGETSIZE:
if (!arg) return -EINVAL;
put_user(ida[(ctlr<<CTLR_SHIFT)+MINOR(inode->i_rdev)].nr_sects, (long*)arg);
return 0;
return put_user(ida[(ctlr<<CTLR_SHIFT)+MINOR(inode->i_rdev)].nr_sects, (long*)arg);
case BLKGETSIZE64:
return put_user((u64)(ida[(ctlr<<CTLR_SHIFT)+MINOR(inode->i_rdev)].nr_sects) << 9, (u64*)arg);
case BLKRRPART:
return revalidate_logvol(inode->i_rdev, 1);
case IDAPASSTHRU:
......
......@@ -3497,6 +3497,10 @@ static int fd_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
case BLKGETSIZE:
ECALL(get_floppy_geometry(drive, type, &g));
return put_user(g->size, (long *) param);
case BLKGETSIZE64:
ECALL(get_floppy_geometry(drive, type, &g));
return put_user((u64)g->size << 9, (u64 *) param);
/* BLKRRPART is not defined as floppies don't have
* partition tables */
}
......
......@@ -849,11 +849,14 @@ static int lo_ioctl(struct inode * inode, struct file * file,
err = -ENXIO;
break;
}
if (!arg) {
err = -EINVAL;
err = put_user(loop_sizes[lo->lo_number] << 1, (long *) arg);
break;
case BLKGETSIZE64:
if (lo->lo_state != Lo_bound) {
err = -ENXIO;
break;
}
err = put_user(loop_sizes[lo->lo_number] << 1, (long *) arg);
err = put_user((u64)loop_sizes[lo->lo_number] << 10, (u64*)arg);
break;
case BLKBSZGET:
case BLKBSZSET:
......
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