4 * Copyright (c) 2013 Samsung Electronics Co. Ltd
5 * Authors: Daeho Jeong, Woojoong Lee, Seunghwan Hyun,
6 * Sunghwan Yun, Sungjong Seo
8 * This program has been developed as a stackable file system based on
9 * the WrapFS which written by
11 * Copyright (c) 1998-2011 Erez Zadok
12 * Copyright (c) 2009 Shrikar Archak
13 * Copyright (c) 2003-2011 Stony Brook University
14 * Copyright (c) 2003-2011 The Research Foundation of SUNY
16 * This file is dual licensed. It may be redistributed and/or modified
17 * under the terms of the Apache 2.0 License OR version 2 of the GNU
18 * General Public License.
22 #include <linux/fs_struct.h>
24 /* Do not directly use this function. Use OVERRIDE_CRED() instead. */
25 const struct cred * override_fsids(struct sdcardfs_sb_info* sbi)
28 const struct cred * old_cred;
30 cred = prepare_creds();
34 cred->fsuid = make_kuid(&init_user_ns, sbi->options.fs_low_uid);
35 cred->fsgid = make_kgid(&init_user_ns, sbi->options.fs_low_gid);
37 old_cred = override_creds(cred);
42 /* Do not directly use this function, use REVERT_CRED() instead. */
43 void revert_fsids(const struct cred * old_cred)
45 const struct cred * cur_cred;
47 cur_cred = current->cred;
48 revert_creds(old_cred);
52 static int sdcardfs_create(struct inode *dir, struct dentry *dentry,
53 umode_t mode, bool want_excl)
56 struct dentry *lower_dentry;
57 struct dentry *lower_parent_dentry = NULL;
58 struct path lower_path;
59 const struct cred *saved_cred = NULL;
60 struct fs_struct *saved_fs;
61 struct fs_struct *copied_fs;
63 if(!check_caller_access_to_name(dir, dentry->d_name.name)) {
64 printk(KERN_INFO "%s: need to check the caller's gid in packages.list\n"
65 " dentry: %s, task:%s\n",
66 __func__, dentry->d_name.name, current->comm);
71 /* save current_cred and override it */
72 OVERRIDE_CRED(SDCARDFS_SB(dir->i_sb), saved_cred);
74 sdcardfs_get_lower_path(dentry, &lower_path);
75 lower_dentry = lower_path.dentry;
76 lower_parent_dentry = lock_parent(lower_dentry);
78 /* set last 16bytes of mode field to 0664 */
79 mode = (mode & S_IFMT) | 00664;
81 /* temporarily change umask for lower fs write */
82 saved_fs = current->fs;
83 copied_fs = copy_fs_struct(current->fs);
88 current->fs = copied_fs;
89 current->fs->umask = 0;
90 err = vfs_create(d_inode(lower_parent_dentry), lower_dentry, mode, want_excl);
94 err = sdcardfs_interpose(dentry, dir->i_sb, &lower_path, SDCARDFS_I(dir)->userid);
97 fsstack_copy_attr_times(dir, sdcardfs_lower_inode(dir));
98 fsstack_copy_inode_size(dir, d_inode(lower_parent_dentry));
101 current->fs = saved_fs;
102 free_fs_struct(copied_fs);
104 unlock_dir(lower_parent_dentry);
105 sdcardfs_put_lower_path(dentry, &lower_path);
106 REVERT_CRED(saved_cred);
112 static int sdcardfs_link(struct dentry *old_dentry, struct inode *dir,
113 struct dentry *new_dentry)
115 struct dentry *lower_old_dentry;
116 struct dentry *lower_new_dentry;
117 struct dentry *lower_dir_dentry;
120 struct path lower_old_path, lower_new_path;
122 OVERRIDE_CRED(SDCARDFS_SB(dir->i_sb));
124 file_size_save = i_size_read(d_inode(old_dentry));
125 sdcardfs_get_lower_path(old_dentry, &lower_old_path);
126 sdcardfs_get_lower_path(new_dentry, &lower_new_path);
127 lower_old_dentry = lower_old_path.dentry;
128 lower_new_dentry = lower_new_path.dentry;
129 lower_dir_dentry = lock_parent(lower_new_dentry);
131 err = vfs_link(lower_old_dentry, d_inode(lower_dir_dentry),
132 lower_new_dentry, NULL);
133 if (err || !d_inode(lower_new_dentry))
136 err = sdcardfs_interpose(new_dentry, dir->i_sb, &lower_new_path);
139 fsstack_copy_attr_times(dir, d_inode(lower_new_dentry));
140 fsstack_copy_inode_size(dir, d_inode(lower_new_dentry));
141 set_nlink(d_inode(old_dentry),
142 sdcardfs_lower_inode(d_inode(old_dentry))->i_nlink);
143 i_size_write(d_inode(new_dentry), file_size_save);
145 unlock_dir(lower_dir_dentry);
146 sdcardfs_put_lower_path(old_dentry, &lower_old_path);
147 sdcardfs_put_lower_path(new_dentry, &lower_new_path);
153 static int sdcardfs_unlink(struct inode *dir, struct dentry *dentry)
156 struct dentry *lower_dentry;
157 struct inode *lower_dir_inode = sdcardfs_lower_inode(dir);
158 struct dentry *lower_dir_dentry;
159 struct path lower_path;
160 const struct cred *saved_cred = NULL;
162 if(!check_caller_access_to_name(dir, dentry->d_name.name)) {
163 printk(KERN_INFO "%s: need to check the caller's gid in packages.list\n"
164 " dentry: %s, task:%s\n",
165 __func__, dentry->d_name.name, current->comm);
170 /* save current_cred and override it */
171 OVERRIDE_CRED(SDCARDFS_SB(dir->i_sb), saved_cred);
173 sdcardfs_get_lower_path(dentry, &lower_path);
174 lower_dentry = lower_path.dentry;
176 lower_dir_dentry = lock_parent(lower_dentry);
178 err = vfs_unlink(lower_dir_inode, lower_dentry, NULL);
181 * Note: unlinking on top of NFS can cause silly-renamed files.
182 * Trying to delete such files results in EBUSY from NFS
183 * below. Silly-renamed files will get deleted by NFS later on, so
184 * we just need to detect them here and treat such EBUSY errors as
185 * if the upper file was successfully deleted.
187 if (err == -EBUSY && lower_dentry->d_flags & DCACHE_NFSFS_RENAMED)
191 fsstack_copy_attr_times(dir, lower_dir_inode);
192 fsstack_copy_inode_size(dir, lower_dir_inode);
193 set_nlink(d_inode(dentry),
194 sdcardfs_lower_inode(d_inode(dentry))->i_nlink);
195 d_inode(dentry)->i_ctime = dir->i_ctime;
196 d_drop(dentry); /* this is needed, else LTP fails (VFS won't do it) */
198 unlock_dir(lower_dir_dentry);
200 sdcardfs_put_lower_path(dentry, &lower_path);
201 REVERT_CRED(saved_cred);
207 static int sdcardfs_symlink(struct inode *dir, struct dentry *dentry,
211 struct dentry *lower_dentry;
212 struct dentry *lower_parent_dentry = NULL;
213 struct path lower_path;
215 OVERRIDE_CRED(SDCARDFS_SB(dir->i_sb));
217 sdcardfs_get_lower_path(dentry, &lower_path);
218 lower_dentry = lower_path.dentry;
219 lower_parent_dentry = lock_parent(lower_dentry);
221 err = vfs_symlink(d_inode(lower_parent_dentry), lower_dentry, symname);
224 err = sdcardfs_interpose(dentry, dir->i_sb, &lower_path);
227 fsstack_copy_attr_times(dir, sdcardfs_lower_inode(dir));
228 fsstack_copy_inode_size(dir, d_inode(lower_parent_dentry));
231 unlock_dir(lower_parent_dentry);
232 sdcardfs_put_lower_path(dentry, &lower_path);
238 static int touch(char *abs_path, mode_t mode) {
239 struct file *filp = filp_open(abs_path, O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW, mode);
241 if (PTR_ERR(filp) == -EEXIST) {
245 printk(KERN_ERR "sdcardfs: failed to open(%s): %ld\n",
246 abs_path, PTR_ERR(filp));
247 return PTR_ERR(filp);
250 filp_close(filp, current->files);
254 static int sdcardfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
257 int make_nomedia_in_obb = 0;
258 struct dentry *lower_dentry;
259 struct dentry *lower_parent_dentry = NULL;
260 struct path lower_path;
261 struct sdcardfs_sb_info *sbi = SDCARDFS_SB(dentry->d_sb);
262 const struct cred *saved_cred = NULL;
263 struct sdcardfs_inode_info *pi = SDCARDFS_I(dir);
265 struct fs_struct *saved_fs;
266 struct fs_struct *copied_fs;
268 if(!check_caller_access_to_name(dir, dentry->d_name.name)) {
269 printk(KERN_INFO "%s: need to check the caller's gid in packages.list\n"
270 " dentry: %s, task:%s\n",
271 __func__, dentry->d_name.name, current->comm);
276 /* save current_cred and override it */
277 OVERRIDE_CRED(SDCARDFS_SB(dir->i_sb), saved_cred);
279 /* check disk space */
280 if (!check_min_free_space(dentry, 0, 1)) {
281 printk(KERN_INFO "sdcardfs: No minimum free space.\n");
286 /* the lower_dentry is negative here */
287 sdcardfs_get_lower_path(dentry, &lower_path);
288 lower_dentry = lower_path.dentry;
289 lower_parent_dentry = lock_parent(lower_dentry);
291 /* set last 16bytes of mode field to 0775 */
292 mode = (mode & S_IFMT) | 00775;
294 /* temporarily change umask for lower fs write */
295 saved_fs = current->fs;
296 copied_fs = copy_fs_struct(current->fs);
301 current->fs = copied_fs;
302 current->fs->umask = 0;
303 err = vfs_mkdir(d_inode(lower_parent_dentry), lower_dentry, mode);
308 /* if it is a local obb dentry, setup it with the base obbpath */
309 if(need_graft_path(dentry)) {
311 err = setup_obb_dentry(dentry, &lower_path);
313 /* if the sbi->obbpath is not available, the lower_path won't be
314 * changed by setup_obb_dentry() but the lower path is saved to
315 * its orig_path. this dentry will be revalidated later.
316 * but now, the lower_path should be NULL */
317 sdcardfs_put_reset_lower_path(dentry);
319 /* the newly created lower path which saved to its orig_path or
320 * the lower_path is the base obbpath.
321 * therefore, an additional path_get is required */
322 path_get(&lower_path);
324 make_nomedia_in_obb = 1;
327 err = sdcardfs_interpose(dentry, dir->i_sb, &lower_path, pi->userid);
331 fsstack_copy_attr_times(dir, sdcardfs_lower_inode(dir));
332 fsstack_copy_inode_size(dir, d_inode(lower_parent_dentry));
333 /* update number of links on parent directory */
334 set_nlink(dir, sdcardfs_lower_inode(dir)->i_nlink);
336 if ((!sbi->options.multiuser) && (!strcasecmp(dentry->d_name.name, "obb"))
337 && (pi->perm == PERM_ANDROID) && (pi->userid == 0))
338 make_nomedia_in_obb = 1;
340 /* When creating /Android/data and /Android/obb, mark them as .nomedia */
341 if (make_nomedia_in_obb ||
342 ((pi->perm == PERM_ANDROID) && (!strcasecmp(dentry->d_name.name, "data")))) {
343 set_fs_pwd(current->fs, &lower_path);
344 touch_err = touch(".nomedia", 0664);
346 printk(KERN_ERR "sdcardfs: failed to create .nomedia in %s: %d\n",
347 lower_path.dentry->d_name.name, touch_err);
352 current->fs = saved_fs;
353 free_fs_struct(copied_fs);
355 unlock_dir(lower_parent_dentry);
356 sdcardfs_put_lower_path(dentry, &lower_path);
358 REVERT_CRED(saved_cred);
363 static int sdcardfs_rmdir(struct inode *dir, struct dentry *dentry)
365 struct dentry *lower_dentry;
366 struct dentry *lower_dir_dentry;
368 struct path lower_path;
369 const struct cred *saved_cred = NULL;
371 if(!check_caller_access_to_name(dir, dentry->d_name.name)) {
372 printk(KERN_INFO "%s: need to check the caller's gid in packages.list\n"
373 " dentry: %s, task:%s\n",
374 __func__, dentry->d_name.name, current->comm);
379 /* save current_cred and override it */
380 OVERRIDE_CRED(SDCARDFS_SB(dir->i_sb), saved_cred);
382 /* sdcardfs_get_real_lower(): in case of remove an user's obb dentry
383 * the dentry on the original path should be deleted. */
384 sdcardfs_get_real_lower(dentry, &lower_path);
386 lower_dentry = lower_path.dentry;
387 lower_dir_dentry = lock_parent(lower_dentry);
389 err = vfs_rmdir(d_inode(lower_dir_dentry), lower_dentry);
393 d_drop(dentry); /* drop our dentry on success (why not VFS's job?) */
395 clear_nlink(d_inode(dentry));
396 fsstack_copy_attr_times(dir, d_inode(lower_dir_dentry));
397 fsstack_copy_inode_size(dir, d_inode(lower_dir_dentry));
398 set_nlink(dir, d_inode(lower_dir_dentry)->i_nlink);
401 unlock_dir(lower_dir_dentry);
402 sdcardfs_put_real_lower(dentry, &lower_path);
403 REVERT_CRED(saved_cred);
409 static int sdcardfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode,
413 struct dentry *lower_dentry;
414 struct dentry *lower_parent_dentry = NULL;
415 struct path lower_path;
417 OVERRIDE_CRED(SDCARDFS_SB(dir->i_sb));
419 sdcardfs_get_lower_path(dentry, &lower_path);
420 lower_dentry = lower_path.dentry;
421 lower_parent_dentry = lock_parent(lower_dentry);
423 err = vfs_mknod(d_inode(lower_parent_dentry), lower_dentry, mode, dev);
427 err = sdcardfs_interpose(dentry, dir->i_sb, &lower_path);
430 fsstack_copy_attr_times(dir, sdcardfs_lower_inode(dir));
431 fsstack_copy_inode_size(dir, d_inode(lower_parent_dentry));
434 unlock_dir(lower_parent_dentry);
435 sdcardfs_put_lower_path(dentry, &lower_path);
442 * The locking rules in sdcardfs_rename are complex. We could use a simpler
443 * superblock-level name-space lock for renames and copy-ups.
445 static int sdcardfs_rename(struct inode *old_dir, struct dentry *old_dentry,
446 struct inode *new_dir, struct dentry *new_dentry)
449 struct dentry *lower_old_dentry = NULL;
450 struct dentry *lower_new_dentry = NULL;
451 struct dentry *lower_old_dir_dentry = NULL;
452 struct dentry *lower_new_dir_dentry = NULL;
453 struct dentry *trap = NULL;
454 struct dentry *new_parent = NULL;
455 struct path lower_old_path, lower_new_path;
456 const struct cred *saved_cred = NULL;
458 if(!check_caller_access_to_name(old_dir, old_dentry->d_name.name) ||
459 !check_caller_access_to_name(new_dir, new_dentry->d_name.name)) {
460 printk(KERN_INFO "%s: need to check the caller's gid in packages.list\n"
461 " new_dentry: %s, task:%s\n",
462 __func__, new_dentry->d_name.name, current->comm);
467 /* save current_cred and override it */
468 OVERRIDE_CRED(SDCARDFS_SB(old_dir->i_sb), saved_cred);
470 sdcardfs_get_real_lower(old_dentry, &lower_old_path);
471 sdcardfs_get_lower_path(new_dentry, &lower_new_path);
472 lower_old_dentry = lower_old_path.dentry;
473 lower_new_dentry = lower_new_path.dentry;
474 lower_old_dir_dentry = dget_parent(lower_old_dentry);
475 lower_new_dir_dentry = dget_parent(lower_new_dentry);
477 trap = lock_rename(lower_old_dir_dentry, lower_new_dir_dentry);
478 /* source should not be ancestor of target */
479 if (trap == lower_old_dentry) {
483 /* target should not be ancestor of source */
484 if (trap == lower_new_dentry) {
489 err = vfs_rename(d_inode(lower_old_dir_dentry), lower_old_dentry,
490 d_inode(lower_new_dir_dentry), lower_new_dentry,
495 /* Copy attrs from lower dir, but i_uid/i_gid */
496 sdcardfs_copy_and_fix_attrs(new_dir, d_inode(lower_new_dir_dentry));
497 fsstack_copy_inode_size(new_dir, d_inode(lower_new_dir_dentry));
499 if (new_dir != old_dir) {
500 sdcardfs_copy_and_fix_attrs(old_dir, d_inode(lower_old_dir_dentry));
501 fsstack_copy_inode_size(old_dir, d_inode(lower_old_dir_dentry));
503 /* update the derived permission of the old_dentry
504 * with its new parent
506 new_parent = dget_parent(new_dentry);
508 if(d_inode(old_dentry)) {
509 update_derived_permission_lock(old_dentry);
514 /* At this point, not all dentry information has been moved, so
515 * we pass along new_dentry for the name.*/
516 get_derived_permission_new(new_dentry->d_parent, old_dentry, new_dentry);
517 fix_derived_permission(d_inode(old_dentry));
518 get_derive_permissions_recursive(old_dentry);
520 unlock_rename(lower_old_dir_dentry, lower_new_dir_dentry);
521 dput(lower_old_dir_dentry);
522 dput(lower_new_dir_dentry);
523 sdcardfs_put_real_lower(old_dentry, &lower_old_path);
524 sdcardfs_put_lower_path(new_dentry, &lower_new_path);
525 REVERT_CRED(saved_cred);
531 static int sdcardfs_readlink(struct dentry *dentry, char __user *buf, int bufsiz)
534 struct dentry *lower_dentry;
535 struct path lower_path;
536 /* XXX readlink does not requires overriding credential */
538 sdcardfs_get_lower_path(dentry, &lower_path);
539 lower_dentry = lower_path.dentry;
540 if (!d_inode(lower_dentry)->i_op ||
541 !d_inode(lower_dentry)->i_op->readlink) {
546 err = d_inode(lower_dentry)->i_op->readlink(lower_dentry,
550 fsstack_copy_attr_atime(d_inode(dentry), d_inode(lower_dentry));
553 sdcardfs_put_lower_path(dentry, &lower_path);
559 static const char *sdcardfs_follow_link(struct dentry *dentry, void **cookie)
562 int len = PAGE_SIZE, err;
565 /* This is freed by the put_link method assuming a successful call. */
566 buf = kmalloc(len, GFP_KERNEL);
568 buf = ERR_PTR(-ENOMEM);
572 /* read the symlink, and then we will follow it */
575 err = sdcardfs_readlink(dentry, buf, len);
583 return *cookie = buf;
587 static int sdcardfs_permission(struct inode *inode, int mask)
592 * Permission check on sdcardfs inode.
593 * Calling process should have AID_SDCARD_RW permission
595 err = generic_permission(inode, mask);
598 * Original sdcardfs code calls inode_permission(lower_inode,.. )
599 * for checking inode permission. But doing such things here seems
600 * duplicated work, because the functions called after this func,
601 * such as vfs_create, vfs_unlink, vfs_rename, and etc,
602 * does exactly same thing, i.e., they calls inode_permission().
603 * So we just let they do the things.
604 * If there are any security hole, just uncomment following if block.
609 * Permission check on lower_inode(=EXT4).
610 * we check it with AID_MEDIA_RW permission
612 struct inode *lower_inode;
613 OVERRIDE_CRED(SDCARDFS_SB(inode->sb));
615 lower_inode = sdcardfs_lower_inode(inode);
616 err = inode_permission(lower_inode, mask);
625 static int sdcardfs_setattr(struct dentry *dentry, struct iattr *ia)
628 struct dentry *lower_dentry;
630 struct inode *lower_inode;
631 struct path lower_path;
632 struct iattr lower_ia;
633 struct dentry *parent;
635 inode = d_inode(dentry);
638 * Check if user has permission to change inode. We don't check if
639 * this user can change the lower inode: that should happen when
640 * calling notify_change on the lower inode.
642 err = inode_change_ok(inode, ia);
644 /* no vfs_XXX operations required, cred overriding will be skipped. wj*/
646 /* check the Android group ID */
647 parent = dget_parent(dentry);
648 if(!check_caller_access_to_name(d_inode(parent), dentry->d_name.name)) {
649 printk(KERN_INFO "%s: need to check the caller's gid in packages.list\n"
650 " dentry: %s, task:%s\n",
651 __func__, dentry->d_name.name, current->comm);
660 sdcardfs_get_lower_path(dentry, &lower_path);
661 lower_dentry = lower_path.dentry;
662 lower_inode = sdcardfs_lower_inode(inode);
664 /* prepare our own lower struct iattr (with the lower file) */
665 memcpy(&lower_ia, ia, sizeof(lower_ia));
666 if (ia->ia_valid & ATTR_FILE)
667 lower_ia.ia_file = sdcardfs_lower_file(ia->ia_file);
669 lower_ia.ia_valid &= ~(ATTR_UID | ATTR_GID | ATTR_MODE);
672 * If shrinking, first truncate upper level to cancel writing dirty
673 * pages beyond the new eof; and also if its' maxbytes is more
674 * limiting (fail with -EFBIG before making any change to the lower
675 * level). There is no need to vmtruncate the upper level
676 * afterwards in the other cases: we fsstack_copy_inode_size from
680 down_write(¤t->mm->mmap_sem);
681 if (ia->ia_valid & ATTR_SIZE) {
682 err = inode_newsize_ok(inode, ia->ia_size);
685 up_write(¤t->mm->mmap_sem);
688 truncate_setsize(inode, ia->ia_size);
692 * mode change is for clearing setuid/setgid bits. Allow lower fs
693 * to interpret this in its own way.
695 if (lower_ia.ia_valid & (ATTR_KILL_SUID | ATTR_KILL_SGID))
696 lower_ia.ia_valid &= ~ATTR_MODE;
698 /* notify the (possibly copied-up) lower inode */
700 * Note: we use d_inode(lower_dentry), because lower_inode may be
701 * unlinked (no inode->i_sb and i_ino==0. This happens if someone
702 * tries to open(), unlink(), then ftruncate() a file.
704 mutex_lock(&d_inode(lower_dentry)->i_mutex);
705 err = notify_change(lower_dentry, &lower_ia, /* note: lower_ia */
707 mutex_unlock(&d_inode(lower_dentry)->i_mutex);
709 up_write(¤t->mm->mmap_sem);
713 /* get attributes from the lower inode and update derived permissions */
714 sdcardfs_copy_and_fix_attrs(inode, lower_inode);
717 * Not running fsstack_copy_inode_size(inode, lower_inode), because
718 * VFS should update our inode size, and notify_change on
719 * lower_inode should update its size.
723 sdcardfs_put_lower_path(dentry, &lower_path);
728 static int sdcardfs_getattr(struct vfsmount *mnt, struct dentry *dentry,
731 struct dentry *lower_dentry;
733 struct inode *lower_inode;
734 struct path lower_path;
735 struct dentry *parent;
737 parent = dget_parent(dentry);
738 if(!check_caller_access_to_name(d_inode(parent), dentry->d_name.name)) {
739 printk(KERN_INFO "%s: need to check the caller's gid in packages.list\n"
740 " dentry: %s, task:%s\n",
741 __func__, dentry->d_name.name, current->comm);
747 inode = d_inode(dentry);
749 sdcardfs_get_lower_path(dentry, &lower_path);
750 lower_dentry = lower_path.dentry;
751 lower_inode = sdcardfs_lower_inode(inode);
754 sdcardfs_copy_and_fix_attrs(inode, lower_inode);
755 fsstack_copy_inode_size(inode, lower_inode);
758 generic_fillattr(inode, stat);
759 sdcardfs_put_lower_path(dentry, &lower_path);
763 const struct inode_operations sdcardfs_symlink_iops = {
764 .permission = sdcardfs_permission,
765 .setattr = sdcardfs_setattr,
766 /* XXX Following operations are implemented,
767 * but FUSE(sdcard) or FAT does not support them
768 * These methods are *NOT* perfectly tested.
769 .readlink = sdcardfs_readlink,
770 .follow_link = sdcardfs_follow_link,
771 .put_link = kfree_put_link,
775 const struct inode_operations sdcardfs_dir_iops = {
776 .create = sdcardfs_create,
777 .lookup = sdcardfs_lookup,
779 .permission = sdcardfs_permission,
781 .unlink = sdcardfs_unlink,
782 .mkdir = sdcardfs_mkdir,
783 .rmdir = sdcardfs_rmdir,
784 .rename = sdcardfs_rename,
785 .setattr = sdcardfs_setattr,
786 .getattr = sdcardfs_getattr,
787 /* XXX Following operations are implemented,
788 * but FUSE(sdcard) or FAT does not support them
789 * These methods are *NOT* perfectly tested.
790 .symlink = sdcardfs_symlink,
791 .link = sdcardfs_link,
792 .mknod = sdcardfs_mknod,
796 const struct inode_operations sdcardfs_main_iops = {
797 .permission = sdcardfs_permission,
798 .setattr = sdcardfs_setattr,
799 .getattr = sdcardfs_getattr,