Skip to content

Commit 5b664cb

Browse files
committed
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/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
2 parents f39548a + c0420ad commit 5b664cb

File tree

22 files changed

+383
-127
lines changed

22 files changed

+383
-127
lines changed

Documentation/filesystems/configfs/configfs.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,12 @@ accomplished via the group operations specified on the group's
233233
config_item_type.
234234

235235
struct configfs_group_operations {
236-
struct config_item *(*make_item)(struct config_group *group,
237-
const char *name);
238-
struct config_group *(*make_group)(struct config_group *group,
239-
const char *name);
236+
int (*make_item)(struct config_group *group,
237+
const char *name,
238+
struct config_item **new_item);
239+
int (*make_group)(struct config_group *group,
240+
const char *name,
241+
struct config_group **new_group);
240242
int (*commit_item)(struct config_item *item);
241243
void (*disconnect_notify)(struct config_group *group,
242244
struct config_item *item);

Documentation/filesystems/configfs/configfs_example.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,21 +273,22 @@ static inline struct simple_children *to_simple_children(struct config_item *ite
273273
return item ? container_of(to_config_group(item), struct simple_children, group) : NULL;
274274
}
275275

276-
static struct config_item *simple_children_make_item(struct config_group *group, const char *name)
276+
static int simple_children_make_item(struct config_group *group, const char *name, struct config_item **new_item)
277277
{
278278
struct simple_child *simple_child;
279279

280280
simple_child = kzalloc(sizeof(struct simple_child), GFP_KERNEL);
281281
if (!simple_child)
282-
return NULL;
282+
return -ENOMEM;
283283

284284

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

288288
simple_child->storeme = 0;
289289

290-
return &simple_child->item;
290+
*new_item = &simple_child->item;
291+
return 0;
291292
}
292293

293294
static struct configfs_attribute simple_children_attr_description = {
@@ -359,20 +360,21 @@ static struct configfs_subsystem simple_children_subsys = {
359360
* children of its own.
360361
*/
361362

362-
static struct config_group *group_children_make_group(struct config_group *group, const char *name)
363+
static int group_children_make_group(struct config_group *group, const char *name, struct config_group **new_group)
363364
{
364365
struct simple_children *simple_children;
365366

366367
simple_children = kzalloc(sizeof(struct simple_children),
367368
GFP_KERNEL);
368369
if (!simple_children)
369-
return NULL;
370+
return -ENOMEM;
370371

371372

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

375-
return &simple_children->group;
376+
*new_group = &simple_children->group;
377+
return 0;
376378
}
377379

378380
static struct configfs_attribute group_children_attr_description = {

drivers/net/netconsole.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -585,8 +585,9 @@ static struct config_item_type netconsole_target_type = {
585585
* Group operations and type for netconsole_subsys.
586586
*/
587587

588-
static struct config_item *make_netconsole_target(struct config_group *group,
589-
const char *name)
588+
static int make_netconsole_target(struct config_group *group,
589+
const char *name,
590+
struct config_item **new_item)
590591
{
591592
unsigned long flags;
592593
struct netconsole_target *nt;
@@ -598,7 +599,7 @@ static struct config_item *make_netconsole_target(struct config_group *group,
598599
nt = kzalloc(sizeof(*nt), GFP_KERNEL);
599600
if (!nt) {
600601
printk(KERN_ERR "netconsole: failed to allocate memory\n");
601-
return NULL;
602+
return -ENOMEM;
602603
}
603604

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

618-
return &nt->item;
619+
*new_item = &nt->item;
620+
return 0;
619621
}
620622

621623
static void drop_netconsole_target(struct config_group *group,

fs/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,14 @@ config OCFS2_FS_USERSPACE_CLUSTER
470470
It is safe to say Y, as the clustering method is run-time
471471
selectable.
472472

473+
config OCFS2_FS_STATS
474+
bool "OCFS2 statistics"
475+
depends on OCFS2_FS
476+
default y
477+
help
478+
This option allows some fs statistics to be captured. Enabling
479+
this option may increase the memory consumption.
480+
473481
config OCFS2_DEBUG_MASKLOG
474482
bool "OCFS2 logging support"
475483
depends on OCFS2_FS

fs/configfs/configfs_internal.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include <linux/slab.h>
2828
#include <linux/list.h>
29+
#include <linux/spinlock.h>
2930

3031
struct configfs_dirent {
3132
atomic_t s_count;
@@ -47,8 +48,11 @@ struct configfs_dirent {
4748
#define CONFIGFS_USET_DIR 0x0040
4849
#define CONFIGFS_USET_DEFAULT 0x0080
4950
#define CONFIGFS_USET_DROPPING 0x0100
51+
#define CONFIGFS_USET_IN_MKDIR 0x0200
5052
#define CONFIGFS_NOT_PINNED (CONFIGFS_ITEM_ATTR)
5153

54+
extern spinlock_t configfs_dirent_lock;
55+
5256
extern struct vfsmount * configfs_mount;
5357
extern struct kmem_cache *configfs_dir_cachep;
5458

0 commit comments

Comments
 (0)