The Se­mes­ter Project—Part VII The File Sys­tem in Ac­tion This ar­ti­cle, which is part of the se­ries on Linux de­vice driv­ers, gets the com­plete SIM­ULA file sys­tem mod­ule in ac­tion, with a real hard­ware par­ti­tion on your pen drive.

OpenSource For You - - DEVELOPERS -

LET’S fiRST TAKE A LOOK AT REAL SFS. THE CODE AVAIL­ABLE FROM http://lin­ux­foru.com/ar­ti­cle_ source_­code/nov12/rf­s_­code.tar.bz2 GETS TO THE fi­NAL TESTED IM­PLE­MEN­TA­TION OF PUGS’ AND SH­WETA'S fi­NAL SE­MES­TER PROJECT. ,T CON­TAINS THE FOL­LOW­ING: re­al_sfs.c— THE CODE OF THE EAR­LIER re­al_s­f­s_min­i­mal.c, PLUS THE RE­MAIN­ING REAL S,MULA fiLE SYS­TEM FUNC­TION­AL­I­TIES. re­al_s­f­s_ops.c & re­al_s­f­s_ops.h — THE EAR­LIER CODE PLUS THE AD­DI­TIONAL OP­ER­A­TIONS NEEDED FOR THE EN­HANCED re­al_ sfs.c IM­PLE­MEN­TA­TIONS. Re­al_ sf­s_ds.h— AL­MOST THE SAME fiLE AS IN THE PRE­VI­OUS AR­TI­CLE, PLUS A SPIN LOCK ADDED INTO THE REAL SFS info STRUC­TURE, TO BE USED FOR PRE­VENT­ING RACE CON­DI­TIONS IN AC­CESS­ING THE used_blocks AR­RAY IN THE SAME STRUC­TURE. for­mat_re­al_sfs.c— THE SAME fiLE AS IN PRE­VI­OUS AR­TI­CLES AND THE re­al_sfs FORMATTER AP­PLI­CA­TION. Make­file— CON­TAINS THE RULES FOR BUILD­ING THE DRIVER re­al_s­f­s_­fi­nal.ko US­ING THE re­al_s­fs_*.* FILES, AND THE for­mat_re­al_sfs AP­PLI­CA­TION, US­ING for­mat_re­al_sfs.c. WITH ALL THESE AND THE DE­TAILS PRO­VIDED EAR­LIER, SH­WETA COM­PLETED THE PROJECT’S DOC­U­MEN­TA­TION. AND SO, fi­NALLY, SH­WETA AND PUGS WERE ALL SET FOR THEIR fi­NAL SE­MES­TER PROJECT’S DEMO, PRE­SEN­TA­TION AND VIVA. THE HIGH­LIGHTS OF THEIR DEMO (IN A ROOT SHELL) WERE AS FOL­LOWS: LOAD­ING THE Ueal_sIs_­fi­nal DRIVER: Lns­mod Ueal_sIs_­fi­nal.No US­ING THE PRE­VI­OUSLY FOR­MAT­TED PEN DRIVE PAR­TI­TION / dev/sdb1 OR RE-FOR­MAT­TING IT US­ING THE for­mat_re­al_sfs AP­PLI­CA­TION: ./for­mat_re­al_sfs /dev/sdb1. Cau­tion: PLEASE CHECK OUT THE DE­TAILED STEPS FOR THESE PRO­CE­DURES FROM THE PRE­VI­OUS AR­TI­CLE, BE­FORE YOU AC­TU­ALLY FOR­MAT IT. MOUNT THE re­al_sfs FOR­MAT­TED PAR­TI­TION: mount -t re­al_sfs / dev/sdb1 /mnt AND, BROWS­ING THE MOUNTED fiLESYSTEM, US­ING THE USUAL SHELL COM­MANDS LIKE ls, cd, touch, vi, rm, chmod, … FIG­URE 1 SHOWS THE REAL S,MULA fiLE SYS­TEM IN AC­TION.

Be­hind the scenes

AND IF YOU RE­ALLY WANT TO KNOW WHAT EN­HANCE­MENTS PUGS ADDED TO THE PRE­VI­OUS AR­TI­CLE'S CODE TO GET TO THIS LEVEL, IT IS BA­SI­CALLY THE FOL­LOW­ING CORE SYS­TEM CALLS, AS PART OF THE RE­MAIN­ING 4 OUT OF 5 SETS OF STRUC­TURES OF FUNC­TION POINT­ERS (IN re­al_sfs.c): 1) write_in­ode (UN­DER STRUCT su­per_­op­er­a­tions)—sf­s_write_

in­ode() BA­SI­CALLY GETS A POINTER TO AN IN­ODE IN THE VFS'

Newspapers in English

Newspapers from India

© PressReader. All rights reserved.