undelfs.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719
  1. /* UnDel File System: Midnight Commander file system.
  2. This file system is intended to be used together with the
  3. ext2fs library to recover files from ext2fs file systems.
  4. Parts of this program were taken from the lsdel.c and dump.c files
  5. written by Ted Ts'o (tytso@mit.edu) for the ext2fs package.
  6. Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
  7. 2005, 2007 Free Software Foundation, Inc.
  8. Written by: 1995 Miguel de Icaza.
  9. 1997 Norbert Warmuth.
  10. 2000 Pavel Machek
  11. This program is free software; you can redistribute it and/or
  12. modify it under the terms of the GNU Library General Public License
  13. as published by the Free Software Foundation; either version 2 of
  14. the License, or (at your option) any later version.
  15. This program is distributed in the hope that it will be useful,
  16. but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. GNU Library General Public License for more details.
  19. You should have received a copy of the GNU Library General Public
  20. License along with this program; if not, write to the Free Software
  21. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
  22. /**
  23. * \file
  24. * \brief Source: UnDel File System
  25. *
  26. * Assumptions:
  27. *
  28. * 1. We don't handle directories (thus undelfs_get_path is easy to write).
  29. * 2. Files are on the local file system (we do not support vfs files
  30. * because we would have to provide an io_manager for the ext2fs tools,
  31. * and I don't think it would be too useful to undelete files
  32. */
  33. #include <config.h>
  34. #include <errno.h>
  35. #include <stdio.h>
  36. #include <stdlib.h>
  37. #include <fcntl.h>
  38. #ifdef HAVE_EXT2FS_EXT2_FS_H
  39. #include <ext2fs/ext2_fs.h>
  40. #else
  41. /* asm/types.h defines its own umode_t */
  42. #undef umode_t
  43. #include <linux/ext2_fs.h>
  44. #endif
  45. #include <ext2fs/ext2fs.h>
  46. #include <ctype.h>
  47. #include "../src/global.h"
  48. #include "../src/wtools.h" /* message() */
  49. #include "../src/main.h" /* print_vfs_message */
  50. #include "utilvfs.h"
  51. #include "vfs.h"
  52. #include "vfs-impl.h"
  53. struct deleted_info {
  54. ext2_ino_t ino;
  55. unsigned short mode;
  56. unsigned short uid;
  57. unsigned short gid;
  58. unsigned long size;
  59. time_t dtime;
  60. int num_blocks;
  61. int free_blocks;
  62. };
  63. struct lsdel_struct {
  64. ext2_ino_t inode;
  65. int num_blocks;
  66. int free_blocks;
  67. int bad_blocks;
  68. };
  69. /* We only allow one opened ext2fs */
  70. static char *ext2_fname;
  71. static ext2_filsys fs = NULL;
  72. static struct lsdel_struct lsd;
  73. static struct deleted_info *delarray;
  74. static int num_delarray, max_delarray;
  75. static char *block_buf;
  76. static const char *undelfserr = N_(" undelfs: error ");
  77. static int readdir_ptr;
  78. static int undelfs_usage;
  79. static struct vfs_class vfs_undelfs_ops;
  80. /* To generate the . and .. entries use -2 */
  81. #define READDIR_PTR_INIT 0
  82. static void
  83. undelfs_shutdown (void)
  84. {
  85. if (fs)
  86. ext2fs_close (fs);
  87. fs = NULL;
  88. g_free (ext2_fname);
  89. ext2_fname = NULL;
  90. g_free (delarray);
  91. delarray = NULL;
  92. g_free (block_buf);
  93. block_buf = NULL;
  94. }
  95. static void
  96. undelfs_get_path (const char *dirname, char **fsname, char **file)
  97. {
  98. const char *p;
  99. /* To look like filesystem, we have virtual directories
  100. /#undel:XXX, which have no subdirectories. XXX is replaced with
  101. hda5, sdb8 etc, which is assumed to live under /dev.
  102. -- pavel@ucw.cz */
  103. *fsname = NULL;
  104. if (strncmp (dirname, "/#undel:", 8))
  105. return;
  106. dirname += 8;
  107. /* Since we don't allow subdirectories, it's easy to get a filename,
  108. * just scan backwards for a slash */
  109. if (*dirname == 0)
  110. return;
  111. p = dirname + strlen (dirname);
  112. #if 0
  113. /* Strip trailing ./
  114. */
  115. if (p - dirname > 2 && *(p-1) == '/' && *(p-2) == '.')
  116. *(p = p-2) = 0;
  117. #endif
  118. while (p > dirname){
  119. if (*p == '/'){
  120. char *tmp;
  121. *file = g_strdup (p+1);
  122. tmp = g_strndup (dirname, p - dirname);
  123. *fsname = g_strconcat ("/dev/", tmp, (char *) NULL);
  124. g_free (tmp);
  125. return;
  126. }
  127. p--;
  128. }
  129. *file = g_strdup ("");
  130. *fsname = g_strconcat ("/dev/", dirname, (char *) NULL);
  131. return;
  132. }
  133. static int
  134. undelfs_lsdel_proc(ext2_filsys fs, blk_t *block_nr, int blockcnt, void *private)
  135. {
  136. struct lsdel_struct *lsd = (struct lsdel_struct *) private;
  137. (void) blockcnt;
  138. lsd->num_blocks++;
  139. if (*block_nr < fs->super->s_first_data_block ||
  140. *block_nr >= fs->super->s_blocks_count) {
  141. lsd->bad_blocks++;
  142. return BLOCK_ABORT;
  143. }
  144. if (!ext2fs_test_block_bitmap(fs->block_map,*block_nr))
  145. lsd->free_blocks++;
  146. return 0;
  147. }
  148. /*
  149. * Load information about deleted files.
  150. * Don't abort if there is not enough memory - load as much as we can.
  151. */
  152. static int
  153. undelfs_loaddel (void)
  154. {
  155. int retval, count;
  156. ext2_ino_t ino;
  157. struct ext2_inode inode;
  158. ext2_inode_scan scan;
  159. max_delarray = 100;
  160. num_delarray = 0;
  161. delarray = g_try_malloc (sizeof (struct deleted_info) * max_delarray);
  162. if (!delarray) {
  163. message (D_ERROR, undelfserr, _(" not enough memory "));
  164. return 0;
  165. }
  166. block_buf = g_try_malloc (fs->blocksize * 3);
  167. if (!block_buf) {
  168. message (D_ERROR, undelfserr, _(" while allocating block buffer "));
  169. goto free_delarray;
  170. }
  171. if ((retval = ext2fs_open_inode_scan (fs, 0, &scan))) {
  172. message (D_ERROR, undelfserr, _(" open_inode_scan: %d "), retval);
  173. goto free_block_buf;
  174. }
  175. if ((retval = ext2fs_get_next_inode (scan, &ino, &inode))) {
  176. message (D_ERROR, undelfserr, _(" while starting inode scan %d "),
  177. retval);
  178. goto error_out;
  179. }
  180. count = 0;
  181. while (ino) {
  182. if ((count++ % 1024) == 0)
  183. print_vfs_message (_
  184. ("undelfs: loading deleted files information %d inodes"),
  185. count);
  186. if (inode.i_dtime == 0)
  187. goto next;
  188. if (S_ISDIR (inode.i_mode))
  189. goto next;
  190. lsd.inode = ino;
  191. lsd.num_blocks = 0;
  192. lsd.free_blocks = 0;
  193. lsd.bad_blocks = 0;
  194. retval =
  195. ext2fs_block_iterate (fs, ino, 0, block_buf,
  196. undelfs_lsdel_proc, &lsd);
  197. if (retval) {
  198. message (D_ERROR, undelfserr,
  199. _(" while calling ext2_block_iterate %d "), retval);
  200. goto next;
  201. }
  202. if (lsd.free_blocks && !lsd.bad_blocks) {
  203. if (num_delarray >= max_delarray) {
  204. struct deleted_info *delarray_new =
  205. g_try_realloc (delarray,
  206. sizeof (struct deleted_info) *
  207. (max_delarray + 50));
  208. if (!delarray_new) {
  209. message (D_ERROR, undelfserr,
  210. _
  211. (" no more memory while reallocating array "));
  212. goto error_out;
  213. }
  214. delarray = delarray_new;
  215. max_delarray += 50;
  216. }
  217. delarray[num_delarray].ino = ino;
  218. delarray[num_delarray].mode = inode.i_mode;
  219. delarray[num_delarray].uid = inode.i_uid;
  220. delarray[num_delarray].gid = inode.i_gid;
  221. delarray[num_delarray].size = inode.i_size;
  222. delarray[num_delarray].dtime = inode.i_dtime;
  223. delarray[num_delarray].num_blocks = lsd.num_blocks;
  224. delarray[num_delarray].free_blocks = lsd.free_blocks;
  225. num_delarray++;
  226. }
  227. next:
  228. retval = ext2fs_get_next_inode (scan, &ino, &inode);
  229. if (retval) {
  230. message (D_ERROR, undelfserr, _(" while doing inode scan %d "),
  231. retval);
  232. goto error_out;
  233. }
  234. }
  235. readdir_ptr = READDIR_PTR_INIT;
  236. ext2fs_close_inode_scan (scan);
  237. return 1;
  238. error_out:
  239. ext2fs_close_inode_scan (scan);
  240. free_block_buf:
  241. g_free (block_buf);
  242. block_buf = NULL;
  243. free_delarray:
  244. g_free (delarray);
  245. delarray = NULL;
  246. return 0;
  247. }
  248. /*
  249. * This function overrides com_err() from libcom_err library.
  250. * It is used in libext2fs to report errors.
  251. */
  252. void
  253. com_err (const char *whoami, long err_code, const char *fmt, ...)
  254. {
  255. va_list ap;
  256. char *str;
  257. va_start (ap, fmt);
  258. str = g_strdup_vprintf (fmt, ap);
  259. va_end (ap);
  260. message (D_ERROR, _(" Ext2lib error "), " %s (%s: %ld) ", str, whoami,
  261. err_code);
  262. g_free (str);
  263. }
  264. static void *
  265. undelfs_opendir (struct vfs_class *me, const char *dirname)
  266. {
  267. char *file, *f;
  268. undelfs_get_path (dirname, &file, &f);
  269. if (!file)
  270. return 0;
  271. /* We don't use the file name */
  272. g_free (f);
  273. if (!ext2_fname || strcmp (ext2_fname, file)){
  274. undelfs_shutdown ();
  275. ext2_fname = file;
  276. } else {
  277. /* To avoid expensive re-scannings */
  278. readdir_ptr = READDIR_PTR_INIT;
  279. g_free (file);
  280. return fs;
  281. }
  282. if (ext2fs_open (ext2_fname, 0, 0, 0, unix_io_manager, &fs)){
  283. message (D_ERROR, undelfserr, _(" Cannot open file %s "), ext2_fname);
  284. return 0;
  285. }
  286. print_vfs_message (_("undelfs: reading inode bitmap..."));
  287. if (ext2fs_read_inode_bitmap (fs)){
  288. message (D_ERROR, undelfserr,
  289. _(" Cannot load inode bitmap from: \n %s \n"), ext2_fname);
  290. goto quit_opendir;
  291. }
  292. print_vfs_message (_("undelfs: reading block bitmap..."));
  293. if (ext2fs_read_block_bitmap (fs)){
  294. message (D_ERROR, undelfserr,
  295. _(" Cannot load block bitmap from: \n %s \n"), ext2_fname);
  296. goto quit_opendir;
  297. }
  298. /* Now load the deleted information */
  299. if (!undelfs_loaddel ())
  300. goto quit_opendir;
  301. print_vfs_message (_("%s: done."), me->name);
  302. return fs;
  303. quit_opendir:
  304. print_vfs_message (_("%s: failure"), me->name);
  305. ext2fs_close (fs);
  306. fs = NULL;
  307. return 0;
  308. }
  309. static void *
  310. undelfs_readdir(void *vfs_info)
  311. {
  312. static union vfs_dirent undelfs_readdir_data;
  313. static char *const dirent_dest = undelfs_readdir_data.dent.d_name;
  314. if (vfs_info != fs) {
  315. message (D_ERROR, undelfserr, _(" vfs_info is not fs! "));
  316. return NULL;
  317. }
  318. if (readdir_ptr == num_delarray)
  319. return NULL;
  320. if (readdir_ptr < 0)
  321. strcpy (dirent_dest, readdir_ptr == -2 ? "." : "..");
  322. else
  323. g_snprintf(dirent_dest, MC_MAXPATHLEN, "%ld:%d",
  324. (long) delarray[readdir_ptr].ino,
  325. delarray[readdir_ptr].num_blocks);
  326. readdir_ptr++;
  327. compute_namelen(&undelfs_readdir_data.dent);
  328. return &undelfs_readdir_data;
  329. }
  330. static int
  331. undelfs_closedir (void *vfs_info)
  332. {
  333. return 0;
  334. }
  335. typedef struct {
  336. int f_index; /* file index into delarray */
  337. char *buf;
  338. int error_code; /* */
  339. int pos; /* file position */
  340. int current; /* used to determine current position in itereate */
  341. int finished;
  342. ext2_ino_t inode;
  343. int bytes_read;
  344. long size;
  345. /* Used by undelfs_read: */
  346. char *dest_buffer; /* destination buffer */
  347. int count; /* bytes to read */
  348. } undelfs_file;
  349. /* We do not support lseek */
  350. static void *
  351. undelfs_open (struct vfs_class *me, const char *fname, int flags, int mode)
  352. {
  353. char *file, *f;
  354. ext2_ino_t inode, i;
  355. undelfs_file *p = NULL;
  356. /* Only allow reads on this file system */
  357. undelfs_get_path (fname, &file, &f);
  358. if (!file)
  359. return 0;
  360. if (!ext2_fname || strcmp (ext2_fname, file)) {
  361. message (D_ERROR, undelfserr,
  362. _(" You have to chdir to extract files first "));
  363. g_free (file);
  364. g_free (f);
  365. return 0;
  366. }
  367. inode = atol (f);
  368. /* Search the file into delarray */
  369. for (i = 0; i < num_delarray; i++) {
  370. if (inode != delarray[i].ino)
  371. continue;
  372. /* Found: setup all the structures needed by read */
  373. p = (undelfs_file *) g_try_malloc (((gsize) sizeof (undelfs_file)));
  374. if (!p) {
  375. g_free (file);
  376. g_free (f);
  377. return 0;
  378. }
  379. p->buf = g_try_malloc (fs->blocksize);
  380. if (!p->buf) {
  381. g_free (p);
  382. g_free (file);
  383. g_free (f);
  384. return 0;
  385. }
  386. p->inode = inode;
  387. p->finished = 0;
  388. p->f_index = i;
  389. p->error_code = 0;
  390. p->pos = 0;
  391. p->size = delarray[i].size;
  392. }
  393. g_free (file);
  394. g_free (f);
  395. undelfs_usage++;
  396. return p;
  397. }
  398. static int
  399. undelfs_close (void *vfs_info)
  400. {
  401. undelfs_file *p = vfs_info;
  402. g_free (p->buf);
  403. g_free (p);
  404. undelfs_usage--;
  405. return 0;
  406. }
  407. static int
  408. undelfs_dump_read(ext2_filsys fs, blk_t *blocknr, int blockcnt, void *private)
  409. {
  410. int copy_count;
  411. undelfs_file *p = (undelfs_file *) private;
  412. if (blockcnt < 0)
  413. return 0;
  414. if (*blocknr) {
  415. p->error_code = io_channel_read_blk(fs->io, *blocknr,
  416. 1, p->buf);
  417. if (p->error_code)
  418. return BLOCK_ABORT;
  419. } else
  420. memset(p->buf, 0, fs->blocksize);
  421. if (p->pos + p->count < p->current){
  422. p->finished = 1;
  423. return BLOCK_ABORT;
  424. }
  425. if (p->pos > p->current + fs->blocksize){
  426. p->current += fs->blocksize;
  427. return 0; /* we have not arrived yet */
  428. }
  429. /* Now, we know we have to extract some data */
  430. if (p->pos >= p->current){
  431. /* First case: starting pointer inside this block */
  432. if (p->pos + p->count <= p->current + fs->blocksize){
  433. /* Fully contained */
  434. copy_count = p->count;
  435. p->finished = p->count;
  436. } else {
  437. /* Still some more data */
  438. copy_count = fs->blocksize-(p->pos-p->current);
  439. }
  440. memcpy (p->dest_buffer, p->buf + (p->pos-p->current), copy_count);
  441. } else {
  442. /* Second case: we already have passed p->pos */
  443. if (p->pos+p->count < p->current+fs->blocksize){
  444. copy_count = (p->pos + p->count) - p->current;
  445. p->finished = p->count;
  446. } else {
  447. copy_count = fs->blocksize;
  448. }
  449. memcpy (p->dest_buffer, p->buf, copy_count);
  450. }
  451. p->dest_buffer += copy_count;
  452. p->current += fs->blocksize;
  453. if (p->finished){
  454. return BLOCK_ABORT;
  455. }
  456. return 0;
  457. }
  458. static ssize_t
  459. undelfs_read (void *vfs_info, char *buffer, int count)
  460. {
  461. undelfs_file *p = vfs_info;
  462. int retval;
  463. p->dest_buffer = buffer;
  464. p->current = 0;
  465. p->finished = 0;
  466. p->count = count;
  467. if (p->pos + p->count > p->size){
  468. p->count = p->size - p->pos;
  469. }
  470. retval = ext2fs_block_iterate(fs, p->inode, 0, NULL,
  471. undelfs_dump_read, p);
  472. if (retval){
  473. message (D_ERROR, undelfserr, _(" while iterating over blocks "));
  474. return -1;
  475. }
  476. if (p->error_code && !p->finished)
  477. return 0;
  478. p->pos = p->pos + (p->dest_buffer - buffer);
  479. return p->dest_buffer - buffer;
  480. }
  481. static long
  482. undelfs_getindex (char *path)
  483. {
  484. ext2_ino_t inode = atol (path);
  485. int i;
  486. for (i = 0; i < num_delarray; i++){
  487. if (delarray [i].ino == inode)
  488. return i;
  489. }
  490. return -1;
  491. }
  492. static int
  493. undelfs_stat_int (int inode_index, struct stat *buf)
  494. {
  495. buf->st_dev = 0;
  496. buf->st_ino = delarray [inode_index].ino;
  497. buf->st_mode = delarray [inode_index].mode;
  498. buf->st_nlink = 1;
  499. buf->st_uid = delarray [inode_index].uid;
  500. buf->st_gid = delarray [inode_index].gid;
  501. buf->st_size = delarray [inode_index].size;
  502. buf->st_atime = delarray [inode_index].dtime;
  503. buf->st_ctime = delarray [inode_index].dtime;
  504. buf->st_mtime = delarray [inode_index].dtime;
  505. return 0;
  506. }
  507. static int
  508. undelfs_lstat (struct vfs_class *me, const char *path, struct stat *buf)
  509. {
  510. int inode_index;
  511. char *file, *f;
  512. undelfs_get_path (path, &file, &f);
  513. if (!file)
  514. return 0;
  515. /* When called from save_cwd_stats we get an incorrect file and f here:
  516. e.g. incorrect correct
  517. path = "undel:/dev/sda1" path="undel:/dev/sda1/401:1"
  518. file = "/dev" file="/dev/sda1"
  519. f = "sda1" f ="401:1"
  520. If the first char in f is no digit -> return error */
  521. if (!isdigit (*f)) {
  522. g_free (file);
  523. g_free (f);
  524. return -1;
  525. }
  526. if (!ext2_fname || strcmp (ext2_fname, file)){
  527. message (D_ERROR, undelfserr, _(" You have to chdir to extract files first "));
  528. g_free (file);
  529. g_free (f);
  530. return 0;
  531. }
  532. inode_index = undelfs_getindex (f);
  533. g_free (file);
  534. g_free (f);
  535. if (inode_index == -1)
  536. return -1;
  537. return undelfs_stat_int (inode_index, buf);
  538. }
  539. #define undelfs_stat undelfs_lstat
  540. static int
  541. undelfs_fstat (void *vfs_info, struct stat *buf)
  542. {
  543. undelfs_file *p = vfs_info;
  544. return undelfs_stat_int (p->f_index, buf);
  545. }
  546. static int
  547. undelfs_chdir(struct vfs_class *me, const char *path)
  548. {
  549. char *file, *f;
  550. int fd;
  551. undelfs_get_path (path, &file, &f);
  552. if (!file)
  553. return -1;
  554. /* We may use access because ext2 file systems are local */
  555. /* this could be fixed by making an ext2fs io manager to use */
  556. /* our vfs, but that is left as an excercise for the reader */
  557. if ((fd = open (file, O_RDONLY)) == -1){
  558. message (D_ERROR, undelfserr, _(" Cannot open file %s "), file);
  559. g_free (f);
  560. g_free (file);
  561. return -1;
  562. }
  563. close (fd);
  564. g_free (f);
  565. g_free (file);
  566. return 0;
  567. }
  568. /* this has to stay here for now: vfs layer does not know how to emulate it */
  569. static off_t
  570. undelfs_lseek(void *vfs_info, off_t offset, int whence)
  571. {
  572. return -1;
  573. }
  574. static vfsid
  575. undelfs_getid (struct vfs_class *me, const char *path)
  576. {
  577. char *fname, *fsname;
  578. undelfs_get_path (path, &fsname, &fname);
  579. if (!fsname)
  580. return NULL;
  581. g_free (fname);
  582. g_free (fsname);
  583. return (vfsid) fs;
  584. }
  585. static int
  586. undelfs_nothingisopen(vfsid id)
  587. {
  588. return !undelfs_usage;
  589. }
  590. static void
  591. undelfs_free(vfsid id)
  592. {
  593. undelfs_shutdown ();
  594. }
  595. #ifdef ENABLE_NLS
  596. static int
  597. undelfs_init(struct vfs_class *me) {
  598. undelfserr = _(undelfserr);
  599. return 1;
  600. }
  601. #else
  602. #define undelfs_init NULL
  603. #endif
  604. void
  605. init_undelfs (void)
  606. {
  607. vfs_undelfs_ops.name = "undelfs";
  608. vfs_undelfs_ops.prefix = "undel:";
  609. vfs_undelfs_ops.init = undelfs_init;
  610. vfs_undelfs_ops.open = undelfs_open;
  611. vfs_undelfs_ops.close = undelfs_close;
  612. vfs_undelfs_ops.read = undelfs_read;
  613. vfs_undelfs_ops.opendir = undelfs_opendir;
  614. vfs_undelfs_ops.readdir = undelfs_readdir;
  615. vfs_undelfs_ops.closedir = undelfs_closedir;
  616. vfs_undelfs_ops.stat = undelfs_stat;
  617. vfs_undelfs_ops.lstat = undelfs_lstat;
  618. vfs_undelfs_ops.fstat = undelfs_fstat;
  619. vfs_undelfs_ops.chdir = undelfs_chdir;
  620. vfs_undelfs_ops.lseek = undelfs_lseek;
  621. vfs_undelfs_ops.getid = undelfs_getid;
  622. vfs_undelfs_ops.nothingisopen = undelfs_nothingisopen;
  623. vfs_undelfs_ops.free = undelfs_free;
  624. vfs_register_class (&vfs_undelfs_ops);
  625. }