~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/fs/ocfs2/cluster/sys.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0-only
  2 /*
  3  * sys.c
  4  *
  5  * OCFS2 cluster sysfs interface
  6  *
  7  * Copyright (C) 2005 Oracle.  All rights reserved.
  8  */
  9 
 10 #include <linux/kernel.h>
 11 #include <linux/module.h>
 12 #include <linux/kobject.h>
 13 #include <linux/sysfs.h>
 14 #include <linux/fs.h>
 15 
 16 #include "ocfs2_nodemanager.h"
 17 #include "masklog.h"
 18 #include "sys.h"
 19 
 20 
 21 static ssize_t version_show(struct kobject *kobj, struct kobj_attribute *attr,
 22                             char *buf)
 23 {
 24         return snprintf(buf, PAGE_SIZE, "%u\n", O2NM_API_VERSION);
 25 }
 26 static struct kobj_attribute attr_version =
 27         __ATTR(interface_revision, S_IRUGO, version_show, NULL);
 28 
 29 static struct attribute *o2cb_attrs[] = {
 30         &attr_version.attr,
 31         NULL,
 32 };
 33 
 34 static struct attribute_group o2cb_attr_group = {
 35         .attrs = o2cb_attrs,
 36 };
 37 
 38 static struct kset *o2cb_kset;
 39 
 40 void o2cb_sys_shutdown(void)
 41 {
 42         mlog_sys_shutdown();
 43         kset_unregister(o2cb_kset);
 44 }
 45 
 46 int o2cb_sys_init(void)
 47 {
 48         int ret;
 49 
 50         o2cb_kset = kset_create_and_add("o2cb", NULL, fs_kobj);
 51         if (!o2cb_kset)
 52                 return -ENOMEM;
 53 
 54         ret = sysfs_create_group(&o2cb_kset->kobj, &o2cb_attr_group);
 55         if (ret)
 56                 goto error;
 57 
 58         ret = mlog_sys_init(o2cb_kset);
 59         if (ret)
 60                 goto error;
 61         return 0;
 62 error:
 63         kset_unregister(o2cb_kset);
 64         return ret;
 65 }
 66 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php