Whamcloud - gitweb
Two fixed:
[fs/lustre-release.git] / lustre / llite / file.c
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *  linux/fs/ext2/file.c
5  *
6  * This code is issued under the GNU General Public License.
7  * See the file COPYING in this distribution
8  *
9  * Copyright (C) 1992, 1993, 1994, 1995
10  * Remy Card (card@masi.ibp.fr)
11  * Laboratoire MASI - Institut Blaise Pascal
12  * Universite Pierre et Marie Curie (Paris VI)
13  *
14  *  from
15  *
16  *  linux/fs/minix/file.c
17  *
18  *  Copyright (C) 1991, 1992  Linus Torvalds
19  *
20  *  ext2 fs regular file handling primitives
21  *
22  *  64-bit file support on 64-bit platforms by Jakub Jelinek
23  *      (jj@sunsite.ms.mff.cuni.cz)
24  */
25
26 #define DEBUG_SUBSYSTEM S_LLITE
27
28 #include <linux/lustre_dlm.h>
29 #include <linux/lustre_lite.h>
30 #include <linux/random.h>
31
32 int ll_inode_setattr(struct inode *inode, struct iattr *attr, int do_trunc);
33 extern int ll_setattr(struct dentry *de, struct iattr *attr);
34
35 static int ll_file_open(struct inode *inode, struct file *file)
36 {
37         struct ptlrpc_request *req = NULL;
38         struct ll_file_data *fd;
39         struct obdo *oa = NULL;
40         struct lov_stripe_md *lsm = NULL;
41         struct ll_sb_info *sbi = ll_i2sbi(inode);
42         struct ll_inode_info *lli = ll_i2info(inode);
43         int rc;
44         ENTRY;
45
46         LASSERT(!file->private_data);
47
48         CHECK_MOUNT_EPOCH(inode);
49
50         lsm = lli->lli_smd;
51
52         /*  delayed create of object (intent created inode) */
53         /*  XXX object needs to be cleaned up if mdc_open fails */
54         /*  XXX error handling appropriate here? */
55         if (lsm == NULL) {
56                 struct inode *inode = file->f_dentry->d_inode;
57
58                 down(&lli->lli_open_sem);
59                 /* Check to see if we lost the race */
60                 if (lli->lli_smd == NULL) {
61                         oa = obdo_alloc();
62                         if (!oa) {
63                                 up(&lli->lli_open_sem);
64                                 RETURN(-ENOMEM);
65                         }
66                         oa->o_mode = S_IFREG | 0600;
67                         oa->o_easize = ll_mds_easize(inode->i_sb);
68                         oa->o_id = inode->i_ino;
69                         oa->o_valid = OBD_MD_FLID | OBD_MD_FLTYPE |
70                                 OBD_MD_FLMODE | OBD_MD_FLEASIZE;
71                         rc = obd_create(ll_i2obdconn(inode), oa, &lli->lli_smd);
72
73                         if (rc) {
74                                 obdo_free(oa);
75                                 up(&lli->lli_open_sem);
76                                 RETURN(rc);
77                         }
78                 }
79                 if (lli->lli_smd->lsm_object_id == 0)
80                         LBUG();
81                 up(&lli->lli_open_sem);
82                 lsm = lli->lli_smd;
83         }
84
85         fd = kmem_cache_alloc(ll_file_data_slab, SLAB_KERNEL);
86         if (!fd)
87                 GOTO(out, rc = -ENOMEM);
88         memset(fd, 0, sizeof(*fd));
89
90         fd->fd_mdshandle.addr = (__u64)(unsigned long)file;
91         get_random_bytes(&fd->fd_mdshandle.cookie,
92                          sizeof(fd->fd_mdshandle.cookie));
93         rc = mdc_open(&sbi->ll_mdc_conn, inode->i_ino, S_IFREG | inode->i_mode,
94                       file->f_flags, lsm, &fd->fd_mdshandle, &req);
95         fd->fd_req = req;
96         ptlrpc_req_finished(req);
97         if (rc)
98                 GOTO(out_req, -abs(rc));
99         if (!fd->fd_mdshandle.addr ||
100             fd->fd_mdshandle.addr == (__u64)(unsigned long)file) {
101                 CERROR("hmm, mdc_open didn't assign fd_mdshandle?\n");
102                 /* XXX handle this how, abort or is it non-fatal? */
103         }
104
105         if (!oa)
106                 oa = obdo_alloc();
107         if (!oa)
108                 GOTO(out_mdc, rc = -EINVAL);
109
110         oa->o_id = lsm->lsm_object_id;
111         oa->o_mode = S_IFREG;
112         oa->o_valid = OBD_MD_FLID | OBD_MD_FLTYPE | OBD_MD_FLSIZE;
113         rc = obd_open(ll_i2obdconn(inode), oa, lsm);
114         obd_oa2handle(&fd->fd_osthandle, oa);
115
116         if (rc)
117                 GOTO(out_mdc, rc = -abs(rc));
118
119         obdo_free(oa);
120
121         file->private_data = fd;
122
123         EXIT;
124
125         return 0;
126 out_mdc:
127         mdc_close(&sbi->ll_mdc_conn, inode->i_ino,
128                   S_IFREG, &fd->fd_mdshandle, &req);
129 out_req:
130         ptlrpc_free_req(req);
131 //out_fd:
132         obdo_free(oa);
133         kmem_cache_free(ll_file_data_slab, fd);
134         file->private_data = NULL;
135 out:
136         return rc;
137 }
138
139 int ll_size_lock(struct inode *inode, struct lov_stripe_md *lsm, __u64 start,
140                  int mode, struct lustre_handle **lockhs_p)
141 {
142         struct ll_sb_info *sbi = ll_i2sbi(inode);
143         struct ldlm_extent extent;
144         struct lustre_handle *lockhs = NULL;
145         int rc, flags = 0, stripe_count;
146         ENTRY;
147
148         if (sbi->ll_flags & LL_SBI_NOLCK) {
149                 *lockhs_p = NULL;
150                 RETURN(0);
151         }
152
153         stripe_count = lsm->lsm_stripe_count;
154         if (!stripe_count)
155                 stripe_count = 1;
156
157         OBD_ALLOC(lockhs, stripe_count * sizeof(*lockhs));
158         if (lockhs == NULL)
159                 RETURN(-ENOMEM);
160
161         extent.start = start;
162         extent.end = ~0;
163
164         rc = obd_enqueue(&sbi->ll_osc_conn, lsm, NULL, LDLM_EXTENT, &extent,
165                          sizeof(extent), mode, &flags, ll_lock_callback,
166                          inode, sizeof(*inode), lockhs);
167         if (rc != ELDLM_OK) {
168                 CERROR("lock enqueue: %d\n", rc);
169                 OBD_FREE(lockhs, stripe_count * sizeof(*lockhs));
170         } else
171                 *lockhs_p = lockhs;
172         RETURN(rc);
173 }
174
175 int ll_size_unlock(struct inode *inode, struct lov_stripe_md *lsm, int mode,
176                    struct lustre_handle *lockhs)
177 {
178         struct ll_sb_info *sbi = ll_i2sbi(inode);
179         int rc, stripe_count;
180         ENTRY;
181
182         if (sbi->ll_flags & LL_SBI_NOLCK)
183                 RETURN(0);
184
185         if (lockhs == NULL) {
186                 LBUG();
187                 RETURN(-EINVAL);
188         }
189
190         rc = obd_cancel(&sbi->ll_osc_conn, lsm, mode, lockhs);
191         if (rc != ELDLM_OK) {
192                 CERROR("lock cancel: %d\n", rc);
193                 LBUG();
194         }
195
196         stripe_count = lsm->lsm_stripe_count;
197         if (!stripe_count)
198                 stripe_count = 1;
199
200         OBD_FREE(lockhs, stripe_count * sizeof(*lockhs));
201         RETURN(rc);
202 }
203
204 int ll_file_size(struct inode *inode, struct lov_stripe_md *lsm)
205 {
206         struct ll_sb_info *sbi = ll_i2sbi(inode);
207         struct lustre_handle *lockhs;
208         struct obdo oa;
209         int err, rc;
210         ENTRY;
211
212         LASSERT(lsm);
213         LASSERT(sbi);
214
215         rc = ll_size_lock(inode, lsm, 0, LCK_PR, &lockhs);
216         if (rc != ELDLM_OK) {
217                 CERROR("lock enqueue: %d\n", rc);
218                 RETURN(rc);
219         }
220
221         oa.o_id = lsm->lsm_object_id;
222         oa.o_mode = S_IFREG;
223         oa.o_valid = OBD_MD_FLID|OBD_MD_FLTYPE|OBD_MD_FLSIZE|OBD_MD_FLBLOCKS;
224         rc = obd_getattr(&sbi->ll_osc_conn, &oa, lsm);
225         if (!rc)
226                 obdo_to_inode(inode, &oa,
227                               oa.o_valid & ~(OBD_MD_FLTYPE | OBD_MD_FLMODE));
228
229         err = ll_size_unlock(inode, lsm, LCK_PR, lockhs);
230         if (err != ELDLM_OK) {
231                 CERROR("lock cancel: %d\n", err);
232                 LBUG();
233         }
234         RETURN(rc);
235 }
236
237 static int ll_file_release(struct inode *inode, struct file *file)
238 {
239         int rc;
240         struct ptlrpc_request *req = NULL;
241         struct ll_file_data *fd;
242         struct obdo oa;
243         struct ll_sb_info *sbi = ll_i2sbi(inode);
244         struct ll_inode_info *lli = ll_i2info(inode);
245
246         ENTRY;
247
248         CHECK_MOUNT_EPOCH(inode);
249
250         fd = (struct ll_file_data *)file->private_data;
251         if (!fd) {
252                 LBUG();
253                 GOTO(out, rc = -EINVAL);
254         }
255
256         memset(&oa, 0, sizeof(oa));
257         oa.o_id = lli->lli_smd->lsm_object_id;
258         oa.o_mode = S_IFREG;
259         oa.o_valid = OBD_MD_FLTYPE | OBD_MD_FLID;
260         obd_handle2oa(&oa, &fd->fd_osthandle);
261         rc = obd_close(ll_i2obdconn(inode), &oa, lli->lli_smd);
262         if (rc)
263                 GOTO(out_fd, abs(rc));
264
265         /* If this fails and we goto out_fd, the file size on the MDS is out of
266          * date.  Is that a big deal? */
267         if (file->f_mode & FMODE_WRITE) {
268                 struct lustre_handle *lockhs;
269
270                 rc = ll_size_lock(inode, lli->lli_smd, 0, LCK_PR, &lockhs);
271                 if (rc)
272                         GOTO(out_fd, abs(rc));
273
274                 oa.o_id = lli->lli_smd->lsm_object_id;
275                 oa.o_mode = S_IFREG;
276                 oa.o_valid = OBD_MD_FLID | OBD_MD_FLTYPE | OBD_MD_FLSIZE |
277                         OBD_MD_FLBLOCKS;
278                 rc = obd_getattr(&sbi->ll_osc_conn, &oa, lli->lli_smd);
279                 if (!rc) {
280                         struct iattr attr;
281                         attr.ia_valid = (ATTR_MTIME | ATTR_CTIME | ATTR_ATIME |
282                                          ATTR_SIZE);
283                         attr.ia_mtime = inode->i_mtime;
284                         attr.ia_ctime = inode->i_ctime;
285                         attr.ia_atime = inode->i_atime;
286                         attr.ia_size = oa.o_size;
287
288                         inode->i_blocks = oa.o_blocks;
289
290                         /* XXX: this introduces a small race that we should
291                          * evaluate */
292                         rc = ll_inode_setattr(inode, &attr, 0);
293                         if (rc) {
294                                 CERROR("failed - %d.\n", rc);
295                                 rc = -EIO; /* XXX - GOTO(out)? -phil */
296                         }
297                 }
298                 rc = ll_size_unlock(inode, lli->lli_smd, LCK_PR, lockhs);
299                 if (rc) {
300                         CERROR("lock cancel: %d\n", rc);
301                         LBUG();
302                 }
303         }
304
305         rc = mdc_close(&sbi->ll_mdc_conn, inode->i_ino,
306                        S_IFREG, &fd->fd_mdshandle, &req);
307         ptlrpc_req_finished(req);
308         if (rc) {
309                 if (rc > 0)
310                         rc = -rc;
311                 GOTO(out, rc);
312         }
313         ptlrpc_req_finished(fd->fd_req);
314
315         rc = obd_cancel_unused(ll_i2obdconn(inode), lli->lli_smd, 0);
316         if (rc)
317                 CERROR("obd_cancel_unused: %d\n", rc);
318
319         EXIT;
320
321 out_fd:
322         kmem_cache_free(ll_file_data_slab, fd);
323         file->private_data = NULL;
324 out:
325         return rc;
326 }
327
328
329 static inline void ll_remove_suid(struct inode *inode)
330 {
331         unsigned int mode;
332
333         /* set S_IGID if S_IXGRP is set, and always set S_ISUID */
334         mode = (inode->i_mode & S_IXGRP)*(S_ISGID/S_IXGRP) | S_ISUID;
335
336         /* was any of the uid bits set? */
337         mode &= inode->i_mode;
338         if (mode && !capable(CAP_FSETID)) {
339                 inode->i_mode &= ~mode;
340                 // XXX careful here - we cannot change the size
341         }
342 }
343
344 static void ll_update_atime(struct inode *inode)
345 {
346         struct iattr attr;
347
348         attr.ia_atime = CURRENT_TIME;
349         attr.ia_valid = ATTR_ATIME;
350
351         if (inode->i_atime == attr.ia_atime) return;
352         if (IS_RDONLY(inode)) return;
353         if (IS_NOATIME(inode)) return;
354
355         /* ll_inode_setattr() sets inode->i_atime from attr.ia_atime */
356         ll_inode_setattr(inode, &attr, 0);
357 }
358
359 int ll_lock_callback(struct ldlm_lock *lock, struct ldlm_lock_desc *new,
360                      void *data, __u32 data_len, int flag)
361 {
362         struct inode *inode = data;
363         struct lustre_handle lockh;
364         int rc;
365         ENTRY;
366
367         if (data_len != sizeof(struct inode))
368                 LBUG();
369
370         if (inode == NULL)
371                 LBUG();
372
373         switch (flag) {
374         case LDLM_CB_BLOCKING:
375                 ldlm_lock2handle(lock, &lockh);
376                 rc = ldlm_cli_cancel(&lockh);
377                 if (rc != ELDLM_OK)
378                         CERROR("ldlm_cli_cancel failed: %d\n", rc);
379                 break;
380         case LDLM_CB_CANCELING:
381                 CDEBUG(D_INODE, "invalidating obdo/inode %ld\n", inode->i_ino);
382                 /* FIXME: do something better than throwing away everything */
383                 //down(&inode->i_sem);
384                 invalidate_inode_pages(inode);
385                 //up(&inode->i_sem);
386                 break;
387         default:
388                 LBUG();
389         }
390
391         RETURN(0);
392 }
393
394 static ssize_t ll_file_read(struct file *filp, char *buf, size_t count,
395                             loff_t *ppos)
396 {
397         struct ll_file_data *fd = (struct ll_file_data *)filp->private_data;
398         struct inode *inode = filp->f_dentry->d_inode;
399         struct ll_sb_info *sbi = ll_i2sbi(inode);
400         struct ldlm_extent extent;
401         struct lustre_handle *lockhs = NULL;
402         struct lov_stripe_md *lsm = ll_i2info(inode)->lli_smd;
403         int flags = 0;
404         ldlm_error_t err;
405         ssize_t retval;
406         ENTRY;
407
408         if (!(fd->fd_flags & LL_FILE_IGNORE_LOCK) ||
409             sbi->ll_flags & LL_SBI_NOLCK) {
410                 OBD_ALLOC(lockhs, lsm->lsm_stripe_count * sizeof(*lockhs));
411                 if (!lockhs)
412                         RETURN(-ENOMEM);
413
414                 extent.start = *ppos;
415                 extent.end = *ppos + count;
416                 CDEBUG(D_INFO, "Locking inode %ld, start "LPU64" end "LPU64"\n",
417                        inode->i_ino, extent.start, extent.end);
418
419                 err = obd_enqueue(&sbi->ll_osc_conn, lsm, NULL, LDLM_EXTENT,
420                                   &extent, sizeof(extent), LCK_PR, &flags,
421                                   ll_lock_callback, inode, sizeof(*inode),
422                                   lockhs);
423                 if (err != ELDLM_OK) {
424                         OBD_FREE(lockhs, lsm->lsm_stripe_count*sizeof(*lockhs));
425                         CERROR("lock enqueue: err: %d\n", err);
426                         RETURN(err);
427                 }
428         }
429
430         CDEBUG(D_INFO, "Reading inode %ld, %d bytes, offset %Ld\n",
431                inode->i_ino, count, *ppos);
432         retval = generic_file_read(filp, buf, count, ppos);
433
434         if (retval > 0)
435                 ll_update_atime(inode);
436
437         if (!(fd->fd_flags & LL_FILE_IGNORE_LOCK) ||
438             sbi->ll_flags & LL_SBI_NOLCK) {
439                 err = obd_cancel(&sbi->ll_osc_conn, lsm, LCK_PR, lockhs);
440                 if (err != ELDLM_OK) {
441                         CERROR("lock cancel: err: %d\n", err);
442                         retval = err;
443                 }
444         }
445
446         if (lockhs)
447                 OBD_FREE(lockhs, lsm->lsm_stripe_count * sizeof(*lockhs));
448         RETURN(retval);
449 }
450
451 /*
452  * Write to a file (through the page cache).
453  */
454 static ssize_t
455 ll_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
456 {
457         struct ll_file_data *fd = (struct ll_file_data *)file->private_data;
458         struct inode *inode = file->f_dentry->d_inode;
459         struct ll_sb_info *sbi = ll_i2sbi(inode);
460         struct ldlm_extent extent;
461         struct lustre_handle *lockhs = NULL, *eof_lockhs = NULL;
462         struct lov_stripe_md *lsm = ll_i2info(inode)->lli_smd;
463         int flags = 0;
464         ldlm_error_t err;
465         ssize_t retval;
466         ENTRY;
467
468         if (!S_ISBLK(inode->i_mode) && file->f_flags & O_APPEND) {
469                 struct obdo *oa;
470
471                 oa = obdo_alloc();
472                 if (!oa)
473                         RETURN(-ENOMEM);
474
475                 err = ll_size_lock(inode, lsm, 0, LCK_PW, &eof_lockhs);
476                 if (err) {
477                         obdo_free(oa);
478                         RETURN(err);
479                 }
480
481                 oa->o_id = lsm->lsm_object_id;
482                 oa->o_mode = inode->i_mode;
483                 oa->o_valid = OBD_MD_FLID | OBD_MD_FLTYPE | OBD_MD_FLSIZE |
484                         OBD_MD_FLBLOCKS;
485                 obd_handle2oa(oa, &fd->fd_osthandle);
486                 retval = obd_getattr(&sbi->ll_osc_conn, oa, lsm);
487                 if (retval) {
488                         obdo_free(oa);
489                         GOTO(out_eof, retval);
490                 }
491
492                 *ppos = oa->o_size;
493                 obdo_to_inode(inode, oa, oa->o_valid);
494                 obdo_free(oa);
495         }
496
497         if (!(fd->fd_flags & LL_FILE_IGNORE_LOCK) ||
498             sbi->ll_flags & LL_SBI_NOLCK) {
499                 OBD_ALLOC(lockhs, lsm->lsm_stripe_count * sizeof(*lockhs));
500                 if (!lockhs)
501                         GOTO(out_eof, retval = -ENOMEM);
502                 extent.start = *ppos;
503                 extent.end = *ppos + count;
504                 CDEBUG(D_INFO, "Locking inode %ld, start "LPU64" end "LPU64"\n",
505                        inode->i_ino, extent.start, extent.end);
506
507                 err = obd_enqueue(&sbi->ll_osc_conn, lsm, NULL, LDLM_EXTENT,
508                                   &extent, sizeof(extent), LCK_PW, &flags,
509                                   ll_lock_callback, inode, sizeof(*inode),
510                                   lockhs);
511                 if (err != ELDLM_OK) {
512                         CERROR("lock enqueue: err: %d\n", err);
513                         GOTO(out_free, retval = err);
514                 }
515         }
516
517         CDEBUG(D_INFO, "Writing inode %ld, %ld bytes, offset "LPD64"\n",
518                inode->i_ino, (long)count, *ppos);
519
520         retval = generic_file_write(file, buf, count, ppos);
521
522         if (!(fd->fd_flags & LL_FILE_IGNORE_LOCK) ||
523             sbi->ll_flags & LL_SBI_NOLCK) {
524                 err = obd_cancel(&sbi->ll_osc_conn, lsm, LCK_PW, lockhs);
525                 if (err != ELDLM_OK) {
526                         CERROR("lock cancel: err: %d\n", err);
527                         GOTO(out_free, retval = err);
528                 }
529         }
530
531         EXIT;
532  out_free:
533         if (lockhs)
534                 OBD_FREE(lockhs, lsm->lsm_stripe_count * sizeof(*lockhs));
535
536  out_eof:
537         if (!S_ISBLK(inode->i_mode) && file->f_flags & O_APPEND) {
538                 err = ll_size_unlock(inode, lsm, LCK_PW, eof_lockhs);
539                 if (err && !retval)
540                         retval = err;
541         }
542
543         return retval;
544 }
545
546 int ll_file_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
547                   unsigned long arg)
548 {
549         struct ll_file_data *fd = (struct ll_file_data *)file->private_data;
550         int flags;
551
552         switch(cmd) {
553         case LL_IOC_GETFLAGS:
554                 /* Get the current value of the file flags */
555                 return put_user(fd->fd_flags, (int *)arg);
556         case LL_IOC_SETFLAGS:
557         case LL_IOC_CLRFLAGS:
558                 /* Set or clear specific file flags */
559                 /* XXX This probably needs checks to ensure the flags are
560                  *     not abused, and to handle any flag side effects.
561                  */
562                 if (get_user(flags, (int *) arg))
563                         return -EFAULT;
564
565                 if (cmd == LL_IOC_SETFLAGS)
566                         fd->fd_flags |= flags;
567                 else
568                         fd->fd_flags &= ~flags;
569                 return 0;
570
571         /* We need to special case any other ioctls we want to handle,
572          * to send them to the MDS/OST as appropriate and to properly
573          * network encode the arg field.
574         case EXT2_IOC_GETFLAGS:
575         case EXT2_IOC_SETFLAGS:
576         case EXT2_IOC_GETVERSION_OLD:
577         case EXT2_IOC_GETVERSION_NEW:
578         case EXT2_IOC_SETVERSION_OLD:
579         case EXT2_IOC_SETVERSION_NEW:
580         */
581         default:
582                 return -ENOTTY;
583         }
584 }
585
586 loff_t ll_file_seek(struct file *file, loff_t offset, int origin)
587 {
588         struct inode *inode = file->f_dentry->d_inode;
589         long long retval;
590         ENTRY;
591
592         CHECK_MOUNT_EPOCH(inode);
593
594         switch (origin) {
595         case 2: {
596                 struct ll_inode_info *lli = ll_i2info(inode);
597
598                 retval = ll_file_size(inode, lli->lli_smd);
599                 if (retval)
600                         RETURN(retval);
601
602                 offset += inode->i_size;
603                 break;
604         }
605         case 1:
606                 offset += file->f_pos;
607         }
608         retval = -EINVAL;
609         if (offset >= 0 && offset <= inode->i_sb->s_maxbytes) {
610                 if (offset != file->f_pos) {
611                         file->f_pos = offset;
612                         file->f_reada = 0;
613                         file->f_version = ++event;
614                 }
615                 retval = offset;
616         }
617         RETURN(retval);
618 }
619
620 /* XXX this does not need to do anything for data, it _does_ need to
621    call setattr */
622 int ll_fsync(struct file *file, struct dentry *dentry, int data)
623 {
624         return 0;
625 }
626
627 static int ll_inode_revalidate(struct dentry *dentry)
628 {
629         struct inode *inode = dentry->d_inode;
630         ENTRY;
631
632         if (!inode)
633                 RETURN(0);
634
635         RETURN(ll_file_size(inode, ll_i2info(inode)->lli_smd));
636 }
637
638 struct file_operations ll_file_operations = {
639         read:           ll_file_read,
640         write:          ll_file_write,
641         ioctl:          ll_file_ioctl,
642         open:           ll_file_open,
643         release:        ll_file_release,
644         mmap:           generic_file_mmap,
645         llseek:         ll_file_seek,
646         fsync:          NULL
647 };
648
649 struct inode_operations ll_file_inode_operations = {
650         truncate:   ll_truncate,
651         setattr:    ll_setattr,
652         revalidate: ll_inode_revalidate
653 };