Skip to content

Commit

Permalink
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/mfasheh/ocfs2

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2:
  [PATCH] ocfs2: fix oops in mmap_truncate testing
  configfs: call drop_link() to cleanup after create_link() failure
  configfs: Allow ->make_item() and ->make_group() to return detailed errors.
  configfs: Fix failing mkdir() making racing rmdir() fail
  configfs: Fix deadlock with racing rmdir() and rename()
  configfs: Make configfs_new_dirent() return error code instead of NULL
  configfs: Protect configfs_dirent s_links list mutations
  configfs: Introduce configfs_dirent_lock
  ocfs2: Don't snprintf() without a format.
  ocfs2: Fix CONFIG_OCFS2_DEBUG_FS #ifdefs
  ocfs2/net: Silence build warnings on sparc64
  ocfs2: Handle error during journal load
  ocfs2: Silence an error message in ocfs2_file_aio_read()
  ocfs2: use simple_read_from_buffer()
  ocfs2: fix printk format warnings with OCFS2_FS_STATS=n
  [PATCH 2/2] ocfs2: Instrument fs cluster locks
  [PATCH 1/2] ocfs2: Add CONFIG_OCFS2_FS_STATS config option
  • Loading branch information
Linus Torvalds committed Jul 17, 2008
2 parents f39548a + c0420ad commit 5b664cb
Show file tree
Hide file tree
Showing 22 changed files with 383 additions and 127 deletions.
10 changes: 6 additions & 4 deletions Documentation/filesystems/configfs/configfs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,12 @@ accomplished via the group operations specified on the group's
config_item_type.

struct configfs_group_operations {
struct config_item *(*make_item)(struct config_group *group,
const char *name);
struct config_group *(*make_group)(struct config_group *group,
const char *name);
int (*make_item)(struct config_group *group,
const char *name,
struct config_item **new_item);
int (*make_group)(struct config_group *group,
const char *name,
struct config_group **new_group);
int (*commit_item)(struct config_item *item);
void (*disconnect_notify)(struct config_group *group,
struct config_item *item);
Expand Down
14 changes: 8 additions & 6 deletions Documentation/filesystems/configfs/configfs_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,21 +273,22 @@ static inline struct simple_children *to_simple_children(struct config_item *ite
return item ? container_of(to_config_group(item), struct simple_children, group) : NULL;
}

static struct config_item *simple_children_make_item(struct config_group *group, const char *name)
static int simple_children_make_item(struct config_group *group, const char *name, struct config_item **new_item)
{
struct simple_child *simple_child;

simple_child = kzalloc(sizeof(struct simple_child), GFP_KERNEL);
if (!simple_child)
return NULL;
return -ENOMEM;


config_item_init_type_name(&simple_child->item, name,
&simple_child_type);

simple_child->storeme = 0;

return &simple_child->item;
*new_item = &simple_child->item;
return 0;
}

static struct configfs_attribute simple_children_attr_description = {
Expand Down Expand Up @@ -359,20 +360,21 @@ static struct configfs_subsystem simple_children_subsys = {
* children of its own.
*/

static struct config_group *group_children_make_group(struct config_group *group, const char *name)
static int group_children_make_group(struct config_group *group, const char *name, struct config_group **new_group)
{
struct simple_children *simple_children;

simple_children = kzalloc(sizeof(struct simple_children),
GFP_KERNEL);
if (!simple_children)
return NULL;
return -ENOMEM;


config_group_init_type_name(&simple_children->group, name,
&simple_children_type);

return &simple_children->group;
*new_group = &simple_children->group;
return 0;
}

static struct configfs_attribute group_children_attr_description = {
Expand Down
10 changes: 6 additions & 4 deletions drivers/net/netconsole.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,9 @@ static struct config_item_type netconsole_target_type = {
* Group operations and type for netconsole_subsys.
*/

static struct config_item *make_netconsole_target(struct config_group *group,
const char *name)
static int make_netconsole_target(struct config_group *group,
const char *name,
struct config_item **new_item)
{
unsigned long flags;
struct netconsole_target *nt;
Expand All @@ -598,7 +599,7 @@ static struct config_item *make_netconsole_target(struct config_group *group,
nt = kzalloc(sizeof(*nt), GFP_KERNEL);
if (!nt) {
printk(KERN_ERR "netconsole: failed to allocate memory\n");
return NULL;
return -ENOMEM;
}

nt->np.name = "netconsole";
Expand All @@ -615,7 +616,8 @@ static struct config_item *make_netconsole_target(struct config_group *group,
list_add(&nt->list, &target_list);
spin_unlock_irqrestore(&target_list_lock, flags);

return &nt->item;
*new_item = &nt->item;
return 0;
}

static void drop_netconsole_target(struct config_group *group,
Expand Down
8 changes: 8 additions & 0 deletions fs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,14 @@ config OCFS2_FS_USERSPACE_CLUSTER
It is safe to say Y, as the clustering method is run-time
selectable.

config OCFS2_FS_STATS
bool "OCFS2 statistics"
depends on OCFS2_FS
default y
help
This option allows some fs statistics to be captured. Enabling
this option may increase the memory consumption.

config OCFS2_DEBUG_MASKLOG
bool "OCFS2 logging support"
depends on OCFS2_FS
Expand Down
4 changes: 4 additions & 0 deletions fs/configfs/configfs_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <linux/slab.h>
#include <linux/list.h>
#include <linux/spinlock.h>

struct configfs_dirent {
atomic_t s_count;
Expand All @@ -47,8 +48,11 @@ struct configfs_dirent {
#define CONFIGFS_USET_DIR 0x0040
#define CONFIGFS_USET_DEFAULT 0x0080
#define CONFIGFS_USET_DROPPING 0x0100
#define CONFIGFS_USET_IN_MKDIR 0x0200
#define CONFIGFS_NOT_PINNED (CONFIGFS_ITEM_ATTR)

extern spinlock_t configfs_dirent_lock;

extern struct vfsmount * configfs_mount;
extern struct kmem_cache *configfs_dir_cachep;

Expand Down
Loading

0 comments on commit 5b664cb

Please sign in to comment.