Skip to content

Commit

Permalink
Merge branch 'upstream-linus' of git://oss.oracle.com/home/sourcebo/g…
Browse files Browse the repository at this point in the history
…it/ocfs2
  • Loading branch information
Linus Torvalds committed Feb 3, 2006
2 parents d6c8f6a + 6eff579 commit d1ffa56
Show file tree
Hide file tree
Showing 30 changed files with 507 additions and 158 deletions.
2 changes: 2 additions & 0 deletions Documentation/filesystems/configfs/configfs_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ static struct config_item_type simple_children_type = {
.ct_item_ops = &simple_children_item_ops,
.ct_group_ops = &simple_children_group_ops,
.ct_attrs = simple_children_attrs,
.ct_owner = THIS_MODULE,
};

static struct configfs_subsystem simple_children_subsys = {
Expand Down Expand Up @@ -403,6 +404,7 @@ static struct config_item_type group_children_type = {
.ct_item_ops = &group_children_item_ops,
.ct_group_ops = &group_children_group_ops,
.ct_attrs = group_children_attrs,
.ct_owner = THIS_MODULE,
};

static struct configfs_subsystem group_children_subsys = {
Expand Down
1 change: 1 addition & 0 deletions Documentation/filesystems/ocfs2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Features which OCFS2 does not support yet:
be cluster coherent.
- quotas
- cluster aware flock
- cluster aware lockf
- Directory change notification (F_NOTIFY)
- Distributed Caching (F_SETLEASE/F_GETLEASE/break_lease)
- POSIX ACLs
Expand Down
3 changes: 2 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,8 @@ S: Supported

CONFIGFS
P: Joel Becker
M: Joel Becker <joel.becker@oracle.com>
M: joel.becker@oracle.com
L: linux-kernel@vger.kernel.org
S: Supported

CIRRUS LOGIC GENERIC FBDEV DRIVER
Expand Down
2 changes: 0 additions & 2 deletions fs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -883,8 +883,6 @@ config CONFIGFS_FS
Both sysfs and configfs can and should exist together on the
same system. One is not a replacement for the other.

If unsure, say N.

endmenu

menu "Miscellaneous filesystems"
Expand Down
11 changes: 8 additions & 3 deletions fs/configfs/configfs_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ struct configfs_dirent {
int s_type;
umode_t s_mode;
struct dentry * s_dentry;
struct iattr * s_iattr;
};

#define CONFIGFS_ROOT 0x0001
Expand All @@ -48,10 +49,11 @@ struct configfs_dirent {
#define CONFIGFS_NOT_PINNED (CONFIGFS_ITEM_ATTR)

extern struct vfsmount * configfs_mount;
extern kmem_cache_t *configfs_dir_cachep;

extern int configfs_is_root(struct config_item *item);

extern struct inode * configfs_new_inode(mode_t mode);
extern struct inode * configfs_new_inode(mode_t mode, struct configfs_dirent *);
extern int configfs_create(struct dentry *, int mode, int (*init)(struct inode *));

extern int configfs_create_file(struct config_item *, const struct configfs_attribute *);
Expand All @@ -63,6 +65,7 @@ extern void configfs_hash_and_remove(struct dentry * dir, const char * name);

extern const unsigned char * configfs_get_name(struct configfs_dirent *sd);
extern void configfs_drop_dentry(struct configfs_dirent *sd, struct dentry *parent);
extern int configfs_setattr(struct dentry *dentry, struct iattr *iattr);

extern int configfs_pin_fs(void);
extern void configfs_release_fs(void);
Expand Down Expand Up @@ -120,8 +123,10 @@ static inline struct config_item *configfs_get_config_item(struct dentry *dentry

static inline void release_configfs_dirent(struct configfs_dirent * sd)
{
if (!(sd->s_type & CONFIGFS_ROOT))
kfree(sd);
if (!(sd->s_type & CONFIGFS_ROOT)) {
kfree(sd->s_iattr);
kmem_cache_free(configfs_dir_cachep, sd);
}
}

static inline struct configfs_dirent * configfs_get(struct configfs_dirent * sd)
Expand Down
36 changes: 26 additions & 10 deletions fs/configfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static struct configfs_dirent *configfs_new_dirent(struct configfs_dirent * pare
{
struct configfs_dirent * sd;

sd = kmalloc(sizeof(*sd), GFP_KERNEL);
sd = kmem_cache_alloc(configfs_dir_cachep, GFP_KERNEL);
if (!sd)
return NULL;

Expand Down Expand Up @@ -136,13 +136,19 @@ static int create_dir(struct config_item * k, struct dentry * p,
int error;
umode_t mode = S_IFDIR| S_IRWXU | S_IRUGO | S_IXUGO;

error = configfs_create(d, mode, init_dir);
error = configfs_make_dirent(p->d_fsdata, d, k, mode,
CONFIGFS_DIR);
if (!error) {
error = configfs_make_dirent(p->d_fsdata, d, k, mode,
CONFIGFS_DIR);
error = configfs_create(d, mode, init_dir);
if (!error) {
p->d_inode->i_nlink++;
(d)->d_op = &configfs_dentry_ops;
} else {
struct configfs_dirent *sd = d->d_fsdata;
if (sd) {
list_del_init(&sd->s_sibling);
configfs_put(sd);
}
}
}
return error;
Expand Down Expand Up @@ -182,12 +188,19 @@ int configfs_create_link(struct configfs_symlink *sl,
int err = 0;
umode_t mode = S_IFLNK | S_IRWXUGO;

err = configfs_create(dentry, mode, init_symlink);
err = configfs_make_dirent(parent->d_fsdata, dentry, sl, mode,
CONFIGFS_ITEM_LINK);
if (!err) {
err = configfs_make_dirent(parent->d_fsdata, dentry, sl,
mode, CONFIGFS_ITEM_LINK);
err = configfs_create(dentry, mode, init_symlink);
if (!err)
dentry->d_op = &configfs_dentry_ops;
else {
struct configfs_dirent *sd = dentry->d_fsdata;
if (sd) {
list_del_init(&sd->s_sibling);
configfs_put(sd);
}
}
}
return err;
}
Expand Down Expand Up @@ -241,13 +254,15 @@ static int configfs_attach_attr(struct configfs_dirent * sd, struct dentry * den
struct configfs_attribute * attr = sd->s_element;
int error;

dentry->d_fsdata = configfs_get(sd);
sd->s_dentry = dentry;
error = configfs_create(dentry, (attr->ca_mode & S_IALLUGO) | S_IFREG, init_file);
if (error)
if (error) {
configfs_put(sd);
return error;
}

dentry->d_op = &configfs_dentry_ops;
dentry->d_fsdata = configfs_get(sd);
sd->s_dentry = dentry;
d_rehash(dentry);

return 0;
Expand Down Expand Up @@ -839,6 +854,7 @@ struct inode_operations configfs_dir_inode_operations = {
.symlink = configfs_symlink,
.unlink = configfs_unlink,
.lookup = configfs_lookup,
.setattr = configfs_setattr,
};

#if 0
Expand Down
19 changes: 10 additions & 9 deletions fs/configfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

#include <linux/fs.h>
#include <linux/module.h>
#include <linux/dnotify.h>
#include <linux/slab.h>
#include <asm/uaccess.h>
#include <asm/semaphore.h>
Expand Down Expand Up @@ -150,7 +149,7 @@ configfs_read_file(struct file *file, char __user *buf, size_t count, loff_t *pp
/**
* fill_write_buffer - copy buffer from userspace.
* @buffer: data buffer for file.
* @userbuf: data from user.
* @buf: data from user.
* @count: number of bytes in @userbuf.
*
* Allocate @buffer->page if it hasn't been already, then
Expand All @@ -177,8 +176,9 @@ fill_write_buffer(struct configfs_buffer * buffer, const char __user * buf, size

/**
* flush_write_buffer - push buffer to config_item.
* @file: file pointer.
* @dentry: dentry to the attribute
* @buffer: data buffer for file.
* @count: number of bytes
*
* Get the correct pointers for the config_item and the attribute we're
* dealing with, then call the store() method for the attribute,
Expand Down Expand Up @@ -217,15 +217,16 @@ static ssize_t
configfs_write_file(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
struct configfs_buffer * buffer = file->private_data;
ssize_t len;

down(&buffer->sem);
count = fill_write_buffer(buffer,buf,count);
if (count > 0)
count = flush_write_buffer(file->f_dentry,buffer,count);
if (count > 0)
*ppos += count;
len = fill_write_buffer(buffer, buf, count);
if (len > 0)
len = flush_write_buffer(file->f_dentry, buffer, count);
if (len > 0)
*ppos += len;
up(&buffer->sem);
return count;
return len;
}

static int check_perm(struct inode * inode, struct file * file)
Expand Down
Loading

0 comments on commit d1ffa56

Please sign in to comment.