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.
23 /* Do not directly use this function. Use OVERRIDE_CRED() instead. */
24 const struct cred * override_fsids(struct sdcardfs_sb_info* sbi)
27 const struct cred * old_cred;
29 cred = prepare_creds();
33 cred->fsuid = make_kuid(&init_user_ns, sbi->options.fs_low_uid);
34 cred->fsgid = make_kgid(&init_user_ns, sbi->options.fs_low_gid);
36 old_cred = override_creds(cred);
41 /* Do not directly use this function, use REVERT_CRED() instead. */
42 void revert_fsids(const struct cred * old_cred)
44 const struct cred * cur_cred;
46 cur_cred = current->cred;
47 revert_creds(old_cred);
51 static int sdcardfs_create(struct inode *dir, struct dentry *dentry,
52 umode_t mode, bool want_excl)
55 struct dentry *lower_dentry;
56 struct dentry *lower_parent_dentry = NULL;
57 struct path lower_path;
58 const struct cred *saved_cred = NULL;
60 if(!check_caller_access_to_name(dir, dentry->d_name.name)) {
61 printk(KERN_INFO "%s: need to check the caller's gid in packages.list\n"
62 " dentry: %s, task:%s\n",
63 __func__, dentry->d_name.name, current->comm);
68 /* save current_cred and override it */
69 OVERRIDE_CRED(SDCARDFS_SB(dir->i_sb), saved_cred);
71 sdcardfs_get_lower_path(dentry, &lower_path);
72 lower_dentry = lower_path.dentry;
73 lower_parent_dentry = lock_parent(lower_dentry);
75 /* set last 16bytes of mode field to 0664 */
76 mode = (mode & S_IFMT) | 00664;
77 err = vfs_create(d_inode(lower_parent_dentry), lower_dentry, mode, want_excl);
81 err = sdcardfs_interpose(dentry, dir->i_sb, &lower_path, SDCARDFS_I(dir)->userid);
84 fsstack_copy_attr_times(dir, sdcardfs_lower_inode(dir));
85 fsstack_copy_inode_size(dir, d_inode(lower_parent_dentry));
88 unlock_dir(lower_parent_dentry);
89 sdcardfs_put_lower_path(dentry, &lower_path);
90 REVERT_CRED(saved_cred);
96 static int sdcardfs_link(struct dentry *old_dentry, struct inode *dir,
97 struct dentry *new_dentry)
99 struct dentry *lower_old_dentry;
100 struct dentry *lower_new_dentry;
101 struct dentry *lower_dir_dentry;
104 struct path lower_old_path, lower_new_path;
106 OVERRIDE_CRED(SDCARDFS_SB(dir->i_sb));
108 file_size_save = i_size_read(d_inode(old_dentry));
109 sdcardfs_get_lower_path(old_dentry, &lower_old_path);
110 sdcardfs_get_lower_path(new_dentry, &lower_new_path);
111 lower_old_dentry = lower_old_path.dentry;
112 lower_new_dentry = lower_new_path.dentry;
113 lower_dir_dentry = lock_parent(lower_new_dentry);
115 err = vfs_link(lower_old_dentry, d_inode(lower_dir_dentry),
116 lower_new_dentry, NULL);
117 if (err || !d_inode(lower_new_dentry))
120 err = sdcardfs_interpose(new_dentry, dir->i_sb, &lower_new_path);
123 fsstack_copy_attr_times(dir, d_inode(lower_new_dentry));
124 fsstack_copy_inode_size(dir, d_inode(lower_new_dentry));
125 set_nlink(d_inode(old_dentry),
126 sdcardfs_lower_inode(d_inode(old_dentry))->i_nlink);
127 i_size_write(d_inode(new_dentry), file_size_save);
129 unlock_dir(lower_dir_dentry);
130 sdcardfs_put_lower_path(old_dentry, &lower_old_path);
131 sdcardfs_put_lower_path(new_dentry, &lower_new_path);
137 static int sdcardfs_unlink(struct inode *dir, struct dentry *dentry)
140 struct dentry *lower_dentry;
141 struct inode *lower_dir_inode = sdcardfs_lower_inode(dir);
142 struct dentry *lower_dir_dentry;
143 struct path lower_path;
144 const struct cred *saved_cred = NULL;
146 if(!check_caller_access_to_name(dir, dentry->d_name.name)) {
147 printk(KERN_INFO "%s: need to check the caller's gid in packages.list\n"
148 " dentry: %s, task:%s\n",
149 __func__, dentry->d_name.name, current->comm);
154 /* save current_cred and override it */
155 OVERRIDE_CRED(SDCARDFS_SB(dir->i_sb), saved_cred);
157 sdcardfs_get_lower_path(dentry, &lower_path);
158 lower_dentry = lower_path.dentry;
160 lower_dir_dentry = lock_parent(lower_dentry);
162 err = vfs_unlink(lower_dir_inode, lower_dentry, NULL);
165 * Note: unlinking on top of NFS can cause silly-renamed files.
166 * Trying to delete such files results in EBUSY from NFS
167 * below. Silly-renamed files will get deleted by NFS later on, so
168 * we just need to detect them here and treat such EBUSY errors as
169 * if the upper file was successfully deleted.
171 if (err == -EBUSY && lower_dentry->d_flags & DCACHE_NFSFS_RENAMED)
175 fsstack_copy_attr_times(dir, lower_dir_inode);
176 fsstack_copy_inode_size(dir, lower_dir_inode);
177 set_nlink(d_inode(dentry),
178 sdcardfs_lower_inode(d_inode(dentry))->i_nlink);
179 d_inode(dentry)->i_ctime = dir->i_ctime;
180 d_drop(dentry); /* this is needed, else LTP fails (VFS won't do it) */
182 unlock_dir(lower_dir_dentry);
184 sdcardfs_put_lower_path(dentry, &lower_path);
185 REVERT_CRED(saved_cred);
191 static int sdcardfs_symlink(struct inode *dir, struct dentry *dentry,
195 struct dentry *lower_dentry;
196 struct dentry *lower_parent_dentry = NULL;
197 struct path lower_path;
199 OVERRIDE_CRED(SDCARDFS_SB(dir->i_sb));
201 sdcardfs_get_lower_path(dentry, &lower_path);
202 lower_dentry = lower_path.dentry;
203 lower_parent_dentry = lock_parent(lower_dentry);
205 err = vfs_symlink(d_inode(lower_parent_dentry), lower_dentry, symname);
208 err = sdcardfs_interpose(dentry, dir->i_sb, &lower_path);
211 fsstack_copy_attr_times(dir, sdcardfs_lower_inode(dir));
212 fsstack_copy_inode_size(dir, d_inode(lower_parent_dentry));
215 unlock_dir(lower_parent_dentry);
216 sdcardfs_put_lower_path(dentry, &lower_path);
222 static int touch(char *abs_path, mode_t mode) {
223 struct file *filp = filp_open(abs_path, O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW, mode);
225 if (PTR_ERR(filp) == -EEXIST) {
229 printk(KERN_ERR "sdcardfs: failed to open(%s): %ld\n",
230 abs_path, PTR_ERR(filp));
231 return PTR_ERR(filp);
234 filp_close(filp, current->files);
238 static int sdcardfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
241 int make_nomedia_in_obb = 0;
242 struct dentry *lower_dentry;
243 struct dentry *lower_parent_dentry = NULL;
244 struct path lower_path;
245 struct sdcardfs_sb_info *sbi = SDCARDFS_SB(dentry->d_sb);
246 const struct cred *saved_cred = NULL;
247 struct sdcardfs_inode_info *pi = SDCARDFS_I(dir);
249 char *nomedia_dir_name;
250 char *nomedia_fullpath;
251 int fullpath_namelen;
254 if(!check_caller_access_to_name(dir, dentry->d_name.name)) {
255 printk(KERN_INFO "%s: need to check the caller's gid in packages.list\n"
256 " dentry: %s, task:%s\n",
257 __func__, dentry->d_name.name, current->comm);
262 /* save current_cred and override it */
263 OVERRIDE_CRED(SDCARDFS_SB(dir->i_sb), saved_cred);
265 /* check disk space */
266 if (!check_min_free_space(dentry, 0, 1)) {
267 printk(KERN_INFO "sdcardfs: No minimum free space.\n");
272 /* the lower_dentry is negative here */
273 sdcardfs_get_lower_path(dentry, &lower_path);
274 lower_dentry = lower_path.dentry;
275 lower_parent_dentry = lock_parent(lower_dentry);
277 /* set last 16bytes of mode field to 0775 */
278 mode = (mode & S_IFMT) | 00775;
279 err = vfs_mkdir(d_inode(lower_parent_dentry), lower_dentry, mode);
284 /* if it is a local obb dentry, setup it with the base obbpath */
285 if(need_graft_path(dentry)) {
287 err = setup_obb_dentry(dentry, &lower_path);
289 /* if the sbi->obbpath is not available, the lower_path won't be
290 * changed by setup_obb_dentry() but the lower path is saved to
291 * its orig_path. this dentry will be revalidated later.
292 * but now, the lower_path should be NULL */
293 sdcardfs_put_reset_lower_path(dentry);
295 /* the newly created lower path which saved to its orig_path or
296 * the lower_path is the base obbpath.
297 * therefore, an additional path_get is required */
298 path_get(&lower_path);
300 make_nomedia_in_obb = 1;
303 err = sdcardfs_interpose(dentry, dir->i_sb, &lower_path, pi->userid);
307 fsstack_copy_attr_times(dir, sdcardfs_lower_inode(dir));
308 fsstack_copy_inode_size(dir, d_inode(lower_parent_dentry));
309 /* update number of links on parent directory */
310 set_nlink(dir, sdcardfs_lower_inode(dir)->i_nlink);
312 if ((!sbi->options.multiuser) && (!strcasecmp(dentry->d_name.name, "obb"))
313 && (pi->perm == PERM_ANDROID) && (pi->userid == 0))
314 make_nomedia_in_obb = 1;
316 /* When creating /Android/data and /Android/obb, mark them as .nomedia */
317 if (make_nomedia_in_obb ||
318 ((pi->perm == PERM_ANDROID) && (!strcasecmp(dentry->d_name.name, "data")))) {
320 page_buf = (char *)__get_free_page(GFP_KERNEL);
322 printk(KERN_ERR "sdcardfs: failed to allocate page buf\n");
326 nomedia_dir_name = d_absolute_path(&lower_path, page_buf, PAGE_SIZE);
327 if (IS_ERR(nomedia_dir_name)) {
328 free_page((unsigned long)page_buf);
329 printk(KERN_ERR "sdcardfs: failed to get .nomedia dir name\n");
333 fullpath_namelen = page_buf + PAGE_SIZE - nomedia_dir_name - 1;
334 fullpath_namelen += strlen("/.nomedia");
335 nomedia_fullpath = kzalloc(fullpath_namelen + 1, GFP_KERNEL);
336 if (!nomedia_fullpath) {
337 free_page((unsigned long)page_buf);
338 printk(KERN_ERR "sdcardfs: failed to allocate .nomedia fullpath buf\n");
342 strcpy(nomedia_fullpath, nomedia_dir_name);
343 free_page((unsigned long)page_buf);
344 strcat(nomedia_fullpath, "/.nomedia");
345 touch_err = touch(nomedia_fullpath, 0664);
347 printk(KERN_ERR "sdcardfs: failed to touch(%s): %d\n",
348 nomedia_fullpath, touch_err);
349 kfree(nomedia_fullpath);
352 kfree(nomedia_fullpath);
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 mutex_lock(&d_inode(old_dentry)->i_mutex);
517 get_derived_permission_new(new_dentry->d_parent, old_dentry, new_dentry);
518 fix_derived_permission(d_inode(old_dentry));
519 get_derive_permissions_recursive(old_dentry);
520 mutex_unlock(&d_inode(old_dentry)->i_mutex);
522 unlock_rename(lower_old_dir_dentry, lower_new_dir_dentry);
523 dput(lower_old_dir_dentry);
524 dput(lower_new_dir_dentry);
525 sdcardfs_put_real_lower(old_dentry, &lower_old_path);
526 sdcardfs_put_lower_path(new_dentry, &lower_new_path);
527 REVERT_CRED(saved_cred);
533 static int sdcardfs_readlink(struct dentry *dentry, char __user *buf, int bufsiz)
536 struct dentry *lower_dentry;
537 struct path lower_path;
538 /* XXX readlink does not requires overriding credential */
540 sdcardfs_get_lower_path(dentry, &lower_path);
541 lower_dentry = lower_path.dentry;
542 if (!d_inode(lower_dentry)->i_op ||
543 !d_inode(lower_dentry)->i_op->readlink) {
548 err = d_inode(lower_dentry)->i_op->readlink(lower_dentry,
552 fsstack_copy_attr_atime(d_inode(dentry), d_inode(lower_dentry));
555 sdcardfs_put_lower_path(dentry, &lower_path);
561 static const char *sdcardfs_follow_link(struct dentry *dentry, void **cookie)
564 int len = PAGE_SIZE, err;
567 /* This is freed by the put_link method assuming a successful call. */
568 buf = kmalloc(len, GFP_KERNEL);
570 buf = ERR_PTR(-ENOMEM);
574 /* read the symlink, and then we will follow it */
577 err = sdcardfs_readlink(dentry, buf, len);
585 return *cookie = buf;
589 static int sdcardfs_permission(struct inode *inode, int mask)
594 * Permission check on sdcardfs inode.
595 * Calling process should have AID_SDCARD_RW permission
597 err = generic_permission(inode, mask);
600 * Original sdcardfs code calls inode_permission(lower_inode,.. )
601 * for checking inode permission. But doing such things here seems
602 * duplicated work, because the functions called after this func,
603 * such as vfs_create, vfs_unlink, vfs_rename, and etc,
604 * does exactly same thing, i.e., they calls inode_permission().
605 * So we just let they do the things.
606 * If there are any security hole, just uncomment following if block.
611 * Permission check on lower_inode(=EXT4).
612 * we check it with AID_MEDIA_RW permission
614 struct inode *lower_inode;
615 OVERRIDE_CRED(SDCARDFS_SB(inode->sb));
617 lower_inode = sdcardfs_lower_inode(inode);
618 err = inode_permission(lower_inode, mask);
627 static int sdcardfs_setattr(struct dentry *dentry, struct iattr *ia)
630 struct dentry *lower_dentry;
632 struct inode *lower_inode;
633 struct path lower_path;
634 struct iattr lower_ia;
635 struct dentry *parent;
637 inode = d_inode(dentry);
640 * Check if user has permission to change inode. We don't check if
641 * this user can change the lower inode: that should happen when
642 * calling notify_change on the lower inode.
644 err = inode_change_ok(inode, ia);
646 /* no vfs_XXX operations required, cred overriding will be skipped. wj*/
648 /* check the Android group ID */
649 parent = dget_parent(dentry);
650 if(!check_caller_access_to_name(d_inode(parent), dentry->d_name.name)) {
651 printk(KERN_INFO "%s: need to check the caller's gid in packages.list\n"
652 " dentry: %s, task:%s\n",
653 __func__, dentry->d_name.name, current->comm);
662 sdcardfs_get_lower_path(dentry, &lower_path);
663 lower_dentry = lower_path.dentry;
664 lower_inode = sdcardfs_lower_inode(inode);
666 /* prepare our own lower struct iattr (with the lower file) */
667 memcpy(&lower_ia, ia, sizeof(lower_ia));
668 if (ia->ia_valid & ATTR_FILE)
669 lower_ia.ia_file = sdcardfs_lower_file(ia->ia_file);
671 lower_ia.ia_valid &= ~(ATTR_UID | ATTR_GID | ATTR_MODE);
674 * If shrinking, first truncate upper level to cancel writing dirty
675 * pages beyond the new eof; and also if its' maxbytes is more
676 * limiting (fail with -EFBIG before making any change to the lower
677 * level). There is no need to vmtruncate the upper level
678 * afterwards in the other cases: we fsstack_copy_inode_size from
682 down_write(¤t->mm->mmap_sem);
683 if (ia->ia_valid & ATTR_SIZE) {
684 err = inode_newsize_ok(inode, ia->ia_size);
687 up_write(¤t->mm->mmap_sem);
690 truncate_setsize(inode, ia->ia_size);
694 * mode change is for clearing setuid/setgid bits. Allow lower fs
695 * to interpret this in its own way.
697 if (lower_ia.ia_valid & (ATTR_KILL_SUID | ATTR_KILL_SGID))
698 lower_ia.ia_valid &= ~ATTR_MODE;
700 /* notify the (possibly copied-up) lower inode */
702 * Note: we use d_inode(lower_dentry), because lower_inode may be
703 * unlinked (no inode->i_sb and i_ino==0. This happens if someone
704 * tries to open(), unlink(), then ftruncate() a file.
706 mutex_lock(&d_inode(lower_dentry)->i_mutex);
707 err = notify_change(lower_dentry, &lower_ia, /* note: lower_ia */
709 mutex_unlock(&d_inode(lower_dentry)->i_mutex);
711 up_write(¤t->mm->mmap_sem);
715 /* get attributes from the lower inode and update derived permissions */
716 sdcardfs_copy_and_fix_attrs(inode, lower_inode);
719 * Not running fsstack_copy_inode_size(inode, lower_inode), because
720 * VFS should update our inode size, and notify_change on
721 * lower_inode should update its size.
725 sdcardfs_put_lower_path(dentry, &lower_path);
730 static int sdcardfs_getattr(struct vfsmount *mnt, struct dentry *dentry,
733 struct dentry *lower_dentry;
735 struct inode *lower_inode;
736 struct path lower_path;
737 struct dentry *parent;
739 parent = dget_parent(dentry);
740 if(!check_caller_access_to_name(d_inode(parent), dentry->d_name.name)) {
741 printk(KERN_INFO "%s: need to check the caller's gid in packages.list\n"
742 " dentry: %s, task:%s\n",
743 __func__, dentry->d_name.name, current->comm);
749 inode = d_inode(dentry);
751 sdcardfs_get_lower_path(dentry, &lower_path);
752 lower_dentry = lower_path.dentry;
753 lower_inode = sdcardfs_lower_inode(inode);
756 sdcardfs_copy_and_fix_attrs(inode, lower_inode);
757 fsstack_copy_inode_size(inode, lower_inode);
760 generic_fillattr(inode, stat);
761 sdcardfs_put_lower_path(dentry, &lower_path);
765 const struct inode_operations sdcardfs_symlink_iops = {
766 .permission = sdcardfs_permission,
767 .setattr = sdcardfs_setattr,
768 /* XXX Following operations are implemented,
769 * but FUSE(sdcard) or FAT does not support them
770 * These methods are *NOT* perfectly tested.
771 .readlink = sdcardfs_readlink,
772 .follow_link = sdcardfs_follow_link,
773 .put_link = kfree_put_link,
777 const struct inode_operations sdcardfs_dir_iops = {
778 .create = sdcardfs_create,
779 .lookup = sdcardfs_lookup,
781 .permission = sdcardfs_permission,
783 .unlink = sdcardfs_unlink,
784 .mkdir = sdcardfs_mkdir,
785 .rmdir = sdcardfs_rmdir,
786 .rename = sdcardfs_rename,
787 .setattr = sdcardfs_setattr,
788 .getattr = sdcardfs_getattr,
789 /* XXX Following operations are implemented,
790 * but FUSE(sdcard) or FAT does not support them
791 * These methods are *NOT* perfectly tested.
792 .symlink = sdcardfs_symlink,
793 .link = sdcardfs_link,
794 .mknod = sdcardfs_mknod,
798 const struct inode_operations sdcardfs_main_iops = {
799 .permission = sdcardfs_permission,
800 .setattr = sdcardfs_setattr,
801 .getattr = sdcardfs_getattr,