b99eaa7973f0eb1ac63a58b5190950f9cc9e33f9
[davej-history.git] / include / linux / fs.h
blobb99eaa7973f0eb1ac63a58b5190950f9cc9e33f9
1 #ifndef _LINUX_FS_H
2 #define _LINUX_FS_H
4 /*
5 * This file has definitions for some important file table
6 * structures etc.
7 */
9 #include <linux/config.h>
10 #include <linux/linkage.h>
11 #include <linux/limits.h>
12 #include <linux/wait.h>
13 #include <linux/types.h>
14 #include <linux/vfs.h>
15 #include <linux/net.h>
16 #include <linux/kdev_t.h>
17 #include <linux/ioctl.h>
20 * It's silly to have NR_OPEN bigger than NR_FILE, but I'll fix
21 * that later. Anyway, now the file code is no longer dependent
22 * on bitmaps in unsigned longs, but uses the new fd_set structure..
24 * Some programs (notably those using select()) may have to be
25 * recompiled to take full advantage of the new limits..
28 /* Fixed constants first: */
29 #undef NR_OPEN
30 #define NR_OPEN 256
32 #define NR_SUPER 64
33 #define BLOCK_SIZE 1024
34 #define BLOCK_SIZE_BITS 10
36 /* And dynamically-tunable limits and defaults: */
37 externint max_inodes, nr_inodes;
38 externint max_files, nr_files;
39 #define NR_INODE 3072/* this should be bigger than NR_FILE */
40 #define NR_FILE 1024/* this can well be larger on a larger system */
42 #define MAY_EXEC 1
43 #define MAY_WRITE 2
44 #define MAY_READ 4
46 #define FMODE_READ 1
47 #define FMODE_WRITE 2
49 #define READ 0
50 #define WRITE 1
51 #define READA 2/* read-ahead - don't block if no resources */
52 #define WRITEA 3/* write-ahead - don't block if no resources */
54 #ifndef NULL
55 #define NULL ((void *) 0)
56 #endif
58 #define NIL_FILP ((struct file *)0)
59 #define SEL_IN 1
60 #define SEL_OUT 2
61 #define SEL_EX 4
64 * These are the fs-independent mount-flags: up to 16 flags are supported
66 #define MS_RDONLY 1/* Mount read-only */
67 #define MS_NOSUID 2/* Ignore suid and sgid bits */
68 #define MS_NODEV 4/* Disallow access to device special files */
69 #define MS_NOEXEC 8/* Disallow program execution */
70 #define MS_SYNCHRONOUS 16/* Writes are synced at once */
71 #define MS_REMOUNT 32/* Alter flags of a mounted FS */
72 #define MS_MANDLOCK 64/* Allow mandatory locks on an FS */
73 #define S_WRITE 128/* Write on file/directory/symlink */
74 #define S_APPEND 256/* Append-only file */
75 #define S_IMMUTABLE 512/* Immutable file */
78 * Flags that can be altered by MS_REMOUNT
80 #define MS_RMT_MASK (MS_RDONLY|MS_MANDLOCK)
83 * Magic mount flag number. Has to be or-ed to the flag values.
85 #define MS_MGC_VAL 0xC0ED0000/* magic flag number to indicate "new" flags */
86 #define MS_MGC_MSK 0xffff0000/* magic flag number mask */
89 * Note that read-only etc flags are inode-specific: setting some file-system
90 * flags just means all the inodes inherit those flags by default. It might be
91 * possible to override it selectively if you really wanted to with some
92 * ioctl() that is not currently implemented.
94 * Exception: MS_RDONLY is always applied to the entire file system.
96 #define IS_RDONLY(inode) (((inode)->i_sb) && ((inode)->i_sb->s_flags & MS_RDONLY))
97 #define IS_NOSUID(inode) ((inode)->i_flags & MS_NOSUID)
98 #define IS_NODEV(inode) ((inode)->i_flags & MS_NODEV)
99 #define IS_NOEXEC(inode) ((inode)->i_flags & MS_NOEXEC)
100 #define IS_SYNC(inode) ((inode)->i_flags & MS_SYNCHRONOUS)
101 #define IS_MANDLOCK(inode) ((inode)->i_flags & MS_MANDLOCK)
103 #define IS_WRITABLE(inode) ((inode)->i_flags & S_WRITE)
104 #define IS_APPEND(inode) ((inode)->i_flags & S_APPEND)
105 #define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE)
107 /* the read-only stuff doesn't really belong here, but any other place is
108 probably as bad and I don't want to create yet another include file. */
110 #define BLKROSET _IO(0x12,93)/* set device read-only (0 = read-write) */
111 #define BLKROGET _IO(0x12,94)/* get read-only status (0 = read_write) */
112 #define BLKRRPART _IO(0x12,95)/* re-read partition table */
113 #define BLKGETSIZE _IO(0x12,96)/* return device size */
114 #define BLKFLSBUF _IO(0x12,97)/* flush buffer cache */
115 #define BLKRASET _IO(0x12,98)/* Set read ahead for block device */
116 #define BLKRAGET _IO(0x12,99)/* get current read ahead setting */
118 #define BMAP_IOCTL 1/* obsolete - kept for compatibility */
119 #define FIBMAP _IO(0x00,1)/* bmap access */
120 #define FIGETBSZ _IO(0x00,2)/* get the block size used for bmap */
122 #ifdef __KERNEL__
124 #include <asm/semaphore.h>
125 #include <asm/bitops.h>
127 externvoidbuffer_init(void);
128 externunsigned longinode_init(unsigned long start,unsigned long end);
129 externunsigned longfile_table_init(unsigned long start,unsigned long end);
130 externunsigned longname_cache_init(unsigned long start,unsigned long end);
132 typedefchar buffer_block[BLOCK_SIZE];
134 /* bh state bits */
135 #define BH_Uptodate 0/* 1 if the buffer contains valid data */
136 #define BH_Dirty 1/* 1 if the buffer is dirty */
137 #define BH_Lock 2/* 1 if the buffer is locked */
138 #define BH_Req 3/* 0 if the buffer has been invalidated */
139 #define BH_Touched 4/* 1 if the buffer has been touched (aging) */
140 #define BH_Has_aged 5/* 1 if the buffer has been aged (aging) */
141 #define BH_Protected 6/* 1 if the buffer is protected */
142 #define BH_FreeOnIO 7/* 1 to discard the buffer_head after IO */
145 * Try to keep the most commonly used fields in single cache lines (16
146 * bytes) to improve performance. This ordering should be
147 * particularly beneficial on 32-bit processors.
149 * We use the first 16 bytes for the data which is used in searches
150 * over the block hash lists (ie. getblk(), find_buffer() and
151 * friends).
153 * The second 16 bytes we use for lru buffer scans, as used by
154 * sync_buffers() and refill_freelist(). -- sct
156 struct buffer_head {
157 /* First cache line: */
158 unsigned long b_blocknr;/* block number */
159 kdev_t b_dev;/* device (B_FREE = free) */
160 kdev_t b_rdev;/* Real device */
161 unsigned long b_rsector;/* Real buffer location on disk */
162 struct buffer_head * b_next;/* Hash queue list */
163 struct buffer_head * b_this_page;/* circular list of buffers in one page */
165 /* Second cache line: */
166 unsigned long b_state;/* buffer state bitmap (see above) */
167 struct buffer_head * b_next_free;
168 unsigned int b_count;/* users using this block */
169 unsigned long b_size;/* block size */
171 /* Non-performance-critical data follows. */
172 char* b_data;/* pointer to data block (1024 bytes) */
173 unsigned int b_list;/* List that this buffer appears */
174 unsigned long b_flushtime;/* Time when this (dirty) buffer
175 * should be written */
176 unsigned long b_lru_time;/* Time when this buffer was
177 * last used. */
178 struct wait_queue * b_wait;
179 struct buffer_head * b_prev;/* doubly linked list of hash-queue */
180 struct buffer_head * b_prev_free;/* doubly linked list of buffers */
181 struct buffer_head * b_reqnext;/* request queue */
184 staticinlineintbuffer_uptodate(struct buffer_head * bh)
186 returntest_bit(BH_Uptodate, &bh->b_state);
189 staticinlineintbuffer_dirty(struct buffer_head * bh)
191 returntest_bit(BH_Dirty, &bh->b_state);
194 staticinlineintbuffer_locked(struct buffer_head * bh)
196 returntest_bit(BH_Lock, &bh->b_state);
199 staticinlineintbuffer_req(struct buffer_head * bh)
201 returntest_bit(BH_Req, &bh->b_state);
204 staticinlineintbuffer_touched(struct buffer_head * bh)
206 returntest_bit(BH_Touched, &bh->b_state);
209 staticinlineintbuffer_has_aged(struct buffer_head * bh)
211 returntest_bit(BH_Has_aged, &bh->b_state);
214 staticinlineintbuffer_protected(struct buffer_head * bh)
216 returntest_bit(BH_Protected, &bh->b_state);
219 #include <linux/pipe_fs_i.h>
220 #include <linux/minix_fs_i.h>
221 #include <linux/ext_fs_i.h>
222 #include <linux/ext2_fs_i.h>
223 #include <linux/hpfs_fs_i.h>
224 #include <linux/msdos_fs_i.h>
225 #include <linux/umsdos_fs_i.h>
226 #include <linux/iso_fs_i.h>
227 #include <linux/nfs_fs_i.h>
228 #include <linux/xia_fs_i.h>
229 #include <linux/sysv_fs_i.h>
230 #include <linux/affs_fs_i.h>
231 #include <linux/ufs_fs_i.h>
234 * Attribute flags. These should be or-ed together to figure out what
235 * has been changed!
237 #define ATTR_MODE 1
238 #define ATTR_UID 2
239 #define ATTR_GID 4
240 #define ATTR_SIZE 8
241 #define ATTR_ATIME 16
242 #define ATTR_MTIME 32
243 #define ATTR_CTIME 64
244 #define ATTR_ATIME_SET 128
245 #define ATTR_MTIME_SET 256
246 #define ATTR_FORCE 512/* Not a change, but a change it */
249 * This is the Inode Attributes structure, used for notify_change(). It
250 * uses the above definitions as flags, to know which values have changed.
251 * Also, in this manner, a Filesystem can look at only the values it cares
252 * about. Basically, these are the attributes that the VFS layer can
253 * request to change from the FS layer.
255 * Derek Atkins <warlord@MIT.EDU> 94-10-20
257 struct iattr {
258 unsigned int ia_valid;
259 umode_t ia_mode;
260 uid_t ia_uid;
261 gid_t ia_gid;
262 off_t ia_size;
263 time_t ia_atime;
264 time_t ia_mtime;
265 time_t ia_ctime;
268 #include <linux/quota.h>
270 struct inode {
271 kdev_t i_dev;
272 unsigned long i_ino;
273 umode_t i_mode;
274 nlink_t i_nlink;
275 uid_t i_uid;
276 gid_t i_gid;
277 kdev_t i_rdev;
278 off_t i_size;
279 time_t i_atime;
280 time_t i_mtime;
281 time_t i_ctime;
282 unsigned long i_blksize;
283 unsigned long i_blocks;
284 unsigned long i_version;
285 unsigned long i_nrpages;
286 struct semaphore i_sem;
287 struct inode_operations *i_op;
288 struct super_block *i_sb;
289 struct wait_queue *i_wait;
290 struct file_lock *i_flock;
291 struct vm_area_struct *i_mmap;
292 struct page *i_pages;
293 struct dquot *i_dquot[MAXQUOTAS];
294 struct inode *i_next, *i_prev;
295 struct inode *i_hash_next, *i_hash_prev;
296 struct inode *i_bound_to, *i_bound_by;
297 struct inode *i_mount;
298 unsigned short i_count;
299 unsigned short i_flags;
300 unsigned char i_lock;
301 unsigned char i_dirt;
302 unsigned char i_pipe;
303 unsigned char i_sock;
304 unsigned char i_seek;
305 unsigned char i_update;
306 unsigned short i_writecount;
307 union{
308 struct pipe_inode_info pipe_i;
309 struct minix_inode_info minix_i;
310 struct ext_inode_info ext_i;
311 struct ext2_inode_info ext2_i;
312 struct hpfs_inode_info hpfs_i;
313 struct msdos_inode_info msdos_i;
314 struct umsdos_inode_info umsdos_i;
315 struct iso_inode_info isofs_i;
316 struct nfs_inode_info nfs_i;
317 struct xiafs_inode_info xiafs_i;
318 struct sysv_inode_info sysv_i;
319 struct affs_inode_info affs_i;
320 struct ufs_inode_info ufs_i;
321 struct socket socket_i;
322 void* generic_ip;
323 } u;
326 struct file {
327 mode_t f_mode;
328 loff_t f_pos;
329 unsigned short f_flags;
330 unsigned short f_count;
331 unsigned long f_reada, f_ramax, f_raend, f_ralen, f_rawin;
332 struct file *f_next, *f_prev;
333 int f_owner;/* pid or -pgrp where SIGIO should be sent */
334 struct inode * f_inode;
335 struct file_operations * f_op;
336 unsigned long f_version;
337 void*private_data;/* needed for tty driver, and maybe others */
340 #define FL_POSIX 1
341 #define FL_FLOCK 2
342 #define FL_BROKEN 4/* broken flock() emulation */
343 #define FL_ACCESS 8/* for processes suspended by mandatory locking */
345 struct file_lock {
346 struct file_lock *fl_next;/* singly linked list for this inode */
347 struct file_lock *fl_nextlink;/* doubly linked list of all locks */
348 struct file_lock *fl_prevlink;/* used to simplify lock removal */
349 struct file_lock *fl_nextblock;/* circular list of blocked processes */
350 struct file_lock *fl_prevblock;
351 struct task_struct *fl_owner;
352 struct wait_queue *fl_wait;
353 struct file *fl_file;
354 unsigned char fl_flags;
355 unsigned char fl_type;
356 off_t fl_start;
357 off_t fl_end;
360 #include <linux/fcntl.h>
362 externintfcntl_getlk(unsigned int fd,struct flock *l);
363 externintfcntl_setlk(unsigned int fd,unsigned int cmd,struct flock *l);
364 externvoidlocks_remove_locks(struct task_struct *task,struct file *filp);
366 #include <linux/stat.h>
368 #define FLOCK_VERIFY_READ 1
369 #define FLOCK_VERIFY_WRITE 2
371 externintlocks_mandatory_locked(struct inode *inode);
372 externintlocks_mandatory_area(int read_write,struct inode *inode,
373 struct file *filp,unsigned int offset,
374 unsigned int count);
376 extern inlineintlocks_verify_locked(struct inode *inode)
378 /* Candidates for mandatory locking have the setgid bit set
379 * but no group execute bit - an otherwise meaningless combination.
381 if(IS_MANDLOCK(inode) &&
382 (inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
383 return(locks_mandatory_locked(inode));
384 return(0);
386 extern inlineintlocks_verify_area(int read_write,struct inode *inode,
387 struct file *filp,unsigned int offset,
388 unsigned int count)
390 /* Candidates for mandatory locking have the setgid bit set
391 * but no group execute bit - an otherwise meaningless combination.
393 if(IS_MANDLOCK(inode) &&
394 (inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
395 return(locks_mandatory_area(read_write, inode, filp, offset,
396 count));
397 return(0);
400 struct fasync_struct {
401 int magic;
402 struct fasync_struct *fa_next;/* singly linked list */
403 struct file *fa_file;
406 #define FASYNC_MAGIC 0x4601
408 externintfasync_helper(struct inode *,struct file *,int,struct fasync_struct **);
410 #include <linux/minix_fs_sb.h>
411 #include <linux/ext_fs_sb.h>
412 #include <linux/ext2_fs_sb.h>
413 #include <linux/hpfs_fs_sb.h>
414 #include <linux/msdos_fs_sb.h>
415 #include <linux/iso_fs_sb.h>
416 #include <linux/nfs_fs_sb.h>
417 #include <linux/xia_fs_sb.h>
418 #include <linux/sysv_fs_sb.h>
419 #include <linux/affs_fs_sb.h>
420 #include <linux/ufs_fs_sb.h>
422 struct super_block {
423 kdev_t s_dev;
424 unsigned long s_blocksize;
425 unsigned char s_blocksize_bits;
426 unsigned char s_lock;
427 unsigned char s_rd_only;
428 unsigned char s_dirt;
429 struct file_system_type *s_type;
430 struct super_operations *s_op;
431 struct dquot_operations *dq_op;
432 unsigned long s_flags;
433 unsigned long s_magic;
434 unsigned long s_time;
435 struct inode * s_covered;
436 struct inode * s_mounted;
437 struct wait_queue * s_wait;
438 union{
439 struct minix_sb_info minix_sb;
440 struct ext_sb_info ext_sb;
441 struct ext2_sb_info ext2_sb;
442 struct hpfs_sb_info hpfs_sb;
443 struct msdos_sb_info msdos_sb;
444 struct isofs_sb_info isofs_sb;
445 struct nfs_sb_info nfs_sb;
446 struct xiafs_sb_info xiafs_sb;
447 struct sysv_sb_info sysv_sb;
448 struct affs_sb_info affs_sb;
449 struct ufs_sb_info ufs_sb;
450 void*generic_sbp;
451 } u;
455 * This is the "filldir" function type, used by readdir() to let
456 * the kernel specify what kind of dirent layout it wants to have.
457 * This allows the kernel to read directories into kernel space or
458 * to have different dirent layouts depending on the binary type.
460 typedefint(*filldir_t)(void*,const char*,int, off_t, ino_t);
462 struct file_operations {
463 long long(*llseek) (struct inode *,struct file *,long long,int);
464 long(*read) (struct inode *,struct file *,char*,unsigned long);
465 long(*write) (struct inode *,struct file *,const char*,unsigned long);
466 int(*readdir) (struct inode *,struct file *,void*, filldir_t);
467 int(*select) (struct inode *,struct file *,int, select_table *);
468 int(*ioctl) (struct inode *,struct file *,unsigned int,unsigned long);
469 int(*mmap) (struct inode *,struct file *,struct vm_area_struct *);
470 int(*open) (struct inode *,struct file *);
471 void(*release) (struct inode *,struct file *);
472 int(*fsync) (struct inode *,struct file *);
473 int(*fasync) (struct inode *,struct file *,int);
474 int(*check_media_change) (kdev_t dev);
475 int(*revalidate) (kdev_t dev);
478 struct inode_operations {
479 struct file_operations * default_file_ops;
480 int(*create) (struct inode *,const char*,int,int,struct inode **);
481 int(*lookup) (struct inode *,const char*,int,struct inode **);
482 int(*link) (struct inode *,struct inode *,const char*,int);
483 int(*unlink) (struct inode *,const char*,int);
484 int(*symlink) (struct inode *,const char*,int,const char*);
485 int(*mkdir) (struct inode *,const char*,int,int);
486 int(*rmdir) (struct inode *,const char*,int);
487 int(*mknod) (struct inode *,const char*,int,int,int);
488 int(*rename) (struct inode *,const char*,int,struct inode *,const char*,int,int);
489 int(*readlink) (struct inode *,char*,int);
490 int(*follow_link) (struct inode *,struct inode *,int,int,struct inode **);
491 int(*readpage) (struct inode *,struct page *);
492 int(*writepage) (struct inode *,struct page *);
493 int(*bmap) (struct inode *,int);
494 void(*truncate) (struct inode *);
495 int(*permission) (struct inode *,int);
496 int(*smap) (struct inode *,int);
499 struct super_operations {
500 void(*read_inode) (struct inode *);
501 int(*notify_change) (struct inode *,struct iattr *);
502 void(*write_inode) (struct inode *);
503 void(*put_inode) (struct inode *);
504 void(*put_super) (struct super_block *);
505 void(*write_super) (struct super_block *);
506 void(*statfs) (struct super_block *,struct statfs *,int);
507 int(*remount_fs) (struct super_block *,int*,char*);
510 struct dquot_operations {
511 void(*initialize) (struct inode *,short);
512 void(*drop) (struct inode *);
513 int(*alloc_block) (const struct inode *,unsigned long);
514 int(*alloc_inode) (const struct inode *,unsigned long);
515 void(*free_block) (const struct inode *,unsigned long);
516 void(*free_inode) (const struct inode *,unsigned long);
517 int(*transfer) (struct inode *,struct iattr *,char);
520 struct file_system_type {
521 struct super_block *(*read_super) (struct super_block *,void*,int);
522 const char*name;
523 int requires_dev;
524 struct file_system_type * next;
527 externintregister_filesystem(struct file_system_type *);
528 externintunregister_filesystem(struct file_system_type *);
530 asmlinkage intsys_open(const char*,int,int);
531 asmlinkage intsys_close(unsigned int);/* yes, it's really unsigned */
533 externvoidkill_fasync(struct fasync_struct *fa,int sig);
535 externintgetname(const char* filename,char**result);
536 externvoidputname(char* name);
537 externintdo_truncate(struct inode *,unsigned long);
538 externintregister_blkdev(unsigned int,const char*,struct file_operations *);
539 externintunregister_blkdev(unsigned int major,const char* name);
540 externintblkdev_open(struct inode * inode,struct file * filp);
541 externvoidblkdev_release(struct inode * inode);
542 externstruct file_operations def_blk_fops;
543 externstruct inode_operations blkdev_inode_operations;
545 externintregister_chrdev(unsigned int,const char*,struct file_operations *);
546 externintunregister_chrdev(unsigned int major,const char* name);
547 externintchrdev_open(struct inode * inode,struct file * filp);
548 externstruct file_operations def_chr_fops;
549 externstruct inode_operations chrdev_inode_operations;
551 externvoidinit_fifo(struct inode * inode);
552 externstruct inode_operations fifo_inode_operations;
554 externstruct file_operations connecting_fifo_fops;
555 externstruct file_operations read_fifo_fops;
556 externstruct file_operations write_fifo_fops;
557 externstruct file_operations rdwr_fifo_fops;
558 externstruct file_operations read_pipe_fops;
559 externstruct file_operations write_pipe_fops;
560 externstruct file_operations rdwr_pipe_fops;
562 externstruct file_system_type *get_fs_type(const char*name);
564 externintfs_may_mount(kdev_t dev);
565 externintfs_may_umount(kdev_t dev,struct inode * mount_root);
566 externintfs_may_remount_ro(kdev_t dev);
568 externstruct file *first_file;
569 externstruct super_block super_blocks[NR_SUPER];
571 externvoidrefile_buffer(struct buffer_head * buf);
572 externvoidset_writetime(struct buffer_head * buf,int flag);
573 externvoidrefill_freelist(int size);
574 externinttry_to_free_buffer(struct buffer_head*,struct buffer_head**,int);
576 externint nr_buffers;
577 externint buffermem;
578 externint nr_buffer_heads;
580 #define BUF_CLEAN 0
581 #define BUF_UNSHARED 1/* Buffers that were shared but are not any more */
582 #define BUF_LOCKED 2/* Buffers scheduled for write */
583 #define BUF_LOCKED1 3/* Supers, inodes */
584 #define BUF_DIRTY 4/* Dirty buffers, not yet scheduled for write */
585 #define BUF_SHARED 5/* Buffers shared */
586 #define NR_LIST 6
588 voidmark_buffer_uptodate(struct buffer_head * bh,int on);
590 extern inlinevoidmark_buffer_clean(struct buffer_head * bh)
592 if(clear_bit(BH_Dirty, &bh->b_state)) {
593 if(bh->b_list == BUF_DIRTY)
594 refile_buffer(bh);
598 extern inlinevoidmark_buffer_dirty(struct buffer_head * bh,int flag)
600 if(!set_bit(BH_Dirty, &bh->b_state)) {
601 set_writetime(bh, flag);
602 if(bh->b_list != BUF_DIRTY)
603 refile_buffer(bh);
607 externintcheck_disk_change(kdev_t dev);
608 externvoidinvalidate_inodes(kdev_t dev);
609 externvoidinvalidate_inode_pages(struct inode *);
610 externvoidinvalidate_buffers(kdev_t dev);
611 externintfloppy_is_wp(int minor);
612 externvoidsync_inodes(kdev_t dev);
613 externvoidsync_dev(kdev_t dev);
614 externintfsync_dev(kdev_t dev);
615 externvoidsync_supers(kdev_t dev);
616 externintbmap(struct inode * inode,int block);
617 externintnotify_change(struct inode *,struct iattr *);
618 externintnamei(const char* pathname,struct inode ** res_inode);
619 externintlnamei(const char* pathname,struct inode ** res_inode);
620 externintpermission(struct inode * inode,int mask);
621 externintget_write_access(struct inode *inode);
622 externvoidput_write_access(struct inode *inode);
623 externintopen_namei(const char* pathname,int flag,int mode,
624 struct inode ** res_inode,struct inode * base);
625 externintdo_mknod(const char* filename,int mode, dev_t dev);
626 externintdo_pipe(int*);
627 externvoidiput(struct inode * inode);
628 externstruct inode *__iget(struct super_block * sb,int nr,int crsmnt);
629 externstruct inode *get_empty_inode(void);
630 externvoidinsert_inode_hash(struct inode *);
631 externvoidclear_inode(struct inode *);
632 externstruct inode *get_pipe_inode(void);
633 externintget_unused_fd(void);
634 externvoidput_unused_fd(int);
635 externstruct file *get_empty_filp(void);
636 externintclose_fp(struct file *filp);
637 externstruct buffer_head *get_hash_table(kdev_t dev,int block,int size);
638 externstruct buffer_head *getblk(kdev_t dev,int block,int size);
639 externvoidll_rw_block(int rw,int nr,struct buffer_head * bh[]);
640 externvoidll_rw_page(int rw, kdev_t dev,unsigned long nr,char* buffer);
641 externvoidll_rw_swap_file(int rw, kdev_t dev,unsigned int*b,int nb,char*buffer);
642 externintis_read_only(kdev_t dev);
643 externvoid__brelse(struct buffer_head *buf);
644 extern inlinevoidbrelse(struct buffer_head *buf)
646 if(buf)
647 __brelse(buf);
649 externvoid__bforget(struct buffer_head *buf);
650 extern inlinevoidbforget(struct buffer_head *buf)
652 if(buf)
653 __bforget(buf);
655 externvoidset_blocksize(kdev_t dev,int size);
656 externstruct buffer_head *bread(kdev_t dev,int block,int size);
657 externstruct buffer_head *breada(kdev_t dev,int block,int size,
658 unsigned int pos,unsigned int filesize);
660 externintbrw_page(int,struct page *, kdev_t,int[],int,int);
662 externintgeneric_readpage(struct inode *,struct page *);
663 externintgeneric_file_mmap(struct inode *,struct file *,struct vm_area_struct *);
664 externlonggeneric_file_read(struct inode *,struct file *,char*,unsigned long);
666 externvoidput_super(kdev_t dev);
667 unsigned longgenerate_cluster(kdev_t dev,int b[],int size);
668 extern kdev_t ROOT_DEV;
670 externvoidshow_buffers(void);
671 externvoidmount_root(void);
673 #ifdef CONFIG_BLK_DEV_INITRD
674 extern kdev_t real_root_dev;
675 externintchange_root(kdev_t new_root_dev,const char*put_old);
676 #endif
678 externlongchar_read(struct inode *,struct file *,char*,unsigned long);
679 externlongblock_read(struct inode *,struct file *,char*,unsigned long);
680 externint read_ahead[];
682 externlongchar_write(struct inode *,struct file *,const char*,unsigned long);
683 externlongblock_write(struct inode *,struct file *,const char*,unsigned long);
685 externintblock_fsync(struct inode *,struct file *);
686 externintfile_fsync(struct inode *,struct file *);
688 externvoiddcache_add(struct inode *,const char*,int,unsigned long);
689 externintdcache_lookup(struct inode *,const char*,int,unsigned long*);
691 externintinode_change_ok(struct inode *,struct iattr *);
692 externvoidinode_setattr(struct inode *,struct iattr *);
694 extern inlinestruct inode *iget(struct super_block * sb,int nr)
696 return__iget(sb, nr,1);
699 /* kludge to get SCSI modules working */
700 #include <linux/minix_fs.h>
701 #include <linux/minix_fs_sb.h>
703 #endif/* __KERNEL__ */
705 #endif
close