Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

convert functionfs

All files are regular; ep0 is there all along, other ep* may appear
and go away during the filesystem lifetime; all of those are guaranteed
to be gone by the time we umount it.

Object creation is in ffs_sb_create_file(), removals - at ->kill_sb()
time (for ep0) or by simple_remove_by_name() from ffs_epfiles_destroy()
(for the rest of them).

Switch ffs_sb_create_file() to simple_start_creating()/d_make_persistent()/
simple_done_creating() and that's it.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 6ca67378 c7747faf

+9 -8
+9 -8
drivers/usb/gadget/function/f_fs.c
··· 1899 1899 struct dentry *dentry; 1900 1900 struct inode *inode; 1901 1901 1902 - dentry = d_alloc_name(sb->s_root, name); 1903 - if (!dentry) 1904 - return -ENOMEM; 1905 - 1906 1902 inode = ffs_sb_make_inode(sb, data, fops, NULL, &ffs->file_perms); 1907 - if (!inode) { 1908 - dput(dentry); 1903 + if (!inode) 1909 1904 return -ENOMEM; 1905 + dentry = simple_start_creating(sb->s_root, name); 1906 + if (IS_ERR(dentry)) { 1907 + iput(inode); 1908 + return PTR_ERR(dentry); 1910 1909 } 1911 1910 1912 - d_add(dentry, inode); 1911 + d_make_persistent(dentry, inode); 1912 + 1913 + simple_done_creating(dentry); 1913 1914 return 0; 1914 1915 } 1915 1916 ··· 2099 2098 static void 2100 2099 ffs_fs_kill_sb(struct super_block *sb) 2101 2100 { 2102 - kill_litter_super(sb); 2101 + kill_anon_super(sb); 2103 2102 if (sb->s_fs_info) { 2104 2103 struct ffs_data *ffs = sb->s_fs_info; 2105 2104 ffs->state = FFS_CLOSING;