undelfs.c 18 KB

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