Server for Information Technologies

(095) 932-9212, 932-9213, 939-0783
E-mail: info@citforum.ru
(!) CIT Forum CD-ROM

FILESYSTEM(5)
XENIX System V (1 ap 1989)


file system - opa oa, coepa aoy ccey.

#include <sys/filsys.h>
#include <sys/types.h>
#include <sys/param.h>


Ka o, coepa aoy ccey (apep, ec c) opaeec a o o 256 co (512 a). o c oepo 0 e coyec coep popay aao apy pyy opa.

o oep 1 - cyepo. opa oo oa oca apo ae /usr/include/sys/filesys.h. B o apo ae S_isize pecae coo apec epoo oa ax oce cca ecx ecpopo, aaeoc cpay oce cyepoa oe oep 2; a cca ecx ecpopo paa s_isize-2. S-fsize pecae coo ep o, eocy aoo ccee. o coyc oepaoo cceo ae eex oo. Ec oepao ccea yea e o cca ae , apo, ocooaec o cca ae, a oco oc cooee. oee oo, cco coox oo oppepyec a, o ee o e oa cco coox oo.

Cco coox o aoo oa opaoa cey opao. Macc s_free coep eeax s_free[1], ... , s_free[s_nfree-1] o 49 oepo coox oo. S_free[0] coep oep oa aooa e oo, cocax cco coooo pocpaca. epa epeea a long ao e coox oo pecae coo co (o 50) oepo coox oo, acax ceyx 50 eeax a long oo eea e. ep x ec oo ca co cey eeo e. oo, o e o: ye aee s_nfree o s_free[s_nfree]. Ec oep ooo oa pae y, e cyecye ocaxc oo, ooy aec oa. Ec s_nfree caoc 0, poec oe, opeee oepo ooo oa, ae s_nfree eo ep coo opoa oepa oo ceyx 50 eeax a long acc s_free. oo, o ocoo o poep, ec s_nfree pao 50; ec a, opoa s_nfree acc s_free eo ycao aee s_nfree pa 0. B o cyae ycao s_free[s_nfree] a oep ocooeoo oa ye s_nfree.

S_tfree pecae coo oeco coox oo, ocyx aoo ccee.

S_ninide pecae coo oepa coox ecx ecpopo acces_inode. ee ecoo ecpopa aa: ec s_ninode oe y, ye eo epy s_inode[s_ninode]. Ec o pae 0, a cco ecx ecpopo paec oepa coox ecx ecpopo ao(o 100) acce s_inode, ae oac coa. ocooe ecoo ecpopa aa, pe s_ninode ee 100, paec eo oep s_inode[s_ninode] ye s_ninode. Ec s_ninode pae 100, e yo oa ec ecpop aa y ay. o cco ecx ecpopo ao oo yeae copoc poecca ee. opa o o, ec ec ecpop aa eceo coo coepc coceo eco ecpope.

S_tinode pecae coo oeco coox ecx ecpopo, ocyx aoo ccee.

a S_flock silock coyc oo oa, oa aoa ccea copoaa. aee s_fmode a ce ae ecyeceo coyec a a opae oo, o cyepo ee oe copoa a c ee ceyeo epoa ooe opa aoo cce.

a S_ronly oaae, o o ocye oo e.

S_time ec oce peee, oa cyepo aoo cce ee pecaec co oo ooc, ceyax,oopoe poo c oea 00:00 ap 1, 1970 (o py). Bo pe epeapy, ee s_time cyepoa opeo aoo cce coyec ycao cceoo pee.

Hoepa ecpopo aac c 1 xpac oe 2. Tae, ece ecpop ao pecac 64 aa, ooy 8 x oeac o. Ta opao, ec ecpop aa i paeaec oe c oepo(i+15)/8 aac 64x((i+15)(mod 8)) a o aaa. ec ecpop aa 1 peeppyec cooa yye. ec ecpop aa 2 peeppyec opeoo aaoa aoo cce, pye oepa ecpopo e peeppyc ceaoo cooa. Ka ec ecpop aa pecae o a. oye opoo opa o opae ecx ecpopo ao x aax cop inode(F).

/usr/include/sys/filesys.h
/usr/include/sys/stat.h

.
fseek(1), mkfs(1), inode(5)
Comments: info@citmgu.ru
Designed by Andrey Novikov
Copyright © CIT