summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-05-12 23:48:34 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-05-12 23:48:34 +0000
commit7fd36ebeeec9244a7431bb010e6e3c5e4848a0d5 (patch)
tree5fb03a9aafdd1cec5f4f6ff7f1873174cb89b66c /fs
parentba2dacab305c598cd4c34a604f8e276bf5bab5ff (diff)
Merge with Linux 2.3.99-pre8. Linus must hate me, too man patches ;-)
Diffstat (limited to 'fs')
-rw-r--r--fs/binfmt_misc.c4
-rw-r--r--fs/buffer.c20
-rw-r--r--fs/dquot.c4
-rw-r--r--fs/file_table.c4
-rw-r--r--fs/filesystems.c2
-rw-r--r--fs/nfs/write.c2
-rw-r--r--fs/noquot.c4
-rw-r--r--fs/proc/proc_misc.c99
-rw-r--r--fs/super.c4
9 files changed, 60 insertions, 83 deletions
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
index a03c4723f..0d44c3d4e 100644
--- a/fs/binfmt_misc.c
+++ b/fs/binfmt_misc.c
@@ -68,9 +68,9 @@ static struct linux_binfmt misc_format = {
NULL, THIS_MODULE, load_misc_binary, NULL, NULL, 0
};
-static struct proc_dir_entry *bm_dir = NULL;
+static struct proc_dir_entry *bm_dir;
-static struct binfmt_entry *entries = NULL;
+static struct binfmt_entry *entries;
static int free_id = 1;
static int enabled = 1;
diff --git a/fs/buffer.c b/fs/buffer.c
index 65c3fb627..a7a6f79a8 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -71,18 +71,18 @@ static char buffersize_index[65] =
/*
* Hash table gook..
*/
-static unsigned int bh_hash_mask = 0;
-static unsigned int bh_hash_shift = 0;
+static unsigned int bh_hash_mask;
+static unsigned int bh_hash_shift;
static struct buffer_head **hash_table;
static rwlock_t hash_table_lock = RW_LOCK_UNLOCKED;
static struct buffer_head *lru_list[NR_LIST];
static spinlock_t lru_list_lock = SPIN_LOCK_UNLOCKED;
-static int nr_buffers_type[NR_LIST] = {0,};
-static unsigned long size_buffers_type[NR_LIST] = {0,};
+static int nr_buffers_type[NR_LIST];
+static unsigned long size_buffers_type[NR_LIST];
-static struct buffer_head * unused_list = NULL;
-static int nr_unused_buffer_heads = 0;
+static struct buffer_head * unused_list;
+static int nr_unused_buffer_heads;
static spinlock_t unused_list_lock = SPIN_LOCK_UNLOCKED;
static DECLARE_WAIT_QUEUE_HEAD(buffer_wait);
@@ -1264,7 +1264,7 @@ static int create_page_buffers(int rw, struct page *page, kdev_t dev, int b[], i
set_bit(BH_Mapped, &bh->b_state);
}
tail->b_this_page = head;
- get_page(page);
+ page_cache_get(page);
page->buffers = head;
return 0;
}
@@ -1351,7 +1351,7 @@ static void create_empty_buffers(struct page *page, struct inode *inode, unsigne
} while (bh);
tail->b_this_page = head;
page->buffers = head;
- get_page(page);
+ page_cache_get(page);
}
static void unmap_underlying_metadata(struct buffer_head * bh)
@@ -2106,7 +2106,7 @@ static int grow_buffers(int size)
return 1;
no_buffer_head:
- __free_page(page);
+ page_cache_release(page);
out:
return 0;
}
@@ -2190,7 +2190,7 @@ int try_to_free_buffers(struct page * page)
/* And free the page */
page->buffers = NULL;
- __free_page(page);
+ page_cache_release(page);
spin_unlock(&free_list[index].lock);
write_unlock(&hash_table_lock);
spin_unlock(&lru_list_lock);
diff --git a/fs/dquot.c b/fs/dquot.c
index b72ac05ff..56824a73a 100644
--- a/fs/dquot.c
+++ b/fs/dquot.c
@@ -58,7 +58,7 @@
#define __DQUOT_VERSION__ "dquot_6.4.0"
-int nr_dquots = 0, nr_free_dquots = 0;
+int nr_dquots, nr_free_dquots;
int max_dquots = NR_DQUOTS;
static char quotamessage[MAX_QUOTA_MESSAGE];
@@ -91,7 +91,7 @@ static inline struct quota_mount_options *sb_dqopt(struct super_block *sb)
* mechanism to lcoate a specific dquot.
*/
-static struct dquot *inuse_list = NULL;
+static struct dquot *inuse_list;
static LIST_HEAD(free_dquots);
static struct dquot *dquot_hash[NR_DQHASH];
static int dquot_updating[NR_DQHASH];
diff --git a/fs/file_table.c b/fs/file_table.c
index 6fb59de4c..7d5bd9e01 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -15,8 +15,8 @@
static kmem_cache_t *filp_cache;
/* sysctl tunables... */
-int nr_files = 0; /* read only */
-int nr_free_files = 0; /* read only */
+int nr_files; /* read only */
+int nr_free_files; /* read only */
int max_files = NR_FILE;/* tunable */
/* Here the new files go */
diff --git a/fs/filesystems.c b/fs/filesystems.c
index 6ad3ec407..22f6aa6db 100644
--- a/fs/filesystems.c
+++ b/fs/filesystems.c
@@ -50,7 +50,7 @@ void __init filesystem_setup(void)
#ifndef CONFIG_NFSD
#ifdef CONFIG_NFSD_MODULE
-int (*do_nfsservctl)(int, void *, void *) = NULL;
+int (*do_nfsservctl)(int, void *, void *);
#endif
int
asmlinkage sys_nfsservctl(int cmd, void *argp, void *resp)
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index bddf36907..52af85acb 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -528,7 +528,7 @@ struct nfs_page *nfs_create_request(struct dentry *dentry, struct page *page,
* long write-back delay. This will be adjusted in
* update_nfs_request below if the region is not locked. */
req->wb_page = page;
- get_page(page);
+ page_cache_get(page);
req->wb_offset = offset;
req->wb_bytes = count;
req->wb_dentry = dget(dentry);
diff --git a/fs/noquot.c b/fs/noquot.c
index bc8755ed6..231aab495 100644
--- a/fs/noquot.c
+++ b/fs/noquot.c
@@ -6,8 +6,8 @@
#include <linux/types.h>
#include <linux/errno.h>
-int nr_dquots = 0, nr_free_dquots = 0;
-int max_dquots = 0;
+int nr_dquots, nr_free_dquots;
+int max_dquots;
asmlinkage long sys_quotactl(int cmd, const char *special, int id, caddr_t addr)
{
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index c1f126039..9afe2d67c 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -287,84 +287,60 @@ static int kstat_read_proc(char *page, char **start, off_t off,
int i, len;
extern unsigned long total_forks;
unsigned long jif = HZ_TO_STD(jiffies);
-#if !defined(CONFIG_ARCH_S390)
unsigned sum = 0;
+ int major, disk;
for (i = 0 ; i < NR_IRQS ; i++)
sum += kstat_irqs(i);
-#endif
-#ifdef CONFIG_SMP
len = sprintf(page,
"cpu %u %u %u %lu\n",
- kstat.cpu_user,
- kstat.cpu_nice,
- kstat.cpu_system,
- jif*smp_num_cpus - (kstat.cpu_user + kstat.cpu_nice + kstat.cpu_system));
+ HZ_TO_STD(kstat.cpu_user),
+ HZ_TO_STD(kstat.cpu_nice),
+ HZ_TO_STD(kstat.cpu_system),
+ jif*smp_num_cpus - HZ_TO_STD(kstat.cpu_user + kstat.cpu_nice + kstat.cpu_system));
for (i = 0 ; i < smp_num_cpus; i++)
len += sprintf(page + len, "cpu%d %u %u %u %lu\n",
i,
- kstat.per_cpu_user[cpu_logical_map(i)],
- kstat.per_cpu_nice[cpu_logical_map(i)],
- kstat.per_cpu_system[cpu_logical_map(i)],
- jif - ( kstat.per_cpu_user[cpu_logical_map(i)] \
+ HZ_TO_STD(kstat.per_cpu_user[cpu_logical_map(i)]),
+ HZ_TO_STD(kstat.per_cpu_nice[cpu_logical_map(i)]),
+ HZ_TO_STD(kstat.per_cpu_system[cpu_logical_map(i)]),
+ jif - HZ_TO_STD( kstat.per_cpu_user[cpu_logical_map(i)] \
+ kstat.per_cpu_nice[cpu_logical_map(i)] \
+ kstat.per_cpu_system[cpu_logical_map(i)]));
len += sprintf(page + len,
- "disk %u %u %u %u\n"
- "disk_rio %u %u %u %u\n"
- "disk_wio %u %u %u %u\n"
- "disk_rblk %u %u %u %u\n"
- "disk_wblk %u %u %u %u\n"
"page %u %u\n"
-#if !defined(CONFIG_ARCH_S390)
- "swap %u %u\n"
- "intr %u",
-#else
- "swap %u %u\n",
-#endif
-#else
- len = sprintf(page,
- "cpu %u %u %u %lu\n"
- "disk %u %u %u %u\n"
- "disk_rio %u %u %u %u\n"
- "disk_wio %u %u %u %u\n"
- "disk_rblk %u %u %u %u\n"
- "disk_wblk %u %u %u %u\n"
- "page %u %u\n"
-#if !defined(CONFIG_ARCH_S390)
"swap %u %u\n"
"intr %u",
-#else
- "swap %u %u\n"
-#endif
- HZ_TO_STD(kstat.cpu_user),
- HZ_TO_STD(kstat.cpu_nice),
- HZ_TO_STD(kstat.cpu_system),
- jif*smp_num_cpus - HZ_TO_STD(kstat.cpu_user + kstat.cpu_nice + kstat.cpu_system),
+ kstat.pgpgin,
+ kstat.pgpgout,
+ kstat.pswpin,
+ kstat.pswpout,
+ sum
+ );
+ for (i = 0 ; i < NR_IRQS ; i++)
+ len += sprintf(page + len, " %u", kstat_irqs(i));
+
+ len += sprintf(page + len, "\ndisk_io: ");
+
+ for (major = 0; major < DK_MAX_MAJOR; major++) {
+ for (disk = 0; disk < DK_MAX_DISK; disk++) {
+ int active = kstat.dk_drive_rio[major][disk] +
+ kstat.dk_drive_rblk[major][disk] +
+ kstat.dk_drive_wio[major][disk] +
+ kstat.dk_drive_wblk[major][disk];
+ if (active)
+ len += sprintf(page + len,
+ "(%u,%u):(%u,%u,%u,%u) ",
+ major, disk,
+ kstat.dk_drive_rio[major][disk],
+ kstat.dk_drive_rblk[major][disk],
+ kstat.dk_drive_wio[major][disk],
+ kstat.dk_drive_wblk[major][disk]
+ );
+ }
+ }
-#endif
- kstat.dk_drive[0], kstat.dk_drive[1],
- kstat.dk_drive[2], kstat.dk_drive[3],
- kstat.dk_drive_rio[0], kstat.dk_drive_rio[1],
- kstat.dk_drive_rio[2], kstat.dk_drive_rio[3],
- kstat.dk_drive_wio[0], kstat.dk_drive_wio[1],
- kstat.dk_drive_wio[2], kstat.dk_drive_wio[3],
- kstat.dk_drive_rblk[0], kstat.dk_drive_rblk[1],
- kstat.dk_drive_rblk[2], kstat.dk_drive_rblk[3],
- kstat.dk_drive_wblk[0], kstat.dk_drive_wblk[1],
- kstat.dk_drive_wblk[2], kstat.dk_drive_wblk[3],
- kstat.pgpgin,
- kstat.pgpgout,
- kstat.pswpin,
-#if !defined(CONFIG_ARCH_S390)
- kstat.pswpout,
- sum);
- for (i = 0 ; i < NR_IRQS ; i++)
- len += sprintf(page + len, " %u", kstat_irqs(i));
-#else
- kstat.pswpout);
-#endif
len += sprintf(page + len,
"\nctxt %u\n"
"btime %lu\n"
@@ -372,6 +348,7 @@ static int kstat_read_proc(char *page, char **start, off_t off,
kstat.context_swtch,
xtime.tv_sec - jif / HZ,
total_forks);
+
if (len <= off+count) *eof = 1;
*start = page + off;
len -= off;
diff --git a/fs/super.c b/fs/super.c
index 1bf7e1067..b32b1fc6c 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -59,7 +59,7 @@ static int do_remount_sb(struct super_block *sb, int flags, char * data);
/* this is initialized in init/main.c */
kdev_t ROOT_DEV;
-int nr_super_blocks = 0;
+int nr_super_blocks;
int max_super_blocks = NR_SUPER;
LIST_HEAD(super_blocks);
@@ -684,7 +684,7 @@ out_fail:
* filesystems which don't use real block-devices. -- jrs
*/
-static unsigned int unnamed_dev_in_use[256/(8*sizeof(unsigned int))] = { 0, };
+static unsigned int unnamed_dev_in_use[256/(8*sizeof(unsigned int))];
kdev_t get_unnamed_dev(void)
{