sysfs.c (d93618da6b6d453c6a9684a3460ffd51b9b4ef2e) sysfs.c (39bfcb8138f6dc3375f23b1e62ccfc7c0d83295d)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Copyright (C), 2008-2021, OPPO Mobile Comm Corp., Ltd.
4 * https://www.oppo.com/
5 */
6#include <linux/sysfs.h>
7#include <linux/kobject.h>
8

--- 196 unchanged lines hidden (view full) ---

205int erofs_register_sysfs(struct super_block *sb)
206{
207 struct erofs_sb_info *sbi = EROFS_SB(sb);
208 char *name;
209 char *str = NULL;
210 int err;
211
212 if (erofs_is_fscache_mode(sb)) {
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Copyright (C), 2008-2021, OPPO Mobile Comm Corp., Ltd.
4 * https://www.oppo.com/
5 */
6#include <linux/sysfs.h>
7#include <linux/kobject.h>
8

--- 196 unchanged lines hidden (view full) ---

205int erofs_register_sysfs(struct super_block *sb)
206{
207 struct erofs_sb_info *sbi = EROFS_SB(sb);
208 char *name;
209 char *str = NULL;
210 int err;
211
212 if (erofs_is_fscache_mode(sb)) {
213 if (sbi->opt.domain_id) {
214 str = kasprintf(GFP_KERNEL, "%s,%s", sbi->opt.domain_id,
215 sbi->opt.fsid);
213 if (sbi->domain_id) {
214 str = kasprintf(GFP_KERNEL, "%s,%s", sbi->domain_id,
215 sbi->fsid);
216 if (!str)
217 return -ENOMEM;
218 name = str;
219 } else {
216 if (!str)
217 return -ENOMEM;
218 name = str;
219 } else {
220 name = sbi->opt.fsid;
220 name = sbi->fsid;
221 }
222 } else {
223 name = sb->s_id;
224 }
225 sbi->s_kobj.kset = &erofs_root;
226 init_completion(&sbi->s_kobj_unregister);
227 err = kobject_init_and_add(&sbi->s_kobj, &erofs_sb_ktype, NULL, "%s", name);
228 kfree(str);

--- 49 unchanged lines hidden ---
221 }
222 } else {
223 name = sb->s_id;
224 }
225 sbi->s_kobj.kset = &erofs_root;
226 init_completion(&sbi->s_kobj_unregister);
227 err = kobject_init_and_add(&sbi->s_kobj, &erofs_sb_ktype, NULL, "%s", name);
228 kfree(str);

--- 49 unchanged lines hidden ---