Whamcloud - gitweb
- name var was used being uninitialized
[fs/lustre-release.git] / lustre / llite / dir.c
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  * Copyright (C) 1992, 1993, 1994, 1995
5  * Remy Card (card@masi.ibp.fr)
6  * Laboratoire MASI - Institut Blaise Pascal
7  * Universite Pierre et Marie Curie (Paris VI)
8  *
9  *  from
10  *
11  *  linux/fs/minix/dir.c
12  *  linux/fs/ext2/dir.c
13  *
14  *  Copyright (C) 1991, 1992  Linus Torvalds
15  *
16  *  ext2 directory handling functions
17  *
18  *  Big-endian to little-endian byte-swapping/bitmaps by
19  *        David S. Miller (davem@caip.rutgers.edu), 1995
20  *
21  *  All code that works with directory layout had been switched to pagecache
22  *  and moved here. AV
23  *
24  *  Adapted for Lustre Light
25  *  Copyright (C) 2002-2003, Cluster File Systems, Inc.
26  *
27  */
28
29 #include <linux/fs.h>
30 #include <linux/ext2_fs.h>
31 #include <linux/pagemap.h>
32 #include <linux/mm.h>
33 #include <linux/version.h>
34 #include <linux/smp_lock.h>
35 #include <asm/uaccess.h>
36 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
37 # include <linux/locks.h>   // for wait_on_buffer
38 #else
39 # include <linux/buffer_head.h>   // for wait_on_buffer
40 #endif
41
42 #define DEBUG_SUBSYSTEM S_LLITE
43
44 #include <linux/obd_support.h>
45 #include <linux/obd_class.h>
46 #include <linux/lustre_lib.h>
47 #include <linux/lustre_idl.h>
48 #include <linux/lustre_mds.h>
49 #include <linux/lustre_lite.h>
50 #include <linux/lustre_dlm.h>
51 #include "llite_internal.h"
52
53 typedef struct ext2_dir_entry_2 ext2_dirent;
54
55 #define PageChecked(page)        test_bit(PG_checked, &(page)->flags)
56 #define SetPageChecked(page)     set_bit(PG_checked, &(page)->flags)
57
58 /* returns the page unlocked, but with a reference */
59 static int ll_dir_readpage(struct file *file, struct page *page)
60 {
61         struct inode *inode = page->mapping->host;
62         struct ll_fid mdc_fid;
63         __u64 offset;
64         struct ptlrpc_request *request;
65         struct mds_body *body;
66         int rc = 0;
67         ENTRY;
68
69         CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p)\n", inode->i_ino,
70                inode->i_generation, inode);
71
72         mdc_pack_fid(&mdc_fid, inode->i_ino, inode->i_generation, S_IFDIR);
73         mdc_fid.mds = ll_i2info(inode)->lli_mds;
74         offset = page->index << PAGE_SHIFT;
75         rc = md_readpage(ll_i2sbi(inode)->ll_mdc_exp, &mdc_fid,
76                           offset, page, &request);
77         if (!rc) {
78                 body = lustre_msg_buf(request->rq_repmsg, 0, sizeof (*body));
79                 LASSERT (body != NULL); /* checked by md_readpage() */
80                 LASSERT_REPSWABBED (request, 0);/*swabbed by md_readpage()*/
81
82 #warning "FIXME ASAP!"
83                 //inode->i_size = body->size;
84                 SetPageUptodate(page);
85         }
86         ptlrpc_req_finished(request);
87
88         unlock_page(page);
89         EXIT;
90         return rc;
91 }
92
93 struct address_space_operations ll_dir_aops = {
94         readpage: ll_dir_readpage,
95 };
96
97 /*
98  * ext2 uses block-sized chunks. Arguably, sector-sized ones would be
99  * more robust, but we have what we have
100  */
101 static inline unsigned ext2_chunk_size(struct inode *inode)
102 {
103         return inode->i_sb->s_blocksize;
104 }
105
106 static inline void ext2_put_page(struct page *page)
107 {
108         kunmap(page);
109         page_cache_release(page);
110 }
111
112 static inline unsigned long dir_pages(struct inode *inode)
113 {
114         return (inode->i_size+PAGE_CACHE_SIZE-1)>>PAGE_CACHE_SHIFT;
115 }
116
117
118 static void ext2_check_page(struct page *page)
119 {
120         struct inode *dir = page->mapping->host;
121         unsigned chunk_size = ext2_chunk_size(dir);
122         char *kaddr = page_address(page);
123         //      u32 max_inumber = le32_to_cpu(sb->u.ext2_sb.s_es->s_inodes_count);
124         unsigned offs, rec_len;
125         unsigned limit = PAGE_CACHE_SIZE;
126         ext2_dirent *p;
127         char *error;
128
129         if ((dir->i_size >> PAGE_CACHE_SHIFT) == page->index) {
130                 limit = dir->i_size & ~PAGE_CACHE_MASK;
131                 if (limit & (chunk_size - 1)) {
132                         CERROR("limit %d dir size %lld index %ld\n",
133                                limit, dir->i_size, page->index);
134                         goto Ebadsize;
135                 }
136                 for (offs = limit; offs<PAGE_CACHE_SIZE; offs += chunk_size) {
137                         ext2_dirent *p = (ext2_dirent*)(kaddr + offs);
138                         p->rec_len = cpu_to_le16(chunk_size);
139                         p->name_len = 0;
140                         p->inode = 0;
141                 }
142                 if (!limit)
143                         goto out;
144         }
145         for (offs = 0; offs <= limit - EXT2_DIR_REC_LEN(1); offs += rec_len) {
146                 p = (ext2_dirent *)(kaddr + offs);
147                 rec_len = le16_to_cpu(p->rec_len);
148
149                 if (rec_len < EXT2_DIR_REC_LEN(1))
150                         goto Eshort;
151                 if (rec_len & 3)
152                         goto Ealign;
153                 if (rec_len < EXT2_DIR_REC_LEN(p->name_len))
154                         goto Enamelen;
155                 if (((offs + rec_len - 1) ^ offs) & ~(chunk_size-1))
156                         goto Espan;
157                 //              if (le32_to_cpu(p->inode) > max_inumber)
158                 //goto Einumber;
159         }
160         if (offs != limit)
161                 goto Eend;
162 out:
163         SetPageChecked(page);
164         return;
165
166         /* Too bad, we had an error */
167
168 Ebadsize:
169         CERROR("ext2_check_page"
170                 "size of directory #%lu is not a multiple of chunk size\n",
171                 dir->i_ino
172         );
173         goto fail;
174 Eshort:
175         error = "rec_len is smaller than minimal";
176         goto bad_entry;
177 Ealign:
178         error = "unaligned directory entry";
179         goto bad_entry;
180 Enamelen:
181         error = "rec_len is too small for name_len";
182         goto bad_entry;
183 Espan:
184         error = "directory entry across blocks";
185         goto bad_entry;
186         //Einumber:
187         // error = "inode out of bounds";
188 bad_entry:
189         CERROR("ext2_check_page: bad entry in directory #%lu: %s - "
190                 "offset=%lu+%u, inode=%lu, rec_len=%d, name_len=%d",
191                 dir->i_ino, error, (page->index<<PAGE_CACHE_SHIFT), offs,
192                 (unsigned long) le32_to_cpu(p->inode),
193                 rec_len, p->name_len);
194         goto fail;
195 Eend:
196         p = (ext2_dirent *)(kaddr + offs);
197         CERROR("ext2_check_page"
198                 "entry in directory #%lu spans the page boundary"
199                 "offset=%lu, inode=%lu",
200                 dir->i_ino, (page->index<<PAGE_CACHE_SHIFT)+offs,
201                 (unsigned long) le32_to_cpu(p->inode));
202 fail:
203         SetPageChecked(page);
204         SetPageError(page);
205         LBUG();
206 }
207
208 static struct page *ll_get_dir_page(struct inode *dir, unsigned long n)
209 {
210         struct ldlm_res_id res_id =
211                 { .name = { dir->i_ino, (__u64)dir->i_generation} };
212         struct lustre_handle lockh;
213         struct obd_device *obddev = class_exp2obd(ll_i2sbi(dir)->ll_mdc_exp);
214         struct address_space *mapping = dir->i_mapping;
215         struct page *page;
216         ldlm_policy_data_t policy = { .l_inodebits = { MDS_INODELOCK_UPDATE } };
217         int rc;
218
219         obddev = md_get_real_obd(ll_i2sbi(dir)->ll_mdc_exp, NULL, 0);
220         rc = ldlm_lock_match(obddev->obd_namespace, LDLM_FL_BLOCK_GRANTED,
221                              &res_id, LDLM_IBITS, &policy, LCK_PR, &lockh);
222         if (!rc) {
223                 struct lookup_intent it = { .it_op = IT_READDIR };
224                 struct ptlrpc_request *request;
225                 struct mdc_op_data data;
226
227                 ll_prepare_mdc_op_data(&data, dir, NULL, NULL, 0, 0);
228
229                 rc = md_enqueue(ll_i2sbi(dir)->ll_mdc_exp, LDLM_IBITS, &it,
230                                  LCK_PR, &data, &lockh, NULL, 0,
231                                  ldlm_completion_ast, ll_mdc_blocking_ast, dir);
232
233                 request = (struct ptlrpc_request *)it.d.lustre.it_data;
234                 if (request)
235                         ptlrpc_req_finished(request);
236                 if (rc < 0) {
237                         CERROR("lock enqueue: rc: %d\n", rc);
238                         return ERR_PTR(rc);
239                 }
240         }
241         ldlm_lock_dump_handle(D_OTHER, &lockh);
242
243         page = read_cache_page(mapping, n,
244                                (filler_t*)mapping->a_ops->readpage, NULL);
245         if (!IS_ERR(page)) {
246                 wait_on_page(page);
247                 (void)kmap(page);
248                 if (!PageUptodate(page))
249                         goto fail;
250                 if (!PageChecked(page))
251                         ext2_check_page(page);
252                 if (PageError(page))
253                         goto fail;
254         }
255
256 out_unlock:
257         ldlm_lock_decref(&lockh, LCK_PR);
258         return page;
259
260 fail:
261         ext2_put_page(page);
262         page = ERR_PTR(-EIO);
263         goto out_unlock;
264 }
265
266 /*
267  * p is at least 6 bytes before the end of page
268  */
269 static inline ext2_dirent *ext2_next_entry(ext2_dirent *p)
270 {
271         return (ext2_dirent *)((char*)p + le16_to_cpu(p->rec_len));
272 }
273
274 static inline unsigned
275 ext2_validate_entry(char *base, unsigned offset, unsigned mask)
276 {
277         ext2_dirent *de = (ext2_dirent*)(base + offset);
278         ext2_dirent *p = (ext2_dirent*)(base + (offset&mask));
279         while ((char*)p < (char*)de)
280                 p = ext2_next_entry(p);
281         return (char *)p - base;
282 }
283
284 static unsigned char ext2_filetype_table[EXT2_FT_MAX] = {
285         [EXT2_FT_UNKNOWN]       DT_UNKNOWN,
286         [EXT2_FT_REG_FILE]      DT_REG,
287         [EXT2_FT_DIR]           DT_DIR,
288         [EXT2_FT_CHRDEV]        DT_CHR,
289         [EXT2_FT_BLKDEV]        DT_BLK,
290         [EXT2_FT_FIFO]          DT_FIFO,
291         [EXT2_FT_SOCK]          DT_SOCK,
292         [EXT2_FT_SYMLINK]       DT_LNK,
293 };
294
295
296 int ll_readdir(struct file * filp, void * dirent, filldir_t filldir)
297 {
298         struct inode *inode = filp->f_dentry->d_inode;
299         loff_t pos = filp->f_pos;
300         // XXX struct super_block *sb = inode->i_sb;
301         unsigned offset = pos & ~PAGE_CACHE_MASK;
302         unsigned long n = pos >> PAGE_CACHE_SHIFT;
303         unsigned long npages = dir_pages(inode);
304         unsigned chunk_mask = ~(ext2_chunk_size(inode)-1);
305         unsigned char *types = NULL;
306         int need_revalidate = (filp->f_version != inode->i_version);
307         int rc = 0;
308         ENTRY;
309
310         CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p) pos %llu/%llu\n",
311                inode->i_ino, inode->i_generation, inode, pos, inode->i_size);
312
313         if (pos > inode->i_size - EXT2_DIR_REC_LEN(1))
314                 RETURN(0);
315
316         types = ext2_filetype_table;
317
318         for ( ; n < npages; n++, offset = 0) {
319                 char *kaddr, *limit;
320                 ext2_dirent *de;
321                 struct page *page;
322
323                 CDEBUG(D_EXT2,"read %lu of dir %lu/%u page %lu/%lu size %llu\n",
324                        PAGE_CACHE_SIZE, inode->i_ino, inode->i_generation,
325                        n, npages, inode->i_size);
326                 page = ll_get_dir_page(inode, n);
327
328                 /* size might have been updated by md_readpage */
329                 npages = dir_pages(inode);
330
331                 if (IS_ERR(page)) {
332                         rc = PTR_ERR(page);
333                         CERROR("error reading dir %lu/%u page %lu: rc %d\n",
334                                inode->i_ino, inode->i_generation, n, rc);
335                         continue;
336                 }
337
338                 kaddr = page_address(page);
339                 if (need_revalidate) {
340                         offset = ext2_validate_entry(kaddr, offset, chunk_mask);
341                         need_revalidate = 0;
342                 }
343                 de = (ext2_dirent *)(kaddr+offset);
344                 limit = kaddr + PAGE_CACHE_SIZE - EXT2_DIR_REC_LEN(1);
345                 for ( ;(char*)de <= limit; de = ext2_next_entry(de)) {
346                         if (de->inode) {
347                                 int over;
348                                 unsigned char d_type = DT_UNKNOWN;
349
350                                 rc = 0; /* no error if we return something */
351                                 if (types && de->file_type < EXT2_FT_MAX)
352                                         d_type = types[de->file_type];
353
354                                 offset = (char *)de - kaddr;
355                                 over = filldir(dirent, de->name, de->name_len,
356                                                (n<<PAGE_CACHE_SHIFT) | offset,
357                                                le32_to_cpu(de->inode), d_type);
358                                 if (over) {
359                                         ext2_put_page(page);
360                                         GOTO(done, rc);
361                                 }
362                         }
363                 }
364                 ext2_put_page(page);
365         }
366
367 done:
368         filp->f_pos = (n << PAGE_CACHE_SHIFT) | offset;
369         filp->f_version = inode->i_version;
370         update_atime(inode);
371         RETURN(rc);
372 }
373
374 static int ll_mkdir_stripe(struct inode *inode, unsigned long arg)
375 {
376         char *name;
377         struct ll_user_mkdir_stripe lums;
378         struct ptlrpc_request *request = NULL;
379         struct ll_sb_info *sbi = ll_i2sbi(inode);
380         struct mdc_op_data op_data;
381         u16 nstripes;
382         mode_t mode;
383         int err = 0;
384         ENTRY;
385
386         if (copy_from_user(&lums, (void *)arg, sizeof(lums)))
387                 RETURN(-EFAULT);
388
389         if (lums.lums_namelen <= 0)
390                 RETURN(-EINVAL);
391         OBD_ALLOC(name, lums.lums_namelen);
392         if (!name)
393                 RETURN(-ENOMEM);
394
395         if (copy_from_user(name, lums.lums_name, lums.lums_namelen))
396                 GOTO(out, err=-EFAULT);
397
398         CDEBUG(D_VFSTRACE, "ioctl Op:name=%s,dir=%lu/%u(%p)\n",
399                name, inode->i_ino, inode->i_generation, inode);
400         nstripes = lums.lums_nstripes;
401
402         mode = lums.lums_mode;
403         mode = (mode & (S_IRWXUGO|S_ISVTX) & ~current->fs->umask) | S_IFDIR;
404         ll_prepare_mdc_op_data(&op_data, inode, NULL, name,lums.lums_namelen,0);
405         err = md_create(sbi->ll_mdc_exp, &op_data, &nstripes, sizeof(nstripes),
406                         mode, current->fsuid, current->fsgid, 0, &request);
407         ptlrpc_req_finished(request);
408
409 out:
410         OBD_FREE(name, lums.lums_namelen);
411         RETURN(err);
412 }
413
414 static int ll_dir_ioctl(struct inode *inode, struct file *file,
415                         unsigned int cmd, unsigned long arg)
416 {
417         struct ll_sb_info *sbi = ll_i2sbi(inode);
418         struct obd_ioctl_data *data;
419         ENTRY;
420
421         CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p), cmd=%#x\n",
422                inode->i_ino, inode->i_generation, inode, cmd);
423
424         if (_IOC_TYPE(cmd) == 'T') /* tty ioctls */
425                 return -ENOTTY;
426
427         lprocfs_counter_incr(ll_i2sbi(inode)->ll_stats, LPROC_LL_IOCTL);
428         switch(cmd) {
429         case EXT3_IOC_GETFLAGS:
430         case EXT3_IOC_SETFLAGS:
431                 RETURN( ll_iocontrol(inode, file, cmd, arg) );
432         case IOC_MDC_LOOKUP: {
433                 struct ptlrpc_request *request = NULL;
434                 struct ll_fid fid;
435                 char *buf = NULL;
436                 char *filename;
437                 int namelen, rc, len = 0;
438                 unsigned long valid;
439
440                 rc = obd_ioctl_getdata(&buf, &len, (void *)arg);
441                 if (rc)
442                         RETURN(rc);
443                 data = (void *)buf;
444
445                 filename = data->ioc_inlbuf1;
446                 namelen = data->ioc_inllen1;
447
448                 if (namelen < 1) {
449                         CDEBUG(D_INFO, "IOC_MDC_LOOKUP missing filename\n");
450                         GOTO(out, rc = -EINVAL);
451                 }
452
453                 valid = OBD_MD_FLID;
454                 ll_inode2fid(&fid, inode);
455                 rc = md_getattr_name(sbi->ll_mdc_exp, &fid,
456                                           filename, namelen, valid,
457                                           0, &request);
458                 if (rc < 0) {
459                         CDEBUG(D_INFO, "md_getattr_name: %d\n", rc);
460                         GOTO(out, rc);
461                 }
462
463                 ptlrpc_req_finished(request);
464
465                 EXIT;
466         out:
467                 obd_ioctl_freedata(buf, len);
468                 return rc;
469         }
470         case LL_IOC_MDC_MKDIRSTRIPE:
471                 RETURN(ll_mkdir_stripe(inode, arg));
472         case LL_IOC_LOV_SETSTRIPE:
473         case LL_IOC_LOV_GETSTRIPE:
474                 RETURN(-ENOTTY);
475         case IOC_MDC_GETSTRIPE: {
476                 struct ptlrpc_request *request = NULL;
477                 struct ll_fid fid;
478                 struct mds_body *body;
479                 struct lov_user_md *lump = (struct lov_user_md *)arg;
480                 struct lov_mds_md *lmm;
481                 char *filename;
482                 int rc, lmmsize;
483
484                 filename = getname((const char *)arg);
485                 if (IS_ERR(filename))
486                         RETURN(PTR_ERR(filename));
487
488                 ll_inode2fid(&fid, inode);
489                 rc = md_getattr_name(sbi->ll_mdc_exp, &fid, filename,
490                                           strlen(filename)+1, OBD_MD_FLEASIZE,
491                                           obd_size_diskmd(sbi->ll_osc_exp, NULL),
492                                           &request);
493                 if (rc < 0) {
494                         CDEBUG(D_INFO,
495                                "md_getattr_name failed on %s: rc %d\n",
496                                filename, rc);
497                         GOTO(out_name, rc);
498                 }
499
500                 body = lustre_msg_buf(request->rq_repmsg, 0, sizeof (*body));
501                 LASSERT(body != NULL); /* checked by md_getattr_name */
502                 LASSERT_REPSWABBED(request, 0);/* swabbed by mdc_getattr_name */
503
504                 lmmsize = body->eadatasize;
505
506                 if (!(body->valid & OBD_MD_FLEASIZE) || lmmsize == 0)
507                         GOTO(out_req, rc = -ENODATA);
508
509                 if (lmmsize > 4096)
510                         GOTO(out_req, rc = -EFBIG);
511
512                 lmm = lustre_msg_buf(request->rq_repmsg, 1, lmmsize);
513                 LASSERT(lmm != NULL);
514                 LASSERT_REPSWABBED(request, 1);
515
516                 rc = copy_to_user(lump, lmm, lmmsize);
517                 if (rc)
518                         GOTO(out_req, rc = -EFAULT);
519
520                 EXIT;
521         out_req:
522                 ptlrpc_req_finished(request);
523         out_name:
524                 putname(filename);
525                 return rc;
526         }
527         case OBD_IOC_PING: {
528                 struct ptlrpc_request *req = NULL;
529                 char *buf = NULL;
530                 int rc, len=0;
531                 struct client_obd *cli;
532                 struct obd_device *obd;
533                                                                                                                              
534                 rc = obd_ioctl_getdata(&buf, &len, (void *)arg);
535                 if (rc)
536                         RETURN(rc);
537                 data = (void *)buf;
538
539                 obd = class_name2obd(data->ioc_inlbuf1);
540                                                                                                                              
541                 if (!obd )
542                         GOTO(out_ping, rc = -ENODEV);
543                                                                                                                              
544                 if (!obd->obd_attached) {
545                         CERROR("Device %d not attached\n", obd->obd_minor);
546                         GOTO(out_ping, rc = -ENODEV);
547                 }
548                 if (!obd->obd_set_up) {
549                         CERROR("Device %d still not setup\n", obd->obd_minor);
550                         GOTO(out_ping, rc = -ENODEV);
551                 }
552                 cli = &obd->u.cli;
553                 req = ptlrpc_prep_req(cli->cl_import, OBD_PING, 0, NULL, NULL);
554                 if (!req)
555                         GOTO(out_ping, rc = -ENOMEM);
556
557                 req->rq_replen = lustre_msg_size(0, NULL);
558                 req->rq_send_state = LUSTRE_IMP_FULL;
559
560                 rc = ptlrpc_queue_wait(req);
561
562                 ptlrpc_req_finished(req);                                                                                                 
563         out_ping:
564                 obd_ioctl_freedata(buf, len);
565                 return rc;
566         }
567         case OBD_IOC_LLOG_CATINFO: {
568                 struct ptlrpc_request *req = NULL;
569                 char *buf = NULL;
570                 int rc, len = 0;
571                 char *bufs[2], *str;
572                 int lens[2], size;
573                 
574                 rc = obd_ioctl_getdata(&buf, &len, (void *)arg);
575                 if (rc)
576                         RETURN(rc);
577                 data = (void *)buf;
578
579                 if (!data->ioc_inlbuf1) {
580                         obd_ioctl_freedata(buf, len);
581                         RETURN(-EINVAL);
582                 }
583                 
584                 lens[0] = data->ioc_inllen1;
585                 bufs[0] = data->ioc_inlbuf1;
586                 if (data->ioc_inllen2) {
587                         lens[1] = data->ioc_inllen2;
588                         bufs[1] = data->ioc_inlbuf2;
589                 } else {
590                         lens[1] = 0;
591                         bufs[1] = NULL;
592                 }
593                 size = data->ioc_plen1;
594                 req = ptlrpc_prep_req(sbi2mdc(sbi)->cl_import, LLOG_CATINFO, 
595                                       2, lens, bufs);
596                 if (!req)
597                         GOTO(out_catinfo, rc = -ENOMEM);
598                 req->rq_replen = lustre_msg_size(1, &size);
599                
600                 rc = ptlrpc_queue_wait(req);
601                 str = lustre_msg_string(req->rq_repmsg, 0, data->ioc_plen1);
602                 if (!rc)
603                         rc = copy_to_user(data->ioc_pbuf1, str, 
604                                           data->ioc_plen1);
605                 ptlrpc_req_finished(req);
606         out_catinfo:
607                 obd_ioctl_freedata(buf, len);
608                 RETURN(rc);
609         }                  
610         default:
611                 return obd_iocontrol(cmd, sbi->ll_osc_exp,0,NULL,(void *)arg);
612         }
613 }
614
615 int ll_dir_open(struct inode *inode, struct file *file)
616 {
617         return ll_file_open(inode, file);
618 }
619
620 int ll_dir_release(struct inode *inode, struct file *file)
621 {
622         return ll_file_release(inode, file);
623 }
624
625 struct file_operations ll_dir_operations = {
626         open: ll_dir_open,
627         release: ll_dir_release,
628         read: generic_read_dir,
629         readdir: ll_readdir,
630         ioctl: ll_dir_ioctl
631 };
632