patch-2.3.30 linux/include/linux/swap.h
Next file: linux/include/linux/sysctl.h
Previous file: linux/include/linux/slab.h
Back to the patch index
Back to the overall index
- Lines: 64
- Date:
Mon Dec 6 17:22:07 1999
- Orig file:
v2.3.29/linux/include/linux/swap.h
- Orig date:
Thu Nov 11 20:11:53 1999
diff -u --recursive --new-file v2.3.29/linux/include/linux/swap.h linux/include/linux/swap.h
@@ -1,6 +1,7 @@
#ifndef _LINUX_SWAP_H
#define _LINUX_SWAP_H
+#include <linux/spinlock.h>
#include <asm/page.h>
#define SWAP_FLAG_PREFER 0x8000 /* set if swap priority specified */
@@ -48,6 +49,7 @@
struct swap_info_struct {
unsigned int flags;
kdev_t swap_device;
+ spinlock_t sdev_lock;
struct dentry * swap_file;
unsigned short * swap_map;
unsigned int lowest_bit;
@@ -94,19 +96,17 @@
/* linux/mm/swap_state.c */
extern void show_swap_cache_info(void);
extern void add_to_swap_cache(struct page *, swp_entry_t);
-extern int swap_duplicate(swp_entry_t);
extern int swap_check_entry(unsigned long);
extern struct page * lookup_swap_cache(swp_entry_t);
extern struct page * read_swap_cache_async(swp_entry_t, int);
#define read_swap_cache(entry) read_swap_cache_async(entry, 1);
-extern int swap_count(struct page *);
-extern swp_entry_t acquire_swap_entry(struct page *page);
/*
* Make these inline later once they are working properly.
*/
extern void __delete_from_swap_cache(struct page *page);
extern void delete_from_swap_cache(struct page *page);
+extern void delete_from_swap_cache_nolock(struct page *page);
extern void free_page_and_swap_cache(struct page *page);
/* linux/mm/swapfile.c */
@@ -115,6 +115,12 @@
extern int is_swap_partition(kdev_t);
extern void si_swapinfo(struct sysinfo *);
extern swp_entry_t __get_swap_page(unsigned short);
+extern void get_swaphandle_info(swp_entry_t, unsigned long *, kdev_t *,
+ struct inode **);
+extern int swap_duplicate(swp_entry_t);
+extern int swap_count(struct page *);
+extern swp_entry_t acquire_swap_entry(struct page *page);
+extern int valid_swaphandles(swp_entry_t, unsigned long *);
#define get_swap_page() __get_swap_page(1)
extern void __swap_free(swp_entry_t, unsigned short);
#define swap_free(entry) __swap_free((entry), 1)
@@ -172,6 +178,13 @@
nr_lru_pages--; \
spin_unlock(&pagemap_lru_lock); \
} while (0)
+
+extern spinlock_t swaplock;
+
+#define swap_list_lock() spin_lock(&swaplock)
+#define swap_list_unlock() spin_unlock(&swaplock)
+#define swap_device_lock(p) spin_lock(&p->sdev_lock)
+#define swap_device_unlock(p) spin_unlock(&p->sdev_lock)
#endif /* __KERNEL__*/
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)