VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / fs / xfs / linux-2.6 / xfs_iops.c
1 /*
2  * Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of version 2 of the GNU General Public License as
6  * published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it would be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  *
12  * Further, this software is distributed without any warranty that it is
13  * free of the rightful claim of any third person regarding infringement
14  * or the like.  Any license provided herein, whether implied or
15  * otherwise, applies only to this software file.  Patent licenses, if
16  * any, provided herein do not apply to combinations of this program with
17  * other software, or any other product whatsoever.
18  *
19  * You should have received a copy of the GNU General Public License along
20  * with this program; if not, write the Free Software Foundation, Inc., 59
21  * Temple Place - Suite 330, Boston MA 02111-1307, USA.
22  *
23  * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24  * Mountain View, CA  94043, or:
25  *
26  * http://www.sgi.com
27  *
28  * For further information regarding this notice, see:
29  *
30  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
31  */
32
33 #include "xfs.h"
34 #include "xfs_fs.h"
35 #include "xfs_inum.h"
36 #include "xfs_log.h"
37 #include "xfs_trans.h"
38 #include "xfs_sb.h"
39 #include "xfs_ag.h"
40 #include "xfs_dir.h"
41 #include "xfs_dir2.h"
42 #include "xfs_alloc.h"
43 #include "xfs_dmapi.h"
44 #include "xfs_quota.h"
45 #include "xfs_mount.h"
46 #include "xfs_alloc_btree.h"
47 #include "xfs_bmap_btree.h"
48 #include "xfs_ialloc_btree.h"
49 #include "xfs_btree.h"
50 #include "xfs_ialloc.h"
51 #include "xfs_attr_sf.h"
52 #include "xfs_dir_sf.h"
53 #include "xfs_dir2_sf.h"
54 #include "xfs_dinode.h"
55 #include "xfs_inode.h"
56 #include "xfs_bmap.h"
57 #include "xfs_bit.h"
58 #include "xfs_rtalloc.h"
59 #include "xfs_error.h"
60 #include "xfs_itable.h"
61 #include "xfs_rw.h"
62 #include "xfs_acl.h"
63 #include "xfs_cap.h"
64 #include "xfs_mac.h"
65 #include "xfs_attr.h"
66 #include "xfs_buf_item.h"
67 #include "xfs_utils.h"
68
69 #include <linux/xattr.h>
70 #include <linux/namei.h>
71
72
73 /*
74  * Pull the link count and size up from the xfs inode to the linux inode
75  */
76 STATIC void
77 validate_fields(
78         struct inode    *ip)
79 {
80         vnode_t         *vp = LINVFS_GET_VP(ip);
81         vattr_t         va;
82         int             error;
83
84         va.va_mask = XFS_AT_NLINK|XFS_AT_SIZE|XFS_AT_NBLOCKS;
85         VOP_GETATTR(vp, &va, ATTR_LAZY, NULL, error);
86         if (likely(!error)) {
87                 ip->i_nlink = va.va_nlink;
88                 ip->i_blocks = va.va_nblocks;
89
90                 /* we're under i_sem so i_size can't change under us */
91                 if (i_size_read(ip) != va.va_size)
92                         i_size_write(ip, va.va_size);
93         }
94 }
95
96 /*
97  * Determine whether a process has a valid fs_struct (kernel daemons
98  * like knfsd don't have an fs_struct).
99  *
100  * XXX(hch):  nfsd is broken, better fix it instead.
101  */
102 STATIC inline int
103 has_fs_struct(struct task_struct *task)
104 {
105         return (task->fs != init_task.fs);
106 }
107
108 STATIC int
109 linvfs_mknod(
110         struct inode    *dir,
111         struct dentry   *dentry,
112         int             mode,
113         dev_t           rdev)
114 {
115         struct inode    *ip;
116         vattr_t         va;
117         vnode_t         *vp = NULL, *dvp = LINVFS_GET_VP(dir);
118         xfs_acl_t       *default_acl = NULL;
119         attrexists_t    test_default_acl = _ACL_DEFAULT_EXISTS;
120         int             error;
121
122         /*
123          * Irix uses Missed'em'V split, but doesn't want to see
124          * the upper 5 bits of (14bit) major.
125          */
126         if (!sysv_valid_dev(rdev) || MAJOR(rdev) & ~0x1ff)
127                 return -EINVAL;
128
129         if (test_default_acl && test_default_acl(dvp)) {
130                 if (!_ACL_ALLOC(default_acl))
131                         return -ENOMEM;
132                 if (!_ACL_GET_DEFAULT(dvp, default_acl)) {
133                         _ACL_FREE(default_acl);
134                         default_acl = NULL;
135                 }
136         }
137
138         if (IS_POSIXACL(dir) && !default_acl && has_fs_struct(current))
139                 mode &= ~current->fs->umask;
140
141         memset(&va, 0, sizeof(va));
142         va.va_mask = XFS_AT_TYPE|XFS_AT_MODE;
143         va.va_type = IFTOVT(mode);
144         va.va_mode = mode;
145
146         switch (mode & S_IFMT) {
147         case S_IFCHR: case S_IFBLK: case S_IFIFO: case S_IFSOCK:
148                 va.va_rdev = sysv_encode_dev(rdev);
149                 va.va_mask |= XFS_AT_RDEV;
150                 /*FALLTHROUGH*/
151         case S_IFREG:
152                 VOP_CREATE(dvp, dentry, &va, &vp, NULL, error);
153                 break;
154         case S_IFDIR:
155                 VOP_MKDIR(dvp, dentry, &va, &vp, NULL, error);
156                 break;
157         default:
158                 error = EINVAL;
159                 break;
160         }
161
162         if (default_acl) {
163                 if (!error) {
164                         error = _ACL_INHERIT(vp, &va, default_acl);
165                         if (!error) {
166                                 VMODIFY(vp);
167                         } else {
168                                 struct dentry   teardown = {};
169                                 int             err2;
170
171                                 /* Oh, the horror.
172                                  * If we can't add the ACL we must back out.
173                                  * ENOSPC can hit here, among other things.
174                                  */
175                                 teardown.d_inode = ip = LINVFS_GET_IP(vp);
176                                 teardown.d_name = dentry->d_name;
177                                 remove_inode_hash(ip);
178                                 make_bad_inode(ip);
179                                 if (S_ISDIR(mode))
180                                         VOP_RMDIR(dvp, &teardown, NULL, err2);
181                                 else
182                                         VOP_REMOVE(dvp, &teardown, NULL, err2);
183                                 VN_RELE(vp);
184                         }
185                 }
186                 _ACL_FREE(default_acl);
187         }
188
189         if (!error) {
190                 ASSERT(vp);
191                 ip = LINVFS_GET_IP(vp);
192
193                 if (S_ISCHR(mode) || S_ISBLK(mode))
194                         ip->i_rdev = rdev;
195                 else if (S_ISDIR(mode))
196                         validate_fields(ip);
197                 d_instantiate(dentry, ip);
198                 validate_fields(dir);
199         }
200         return -error;
201 }
202
203 STATIC int
204 linvfs_create(
205         struct inode    *dir,
206         struct dentry   *dentry,
207         int             mode,
208         struct nameidata *nd)
209 {
210         return linvfs_mknod(dir, dentry, mode, 0);
211 }
212
213 STATIC int
214 linvfs_mkdir(
215         struct inode    *dir,
216         struct dentry   *dentry,
217         int             mode)
218 {
219         return linvfs_mknod(dir, dentry, mode|S_IFDIR, 0);
220 }
221
222 STATIC struct dentry *
223 linvfs_lookup(
224         struct inode    *dir,
225         struct dentry   *dentry,
226         struct nameidata *nd)
227 {
228         struct inode    *ip = NULL;
229         vnode_t         *vp, *cvp = NULL;
230         int             error;
231
232         if (dentry->d_name.len >= MAXNAMELEN)
233                 return ERR_PTR(-ENAMETOOLONG);
234
235         vp = LINVFS_GET_VP(dir);
236         VOP_LOOKUP(vp, dentry, &cvp, 0, NULL, NULL, error);
237         if (!error) {
238                 ASSERT(cvp);
239                 ip = LINVFS_GET_IP(cvp);
240                 if (!ip) {
241                         VN_RELE(cvp);
242                         return ERR_PTR(-EACCES);
243                 }
244         }
245         if (error && (error != ENOENT))
246                 return ERR_PTR(-error);
247         return d_splice_alias(ip, dentry);
248 }
249
250 STATIC int
251 linvfs_link(
252         struct dentry   *old_dentry,
253         struct inode    *dir,
254         struct dentry   *dentry)
255 {
256         struct inode    *ip;    /* inode of guy being linked to */
257         vnode_t         *tdvp;  /* target directory for new name/link */
258         vnode_t         *vp;    /* vp of name being linked */
259         int             error;
260
261         ip = old_dentry->d_inode;       /* inode being linked to */
262         if (S_ISDIR(ip->i_mode))
263                 return -EPERM;
264
265         tdvp = LINVFS_GET_VP(dir);
266         vp = LINVFS_GET_VP(ip);
267
268         VOP_LINK(tdvp, vp, dentry, NULL, error);
269         if (!error) {
270                 VMODIFY(tdvp);
271                 VN_HOLD(vp);
272                 validate_fields(ip);
273                 d_instantiate(dentry, ip);
274         }
275         return -error;
276 }
277
278 STATIC int
279 linvfs_unlink(
280         struct inode    *dir,
281         struct dentry   *dentry)
282 {
283         struct inode    *inode;
284         vnode_t         *dvp;   /* directory containing name to remove */
285         int             error;
286
287         inode = dentry->d_inode;
288         dvp = LINVFS_GET_VP(dir);
289
290         VOP_REMOVE(dvp, dentry, NULL, error);
291         if (!error) {
292                 validate_fields(dir);   /* For size only */
293                 validate_fields(inode);
294         }
295
296         return -error;
297 }
298
299 STATIC int
300 linvfs_symlink(
301         struct inode    *dir,
302         struct dentry   *dentry,
303         const char      *symname)
304 {
305         struct inode    *ip;
306         vattr_t         va;
307         vnode_t         *dvp;   /* directory containing name to remove */
308         vnode_t         *cvp;   /* used to lookup symlink to put in dentry */
309         int             error;
310
311         dvp = LINVFS_GET_VP(dir);
312         cvp = NULL;
313
314         memset(&va, 0, sizeof(va));
315         va.va_type = VLNK;
316         va.va_mode = irix_symlink_mode ? 0777 & ~current->fs->umask : S_IRWXUGO;
317         va.va_mask = XFS_AT_TYPE|XFS_AT_MODE;
318
319         error = 0;
320         VOP_SYMLINK(dvp, dentry, &va, (char *)symname, &cvp, NULL, error);
321         if (!error && cvp) {
322                 ASSERT(cvp->v_type == VLNK);
323                 ip = LINVFS_GET_IP(cvp);
324                 d_instantiate(dentry, ip);
325                 validate_fields(dir);
326                 validate_fields(ip); /* size needs update */
327         }
328         return -error;
329 }
330
331 STATIC int
332 linvfs_rmdir(
333         struct inode    *dir,
334         struct dentry   *dentry)
335 {
336         struct inode    *inode = dentry->d_inode;
337         vnode_t         *dvp = LINVFS_GET_VP(dir);
338         int             error;
339
340         VOP_RMDIR(dvp, dentry, NULL, error);
341         if (!error) {
342                 validate_fields(inode);
343                 validate_fields(dir);
344         }
345         return -error;
346 }
347
348 STATIC int
349 linvfs_rename(
350         struct inode    *odir,
351         struct dentry   *odentry,
352         struct inode    *ndir,
353         struct dentry   *ndentry)
354 {
355         struct inode    *new_inode = ndentry->d_inode;
356         vnode_t         *fvp;   /* from directory */
357         vnode_t         *tvp;   /* target directory */
358         int             error;
359
360         fvp = LINVFS_GET_VP(odir);
361         tvp = LINVFS_GET_VP(ndir);
362
363         VOP_RENAME(fvp, odentry, tvp, ndentry, NULL, error);
364         if (error)
365                 return -error;
366
367         if (new_inode)
368                 validate_fields(new_inode);
369
370         validate_fields(odir);
371         if (ndir != odir)
372                 validate_fields(ndir);
373         return 0;
374 }
375
376 STATIC int
377 linvfs_readlink(
378         struct dentry   *dentry,
379         char            *buf,
380         int             size)
381 {
382         vnode_t         *vp = LINVFS_GET_VP(dentry->d_inode);
383         uio_t           uio;
384         iovec_t         iov;
385         int             error;
386
387         iov.iov_base = buf;
388         iov.iov_len = size;
389
390         uio.uio_iov = &iov;
391         uio.uio_offset = 0;
392         uio.uio_segflg = UIO_USERSPACE;
393         uio.uio_resid = size;
394         uio.uio_iovcnt = 1;
395
396         VOP_READLINK(vp, &uio, 0, NULL, error);
397         if (error)
398                 return -error;
399
400         return (size - uio.uio_resid);
401 }
402
403 /*
404  * careful here - this function can get called recursively, so
405  * we need to be very careful about how much stack we use.
406  * uio is kmalloced for this reason...
407  */
408 STATIC int
409 linvfs_follow_link(
410         struct dentry           *dentry,
411         struct nameidata        *nd)
412 {
413         vnode_t                 *vp;
414         uio_t                   *uio;
415         iovec_t                 iov;
416         int                     error;
417         char                    *link;
418
419         ASSERT(dentry);
420         ASSERT(nd);
421
422         link = (char *)kmalloc(MAXNAMELEN+1, GFP_KERNEL);
423         if (!link) {
424                 nd_set_link(nd, ERR_PTR(-ENOMEM));
425                 return 0;
426         }
427
428         uio = (uio_t *)kmalloc(sizeof(uio_t), GFP_KERNEL);
429         if (!uio) {
430                 kfree(link);
431                 nd_set_link(nd, ERR_PTR(-ENOMEM));
432                 return 0;
433         }
434
435         vp = LINVFS_GET_VP(dentry->d_inode);
436
437         iov.iov_base = link;
438         iov.iov_len = MAXNAMELEN;
439
440         uio->uio_iov = &iov;
441         uio->uio_offset = 0;
442         uio->uio_segflg = UIO_SYSSPACE;
443         uio->uio_resid = MAXNAMELEN;
444         uio->uio_iovcnt = 1;
445
446         VOP_READLINK(vp, uio, 0, NULL, error);
447         if (error) {
448                 kfree(link);
449                 link = ERR_PTR(-error);
450         } else {
451                 link[MAXNAMELEN - uio->uio_resid] = '\0';
452         }
453         kfree(uio);
454
455         nd_set_link(nd, link);
456         return 0;
457 }
458
459 static void linvfs_put_link(struct dentry *dentry, struct nameidata *nd)
460 {
461         char *s = nd_get_link(nd);
462         if (!IS_ERR(s))
463                 kfree(s);
464 }
465
466 #ifdef CONFIG_XFS_POSIX_ACL
467 STATIC int
468 linvfs_permission(
469         struct inode    *inode,
470         int             mode,
471         struct nameidata *nd)
472 {
473         vnode_t         *vp = LINVFS_GET_VP(inode);
474         int             error;
475
476         mode <<= 6;             /* convert from linux to vnode access bits */
477         VOP_ACCESS(vp, mode, NULL, error);
478         return -error;
479 }
480 #else
481 #define linvfs_permission NULL
482 #endif
483
484 STATIC int
485 linvfs_getattr(
486         struct vfsmount *mnt,
487         struct dentry   *dentry,
488         struct kstat    *stat)
489 {
490         struct inode    *inode = dentry->d_inode;
491         vnode_t         *vp = LINVFS_GET_VP(inode);
492         int             error = 0;
493
494         if (unlikely(vp->v_flag & VMODIFIED))
495                 error = vn_revalidate(vp);
496         if (!error)
497                 generic_fillattr(inode, stat);
498         return 0;
499 }
500
501 STATIC int
502 linvfs_setattr_flags(
503         vattr_t *vap,
504         unsigned int flags)
505 {
506         unsigned int oldflags, newflags;
507
508         oldflags = vap->va_xflags;
509         newflags = oldflags & ~(XFS_XFLAG_IMMUTABLE |
510                 XFS_XFLAG_IUNLINK | XFS_XFLAG_BARRIER);
511         if (flags & ATTR_FLAG_IMMUTABLE)
512                 newflags |= XFS_XFLAG_IMMUTABLE;
513         if (flags & ATTR_FLAG_IUNLINK)
514                 newflags |= XFS_XFLAG_IUNLINK;
515         if (flags & ATTR_FLAG_BARRIER)
516                 newflags |= XFS_XFLAG_BARRIER;
517
518         if (oldflags ^ newflags)
519                 vap->va_xflags = newflags;
520         return 0;
521 }
522
523 STATIC int
524 linvfs_setattr(
525         struct dentry   *dentry,
526         struct iattr    *attr)
527 {
528         struct inode    *inode = dentry->d_inode;
529         unsigned int    ia_valid = attr->ia_valid;
530         vnode_t         *vp = LINVFS_GET_VP(inode);
531         vattr_t         vattr;
532         int             flags = 0;
533         int             error;
534
535         memset(&vattr, 0, sizeof(vattr_t));
536         if (ia_valid & ATTR_UID) {
537                 vattr.va_mask |= XFS_AT_UID;
538                 vattr.va_uid = attr->ia_uid;
539         }
540         if (ia_valid & ATTR_GID) {
541                 vattr.va_mask |= XFS_AT_GID;
542                 vattr.va_gid = attr->ia_gid;
543         }
544         if (ia_valid & ATTR_SIZE) {
545                 vattr.va_mask |= XFS_AT_SIZE;
546                 vattr.va_size = attr->ia_size;
547         }
548         if (ia_valid & ATTR_ATIME) {
549                 vattr.va_mask |= XFS_AT_ATIME;
550                 vattr.va_atime = attr->ia_atime;
551         }
552         if (ia_valid & ATTR_MTIME) {
553                 vattr.va_mask |= XFS_AT_MTIME;
554                 vattr.va_mtime = attr->ia_mtime;
555         }
556         if (ia_valid & ATTR_CTIME) {
557                 vattr.va_mask |= XFS_AT_CTIME;
558                 vattr.va_ctime = attr->ia_ctime;
559         }
560         if (ia_valid & ATTR_MODE) {
561                 vattr.va_mask |= XFS_AT_MODE;
562                 vattr.va_mode = attr->ia_mode;
563                 if (!in_group_p(inode->i_gid) && !capable(CAP_FSETID))
564                         inode->i_mode &= ~S_ISGID;
565         }
566
567         if (ia_valid & (ATTR_MTIME_SET | ATTR_ATIME_SET))
568                 flags |= ATTR_UTIME;
569 #ifdef ATTR_NO_BLOCK
570         if ((ia_valid & ATTR_NO_BLOCK))
571                 flags |= ATTR_NONBLOCK;
572 #endif
573
574         if (ia_valid & ATTR_ATTR_FLAG) {
575                 vattr.va_mask |= XFS_AT_XFLAGS;
576                 linvfs_setattr_flags(&vattr, attr->ia_attr_flags);
577         }
578
579         VOP_SETATTR(vp, &vattr, flags, NULL, error);
580         if (error)
581                 return -error;
582         vn_revalidate(vp);
583         return error;
584 }
585
586 STATIC void
587 linvfs_truncate(
588         struct inode    *inode)
589 {
590         block_truncate_page(inode->i_mapping, inode->i_size, linvfs_get_block);
591 }
592
593 STATIC int
594 linvfs_setxattr(
595         struct dentry   *dentry,
596         const char      *name,
597         const void      *data,
598         size_t          size,
599         int             flags)
600 {
601         vnode_t         *vp = LINVFS_GET_VP(dentry->d_inode);
602         char            *attr = (char *)name;
603         attrnames_t     *namesp;
604         int             xflags = 0;
605         int             error;
606
607         namesp = attr_lookup_namespace(attr, attr_namespaces, ATTR_NAMECOUNT);
608         if (!namesp)
609                 return -EOPNOTSUPP;
610         attr += namesp->attr_namelen;
611         error = namesp->attr_capable(vp, NULL);
612         if (error)
613                 return error;
614
615         /* Convert Linux syscall to XFS internal ATTR flags */
616         if (flags & XATTR_CREATE)
617                 xflags |= ATTR_CREATE;
618         if (flags & XATTR_REPLACE)
619                 xflags |= ATTR_REPLACE;
620         xflags |= namesp->attr_flag;
621         return namesp->attr_set(vp, attr, (void *)data, size, xflags);
622 }
623
624 STATIC ssize_t
625 linvfs_getxattr(
626         struct dentry   *dentry,
627         const char      *name,
628         void            *data,
629         size_t          size)
630 {
631         vnode_t         *vp = LINVFS_GET_VP(dentry->d_inode);
632         char            *attr = (char *)name;
633         attrnames_t     *namesp;
634         int             xflags = 0;
635         ssize_t         error;
636
637         namesp = attr_lookup_namespace(attr, attr_namespaces, ATTR_NAMECOUNT);
638         if (!namesp)
639                 return -EOPNOTSUPP;
640         attr += namesp->attr_namelen;
641         error = namesp->attr_capable(vp, NULL);
642         if (error)
643                 return error;
644
645         /* Convert Linux syscall to XFS internal ATTR flags */
646         if (!size) {
647                 xflags |= ATTR_KERNOVAL;
648                 data = NULL;
649         }
650         xflags |= namesp->attr_flag;
651         return namesp->attr_get(vp, attr, (void *)data, size, xflags);
652 }
653
654 STATIC ssize_t
655 linvfs_listxattr(
656         struct dentry           *dentry,
657         char                    *data,
658         size_t                  size)
659 {
660         vnode_t                 *vp = LINVFS_GET_VP(dentry->d_inode);
661         int                     error, xflags = ATTR_KERNAMELS;
662         ssize_t                 result;
663
664         if (!size)
665                 xflags |= ATTR_KERNOVAL;
666         xflags |= capable(CAP_SYS_ADMIN) ? ATTR_KERNFULLS : ATTR_KERNORMALS;
667
668         error = attr_generic_list(vp, data, size, xflags, &result);
669         if (error < 0)
670                 return error;
671         return result;
672 }
673
674 STATIC int
675 linvfs_removexattr(
676         struct dentry   *dentry,
677         const char      *name)
678 {
679         vnode_t         *vp = LINVFS_GET_VP(dentry->d_inode);
680         char            *attr = (char *)name;
681         attrnames_t     *namesp;
682         int             xflags = 0;
683         int             error;
684
685         namesp = attr_lookup_namespace(attr, attr_namespaces, ATTR_NAMECOUNT);
686         if (!namesp)
687                 return -EOPNOTSUPP;
688         attr += namesp->attr_namelen;
689         error = namesp->attr_capable(vp, NULL);
690         if (error)
691                 return error;
692         xflags |= namesp->attr_flag;
693         return namesp->attr_remove(vp, attr, xflags);
694 }
695
696
697 struct inode_operations linvfs_file_inode_operations = {
698         .permission             = linvfs_permission,
699         .truncate               = linvfs_truncate,
700         .getattr                = linvfs_getattr,
701         .setattr                = linvfs_setattr,
702         .setxattr               = linvfs_setxattr,
703         .getxattr               = linvfs_getxattr,
704         .listxattr              = linvfs_listxattr,
705         .removexattr            = linvfs_removexattr,
706 };
707
708 struct inode_operations linvfs_dir_inode_operations = {
709         .create                 = linvfs_create,
710         .lookup                 = linvfs_lookup,
711         .link                   = linvfs_link,
712         .unlink                 = linvfs_unlink,
713         .symlink                = linvfs_symlink,
714         .mkdir                  = linvfs_mkdir,
715         .rmdir                  = linvfs_rmdir,
716         .mknod                  = linvfs_mknod,
717         .rename                 = linvfs_rename,
718         .permission             = linvfs_permission,
719         .getattr                = linvfs_getattr,
720         .setattr                = linvfs_setattr,
721         .setxattr               = linvfs_setxattr,
722         .getxattr               = linvfs_getxattr,
723         .listxattr              = linvfs_listxattr,
724         .removexattr            = linvfs_removexattr,
725 };
726
727 struct inode_operations linvfs_symlink_inode_operations = {
728         .readlink               = linvfs_readlink,
729         .follow_link            = linvfs_follow_link,
730         .put_link               = linvfs_put_link,
731         .permission             = linvfs_permission,
732         .getattr                = linvfs_getattr,
733         .setattr                = linvfs_setattr,
734         .setxattr               = linvfs_setxattr,
735         .getxattr               = linvfs_getxattr,
736         .listxattr              = linvfs_listxattr,
737         .removexattr            = linvfs_removexattr,
738 };