Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/ericvh/v9fs

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
  fs/9p: iattr_valid flags are kernel internal flags map them to 9p values.
  fs/9p: We should not allocate a new inode when creating hardlines.
  fs/9p: v9fs_stat2inode should update suid/sgid bits.
  9p: Reduce object size with CONFIG_NET_9P_DEBUG
  fs/9p: check schedule_timeout_interruptible return value

Fix up trivial conflicts in fs/9p/{vfs_inode.c,vfs_inode_dotl.c} due to
debug messages having changed to use p9_debug() on one hand, and the
changes for umode_t on the other.
  • Loading branch information
torvalds committed Jan 10, 2012
2 parents 57eccf1 + f766619 commit 609eac1
Show file tree
Hide file tree
Showing 20 changed files with 545 additions and 470 deletions.
64 changes: 32 additions & 32 deletions fs/9p/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ static uint16_t v9fs_cache_session_get_key(const void *cookie_netfs_data,
uint16_t klen = 0;

v9ses = (struct v9fs_session_info *)cookie_netfs_data;
P9_DPRINTK(P9_DEBUG_FSC, "session %p buf %p size %u", v9ses,
buffer, bufmax);
p9_debug(P9_DEBUG_FSC, "session %p buf %p size %u\n",
v9ses, buffer, bufmax);

if (v9ses->cachetag)
klen = strlen(v9ses->cachetag);
Expand All @@ -72,7 +72,7 @@ static uint16_t v9fs_cache_session_get_key(const void *cookie_netfs_data,
return 0;

memcpy(buffer, v9ses->cachetag, klen);
P9_DPRINTK(P9_DEBUG_FSC, "cache session tag %s", v9ses->cachetag);
p9_debug(P9_DEBUG_FSC, "cache session tag %s\n", v9ses->cachetag);
return klen;
}

Expand All @@ -91,14 +91,14 @@ void v9fs_cache_session_get_cookie(struct v9fs_session_info *v9ses)
v9ses->fscache = fscache_acquire_cookie(v9fs_cache_netfs.primary_index,
&v9fs_cache_session_index_def,
v9ses);
P9_DPRINTK(P9_DEBUG_FSC, "session %p get cookie %p", v9ses,
v9ses->fscache);
p9_debug(P9_DEBUG_FSC, "session %p get cookie %p\n",
v9ses, v9ses->fscache);
}

void v9fs_cache_session_put_cookie(struct v9fs_session_info *v9ses)
{
P9_DPRINTK(P9_DEBUG_FSC, "session %p put cookie %p", v9ses,
v9ses->fscache);
p9_debug(P9_DEBUG_FSC, "session %p put cookie %p\n",
v9ses, v9ses->fscache);
fscache_relinquish_cookie(v9ses->fscache, 0);
v9ses->fscache = NULL;
}
Expand All @@ -109,8 +109,8 @@ static uint16_t v9fs_cache_inode_get_key(const void *cookie_netfs_data,
{
const struct v9fs_inode *v9inode = cookie_netfs_data;
memcpy(buffer, &v9inode->qid.path, sizeof(v9inode->qid.path));
P9_DPRINTK(P9_DEBUG_FSC, "inode %p get key %llu", &v9inode->vfs_inode,
v9inode->qid.path);
p9_debug(P9_DEBUG_FSC, "inode %p get key %llu\n",
&v9inode->vfs_inode, v9inode->qid.path);
return sizeof(v9inode->qid.path);
}

Expand All @@ -120,17 +120,17 @@ static void v9fs_cache_inode_get_attr(const void *cookie_netfs_data,
const struct v9fs_inode *v9inode = cookie_netfs_data;
*size = i_size_read(&v9inode->vfs_inode);

P9_DPRINTK(P9_DEBUG_FSC, "inode %p get attr %llu", &v9inode->vfs_inode,
*size);
p9_debug(P9_DEBUG_FSC, "inode %p get attr %llu\n",
&v9inode->vfs_inode, *size);
}

static uint16_t v9fs_cache_inode_get_aux(const void *cookie_netfs_data,
void *buffer, uint16_t buflen)
{
const struct v9fs_inode *v9inode = cookie_netfs_data;
memcpy(buffer, &v9inode->qid.version, sizeof(v9inode->qid.version));
P9_DPRINTK(P9_DEBUG_FSC, "inode %p get aux %u", &v9inode->vfs_inode,
v9inode->qid.version);
p9_debug(P9_DEBUG_FSC, "inode %p get aux %u\n",
&v9inode->vfs_inode, v9inode->qid.version);
return sizeof(v9inode->qid.version);
}

Expand Down Expand Up @@ -206,8 +206,8 @@ void v9fs_cache_inode_get_cookie(struct inode *inode)
&v9fs_cache_inode_index_def,
v9inode);

P9_DPRINTK(P9_DEBUG_FSC, "inode %p get cookie %p", inode,
v9inode->fscache);
p9_debug(P9_DEBUG_FSC, "inode %p get cookie %p\n",
inode, v9inode->fscache);
}

void v9fs_cache_inode_put_cookie(struct inode *inode)
Expand All @@ -216,8 +216,8 @@ void v9fs_cache_inode_put_cookie(struct inode *inode)

if (!v9inode->fscache)
return;
P9_DPRINTK(P9_DEBUG_FSC, "inode %p put cookie %p", inode,
v9inode->fscache);
p9_debug(P9_DEBUG_FSC, "inode %p put cookie %p\n",
inode, v9inode->fscache);

fscache_relinquish_cookie(v9inode->fscache, 0);
v9inode->fscache = NULL;
Expand All @@ -229,8 +229,8 @@ void v9fs_cache_inode_flush_cookie(struct inode *inode)

if (!v9inode->fscache)
return;
P9_DPRINTK(P9_DEBUG_FSC, "inode %p flush cookie %p", inode,
v9inode->fscache);
p9_debug(P9_DEBUG_FSC, "inode %p flush cookie %p\n",
inode, v9inode->fscache);

fscache_relinquish_cookie(v9inode->fscache, 1);
v9inode->fscache = NULL;
Expand Down Expand Up @@ -272,8 +272,8 @@ void v9fs_cache_inode_reset_cookie(struct inode *inode)
v9inode->fscache = fscache_acquire_cookie(v9ses->fscache,
&v9fs_cache_inode_index_def,
v9inode);
P9_DPRINTK(P9_DEBUG_FSC, "inode %p revalidating cookie old %p new %p",
inode, old, v9inode->fscache);
p9_debug(P9_DEBUG_FSC, "inode %p revalidating cookie old %p new %p\n",
inode, old, v9inode->fscache);

spin_unlock(&v9inode->fscache_lock);
}
Expand Down Expand Up @@ -323,7 +323,7 @@ int __v9fs_readpage_from_fscache(struct inode *inode, struct page *page)
int ret;
const struct v9fs_inode *v9inode = V9FS_I(inode);

P9_DPRINTK(P9_DEBUG_FSC, "inode %p page %p", inode, page);
p9_debug(P9_DEBUG_FSC, "inode %p page %p\n", inode, page);
if (!v9inode->fscache)
return -ENOBUFS;

Expand All @@ -335,13 +335,13 @@ int __v9fs_readpage_from_fscache(struct inode *inode, struct page *page)
switch (ret) {
case -ENOBUFS:
case -ENODATA:
P9_DPRINTK(P9_DEBUG_FSC, "page/inode not in cache %d", ret);
p9_debug(P9_DEBUG_FSC, "page/inode not in cache %d\n", ret);
return 1;
case 0:
P9_DPRINTK(P9_DEBUG_FSC, "BIO submitted");
p9_debug(P9_DEBUG_FSC, "BIO submitted\n");
return ret;
default:
P9_DPRINTK(P9_DEBUG_FSC, "ret %d", ret);
p9_debug(P9_DEBUG_FSC, "ret %d\n", ret);
return ret;
}
}
Expand All @@ -361,7 +361,7 @@ int __v9fs_readpages_from_fscache(struct inode *inode,
int ret;
const struct v9fs_inode *v9inode = V9FS_I(inode);

P9_DPRINTK(P9_DEBUG_FSC, "inode %p pages %u", inode, *nr_pages);
p9_debug(P9_DEBUG_FSC, "inode %p pages %u\n", inode, *nr_pages);
if (!v9inode->fscache)
return -ENOBUFS;

Expand All @@ -373,15 +373,15 @@ int __v9fs_readpages_from_fscache(struct inode *inode,
switch (ret) {
case -ENOBUFS:
case -ENODATA:
P9_DPRINTK(P9_DEBUG_FSC, "pages/inodes not in cache %d", ret);
p9_debug(P9_DEBUG_FSC, "pages/inodes not in cache %d\n", ret);
return 1;
case 0:
BUG_ON(!list_empty(pages));
BUG_ON(*nr_pages != 0);
P9_DPRINTK(P9_DEBUG_FSC, "BIO submitted");
p9_debug(P9_DEBUG_FSC, "BIO submitted\n");
return ret;
default:
P9_DPRINTK(P9_DEBUG_FSC, "ret %d", ret);
p9_debug(P9_DEBUG_FSC, "ret %d\n", ret);
return ret;
}
}
Expand All @@ -396,9 +396,9 @@ void __v9fs_readpage_to_fscache(struct inode *inode, struct page *page)
int ret;
const struct v9fs_inode *v9inode = V9FS_I(inode);

P9_DPRINTK(P9_DEBUG_FSC, "inode %p page %p", inode, page);
p9_debug(P9_DEBUG_FSC, "inode %p page %p\n", inode, page);
ret = fscache_write_page(v9inode->fscache, page, GFP_KERNEL);
P9_DPRINTK(P9_DEBUG_FSC, "ret = %d", ret);
p9_debug(P9_DEBUG_FSC, "ret = %d\n", ret);
if (ret != 0)
v9fs_uncache_page(inode, page);
}
Expand All @@ -409,7 +409,7 @@ void __v9fs_readpage_to_fscache(struct inode *inode, struct page *page)
void __v9fs_fscache_wait_on_page_write(struct inode *inode, struct page *page)
{
const struct v9fs_inode *v9inode = V9FS_I(inode);
P9_DPRINTK(P9_DEBUG_FSC, "inode %p page %p", inode, page);
p9_debug(P9_DEBUG_FSC, "inode %p page %p\n", inode, page);
if (PageFsCache(page))
fscache_wait_on_page_write(v9inode->fscache, page);
}
8 changes: 4 additions & 4 deletions fs/9p/fid.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ int v9fs_fid_add(struct dentry *dentry, struct p9_fid *fid)
{
struct v9fs_dentry *dent;

P9_DPRINTK(P9_DEBUG_VFS, "fid %d dentry %s\n",
fid->fid, dentry->d_name.name);
p9_debug(P9_DEBUG_VFS, "fid %d dentry %s\n",
fid->fid, dentry->d_name.name);

dent = dentry->d_fsdata;
if (!dent) {
Expand Down Expand Up @@ -79,8 +79,8 @@ static struct p9_fid *v9fs_fid_find(struct dentry *dentry, u32 uid, int any)
struct v9fs_dentry *dent;
struct p9_fid *fid, *ret;

P9_DPRINTK(P9_DEBUG_VFS, " dentry: %s (%p) uid %d any %d\n",
dentry->d_name.name, dentry, uid, any);
p9_debug(P9_DEBUG_VFS, " dentry: %s (%p) uid %d any %d\n",
dentry->d_name.name, dentry, uid, any);
dent = (struct v9fs_dentry *) dentry->d_fsdata;
ret = NULL;
if (dent) {
Expand Down
59 changes: 30 additions & 29 deletions fs/9p/v9fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
*
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/errno.h>
#include <linux/fs.h>
Expand Down Expand Up @@ -85,15 +87,15 @@ static int get_cache_mode(char *s)

if (!strcmp(s, "loose")) {
version = CACHE_LOOSE;
P9_DPRINTK(P9_DEBUG_9P, "Cache mode: loose\n");
p9_debug(P9_DEBUG_9P, "Cache mode: loose\n");
} else if (!strcmp(s, "fscache")) {
version = CACHE_FSCACHE;
P9_DPRINTK(P9_DEBUG_9P, "Cache mode: fscache\n");
p9_debug(P9_DEBUG_9P, "Cache mode: fscache\n");
} else if (!strcmp(s, "none")) {
version = CACHE_NONE;
P9_DPRINTK(P9_DEBUG_9P, "Cache mode: none\n");
p9_debug(P9_DEBUG_9P, "Cache mode: none\n");
} else
printk(KERN_INFO "9p: Unknown Cache mode %s.\n", s);
pr_info("Unknown Cache mode %s\n", s);
return version;
}

Expand Down Expand Up @@ -140,8 +142,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
case Opt_debug:
r = match_int(&args[0], &option);
if (r < 0) {
P9_DPRINTK(P9_DEBUG_ERROR,
"integer field, but no integer?\n");
p9_debug(P9_DEBUG_ERROR,
"integer field, but no integer?\n");
ret = r;
continue;
}
Expand All @@ -154,8 +156,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
case Opt_dfltuid:
r = match_int(&args[0], &option);
if (r < 0) {
P9_DPRINTK(P9_DEBUG_ERROR,
"integer field, but no integer?\n");
p9_debug(P9_DEBUG_ERROR,
"integer field, but no integer?\n");
ret = r;
continue;
}
Expand All @@ -164,8 +166,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
case Opt_dfltgid:
r = match_int(&args[0], &option);
if (r < 0) {
P9_DPRINTK(P9_DEBUG_ERROR,
"integer field, but no integer?\n");
p9_debug(P9_DEBUG_ERROR,
"integer field, but no integer?\n");
ret = r;
continue;
}
Expand All @@ -174,8 +176,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
case Opt_afid:
r = match_int(&args[0], &option);
if (r < 0) {
P9_DPRINTK(P9_DEBUG_ERROR,
"integer field, but no integer?\n");
p9_debug(P9_DEBUG_ERROR,
"integer field, but no integer?\n");
ret = r;
continue;
}
Expand Down Expand Up @@ -205,8 +207,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
s = match_strdup(&args[0]);
if (!s) {
ret = -ENOMEM;
P9_DPRINTK(P9_DEBUG_ERROR,
"problem allocating copy of cache arg\n");
p9_debug(P9_DEBUG_ERROR,
"problem allocating copy of cache arg\n");
goto free_and_return;
}
ret = get_cache_mode(s);
Expand All @@ -223,8 +225,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
s = match_strdup(&args[0]);
if (!s) {
ret = -ENOMEM;
P9_DPRINTK(P9_DEBUG_ERROR,
"problem allocating copy of access arg\n");
p9_debug(P9_DEBUG_ERROR,
"problem allocating copy of access arg\n");
goto free_and_return;
}

Expand All @@ -240,8 +242,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
v9ses->uid = simple_strtoul(s, &e, 10);
if (*e != '\0') {
ret = -EINVAL;
printk(KERN_INFO "9p: Unknown access "
"argument %s.\n", s);
pr_info("Unknown access argument %s\n",
s);
kfree(s);
goto free_and_return;
}
Expand All @@ -254,9 +256,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
#ifdef CONFIG_9P_FS_POSIX_ACL
v9ses->flags |= V9FS_POSIX_ACL;
#else
P9_DPRINTK(P9_DEBUG_ERROR,
"Not defined CONFIG_9P_FS_POSIX_ACL. "
"Ignoring posixacl option\n");
p9_debug(P9_DEBUG_ERROR,
"Not defined CONFIG_9P_FS_POSIX_ACL. Ignoring posixacl option\n");
#endif
break;

Expand Down Expand Up @@ -318,7 +319,7 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses,
if (IS_ERR(v9ses->clnt)) {
retval = PTR_ERR(v9ses->clnt);
v9ses->clnt = NULL;
P9_DPRINTK(P9_DEBUG_ERROR, "problem initializing 9p client\n");
p9_debug(P9_DEBUG_ERROR, "problem initializing 9p client\n");
goto error;
}

Expand Down Expand Up @@ -371,7 +372,7 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses,
if (IS_ERR(fid)) {
retval = PTR_ERR(fid);
fid = NULL;
P9_DPRINTK(P9_DEBUG_ERROR, "cannot attach\n");
p9_debug(P9_DEBUG_ERROR, "cannot attach\n");
goto error;
}

Expand Down Expand Up @@ -429,7 +430,7 @@ void v9fs_session_close(struct v9fs_session_info *v9ses)
*/

void v9fs_session_cancel(struct v9fs_session_info *v9ses) {
P9_DPRINTK(P9_DEBUG_ERROR, "cancel session %p\n", v9ses);
p9_debug(P9_DEBUG_ERROR, "cancel session %p\n", v9ses);
p9_client_disconnect(v9ses->clnt);
}

Expand All @@ -442,7 +443,7 @@ void v9fs_session_cancel(struct v9fs_session_info *v9ses) {

void v9fs_session_begin_cancel(struct v9fs_session_info *v9ses)
{
P9_DPRINTK(P9_DEBUG_ERROR, "begin cancel session %p\n", v9ses);
p9_debug(P9_DEBUG_ERROR, "begin cancel session %p\n", v9ses);
p9_client_begin_disconnect(v9ses->clnt);
}

Expand Down Expand Up @@ -591,23 +592,23 @@ static void v9fs_cache_unregister(void)
static int __init init_v9fs(void)
{
int err;
printk(KERN_INFO "Installing v9fs 9p2000 file system support\n");
pr_info("Installing v9fs 9p2000 file system support\n");
/* TODO: Setup list of registered trasnport modules */
err = register_filesystem(&v9fs_fs_type);
if (err < 0) {
printk(KERN_ERR "Failed to register filesystem\n");
pr_err("Failed to register filesystem\n");
return err;
}

err = v9fs_cache_register();
if (err < 0) {
printk(KERN_ERR "Failed to register v9fs for caching\n");
pr_err("Failed to register v9fs for caching\n");
goto out_fs_unreg;
}

err = v9fs_sysfs_init();
if (err < 0) {
printk(KERN_ERR "Failed to register with sysfs\n");
pr_err("Failed to register with sysfs\n");
goto out_sysfs_cleanup;
}

Expand Down
Loading

0 comments on commit 609eac1

Please sign in to comment.