Commit 0945f352 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
  fs/9p: Don't set dentry->d_op in create routines
  fs/9p: fix spelling typo
  fs/9p: TREADLINK bugfix
  net/9p: Use proper data types
  fs/9p: Simplify the .L create operation
  fs/9p: Move dotl inode operations into a seperate file
  fs/9p: fix menu presentation
  fs/9p: Fix the return error on default acl removal
  fs/9p: Remove unnecessary semicolons
parents 7bc4a4ce b8b80cf3
...@@ -9,6 +9,8 @@ config 9P_FS ...@@ -9,6 +9,8 @@ config 9P_FS
If unsure, say N. If unsure, say N.
if 9P_FS
config 9P_FSCACHE config 9P_FSCACHE
bool "Enable 9P client caching support (EXPERIMENTAL)" bool "Enable 9P client caching support (EXPERIMENTAL)"
depends on EXPERIMENTAL depends on EXPERIMENTAL
...@@ -20,7 +22,6 @@ config 9P_FSCACHE ...@@ -20,7 +22,6 @@ config 9P_FSCACHE
config 9P_FS_POSIX_ACL config 9P_FS_POSIX_ACL
bool "9P POSIX Access Control Lists" bool "9P POSIX Access Control Lists"
depends on 9P_FS
select FS_POSIX_ACL select FS_POSIX_ACL
help help
POSIX Access Control Lists (ACLs) support permissions for users and POSIX Access Control Lists (ACLs) support permissions for users and
...@@ -30,3 +31,5 @@ config 9P_FS_POSIX_ACL ...@@ -30,3 +31,5 @@ config 9P_FS_POSIX_ACL
Linux website <http://acl.bestbits.at/>. Linux website <http://acl.bestbits.at/>.
If you don't know what Access Control Lists are, say N If you don't know what Access Control Lists are, say N
endif
...@@ -3,6 +3,7 @@ obj-$(CONFIG_9P_FS) := 9p.o ...@@ -3,6 +3,7 @@ obj-$(CONFIG_9P_FS) := 9p.o
9p-objs := \ 9p-objs := \
vfs_super.o \ vfs_super.o \
vfs_inode.o \ vfs_inode.o \
vfs_inode_dotl.o \
vfs_addr.o \ vfs_addr.o \
vfs_file.o \ vfs_file.o \
vfs_dir.o \ vfs_dir.o \
......
...@@ -28,7 +28,7 @@ static struct posix_acl *__v9fs_get_acl(struct p9_fid *fid, char *name) ...@@ -28,7 +28,7 @@ static struct posix_acl *__v9fs_get_acl(struct p9_fid *fid, char *name)
{ {
ssize_t size; ssize_t size;
void *value = NULL; void *value = NULL;
struct posix_acl *acl = NULL;; struct posix_acl *acl = NULL;
size = v9fs_fid_xattr_get(fid, name, NULL, 0); size = v9fs_fid_xattr_get(fid, name, NULL, 0);
if (size > 0) { if (size > 0) {
...@@ -365,7 +365,7 @@ static int v9fs_xattr_set_acl(struct dentry *dentry, const char *name, ...@@ -365,7 +365,7 @@ static int v9fs_xattr_set_acl(struct dentry *dentry, const char *name,
case ACL_TYPE_DEFAULT: case ACL_TYPE_DEFAULT:
name = POSIX_ACL_XATTR_DEFAULT; name = POSIX_ACL_XATTR_DEFAULT;
if (!S_ISDIR(inode->i_mode)) { if (!S_ISDIR(inode->i_mode)) {
retval = -EINVAL; retval = acl ? -EINVAL : 0;
goto err_out; goto err_out;
} }
break; break;
......
...@@ -113,9 +113,27 @@ struct v9fs_session_info { ...@@ -113,9 +113,27 @@ struct v9fs_session_info {
struct p9_fid *v9fs_session_init(struct v9fs_session_info *, const char *, struct p9_fid *v9fs_session_init(struct v9fs_session_info *, const char *,
char *); char *);
void v9fs_session_close(struct v9fs_session_info *v9ses); extern void v9fs_session_close(struct v9fs_session_info *v9ses);
void v9fs_session_cancel(struct v9fs_session_info *v9ses); extern void v9fs_session_cancel(struct v9fs_session_info *v9ses);
void v9fs_session_begin_cancel(struct v9fs_session_info *v9ses); extern void v9fs_session_begin_cancel(struct v9fs_session_info *v9ses);
extern struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
struct nameidata *nameidata);
extern int v9fs_vfs_unlink(struct inode *i, struct dentry *d);
extern int v9fs_vfs_rmdir(struct inode *i, struct dentry *d);
extern int v9fs_vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct inode *new_dir, struct dentry *new_dentry);
extern void v9fs_vfs_put_link(struct dentry *dentry, struct nameidata *nd,
void *p);
extern struct inode *v9fs_inode(struct v9fs_session_info *v9ses,
struct p9_fid *fid,
struct super_block *sb);
extern const struct inode_operations v9fs_dir_inode_operations_dotl;
extern const struct inode_operations v9fs_file_inode_operations_dotl;
extern const struct inode_operations v9fs_symlink_inode_operations_dotl;
extern struct inode *v9fs_inode_dotl(struct v9fs_session_info *v9ses,
struct p9_fid *fid,
struct super_block *sb);
/* other default globals */ /* other default globals */
#define V9FS_PORT 564 #define V9FS_PORT 564
...@@ -138,3 +156,21 @@ static inline int v9fs_proto_dotl(struct v9fs_session_info *v9ses) ...@@ -138,3 +156,21 @@ static inline int v9fs_proto_dotl(struct v9fs_session_info *v9ses)
{ {
return v9ses->flags & V9FS_PROTO_2000L; return v9ses->flags & V9FS_PROTO_2000L;
} }
/**
* v9fs_inode_from_fid - Helper routine to populate an inode by
* issuing a attribute request
* @v9ses: session information
* @fid: fid to issue attribute request for
* @sb: superblock on which to create inode
*
*/
static inline struct inode *
v9fs_inode_from_fid(struct v9fs_session_info *v9ses, struct p9_fid *fid,
struct super_block *sb)
{
if (v9fs_proto_dotl(v9ses))
return v9fs_inode_dotl(v9ses, fid, sb);
else
return v9fs_inode(v9ses, fid, sb);
}
This diff is collapsed.
This diff is collapsed.
...@@ -133,7 +133,7 @@ int v9fs_xattr_set(struct dentry *dentry, const char *name, ...@@ -133,7 +133,7 @@ int v9fs_xattr_set(struct dentry *dentry, const char *name,
"p9_client_xattrcreate failed %d\n", retval); "p9_client_xattrcreate failed %d\n", retval);
goto error; goto error;
} }
msize = fid->clnt->msize;; msize = fid->clnt->msize;
while (value_len) { while (value_len) {
if (value_len > (msize - P9_IOHDRSZ)) if (value_len > (msize - P9_IOHDRSZ))
write_count = msize - P9_IOHDRSZ; write_count = msize - P9_IOHDRSZ;
......
...@@ -178,27 +178,24 @@ p9pdu_vreadf(struct p9_fcall *pdu, int proto_version, const char *fmt, ...@@ -178,27 +178,24 @@ p9pdu_vreadf(struct p9_fcall *pdu, int proto_version, const char *fmt,
break; break;
case 's':{ case 's':{
char **sptr = va_arg(ap, char **); char **sptr = va_arg(ap, char **);
int16_t len; uint16_t len;
int size;
errcode = p9pdu_readf(pdu, proto_version, errcode = p9pdu_readf(pdu, proto_version,
"w", &len); "w", &len);
if (errcode) if (errcode)
break; break;
size = max_t(int16_t, len, 0); *sptr = kmalloc(len + 1, GFP_KERNEL);
*sptr = kmalloc(size + 1, GFP_KERNEL);
if (*sptr == NULL) { if (*sptr == NULL) {
errcode = -EFAULT; errcode = -EFAULT;
break; break;
} }
if (pdu_read(pdu, *sptr, size)) { if (pdu_read(pdu, *sptr, len)) {
errcode = -EFAULT; errcode = -EFAULT;
kfree(*sptr); kfree(*sptr);
*sptr = NULL; *sptr = NULL;
} else } else
(*sptr)[size] = 0; (*sptr)[len] = 0;
} }
break; break;
case 'Q':{ case 'Q':{
...@@ -234,14 +231,14 @@ p9pdu_vreadf(struct p9_fcall *pdu, int proto_version, const char *fmt, ...@@ -234,14 +231,14 @@ p9pdu_vreadf(struct p9_fcall *pdu, int proto_version, const char *fmt,
} }
break; break;
case 'D':{ case 'D':{
int32_t *count = va_arg(ap, int32_t *); uint32_t *count = va_arg(ap, uint32_t *);
void **data = va_arg(ap, void **); void **data = va_arg(ap, void **);
errcode = errcode =
p9pdu_readf(pdu, proto_version, "d", count); p9pdu_readf(pdu, proto_version, "d", count);
if (!errcode) { if (!errcode) {
*count = *count =
min_t(int32_t, *count, min_t(uint32_t, *count,
pdu->size - pdu->offset); pdu->size - pdu->offset);
*data = &pdu->sdata[pdu->offset]; *data = &pdu->sdata[pdu->offset];
} }
...@@ -404,9 +401,10 @@ p9pdu_vwritef(struct p9_fcall *pdu, int proto_version, const char *fmt, ...@@ -404,9 +401,10 @@ p9pdu_vwritef(struct p9_fcall *pdu, int proto_version, const char *fmt,
break; break;
case 's':{ case 's':{
const char *sptr = va_arg(ap, const char *); const char *sptr = va_arg(ap, const char *);
int16_t len = 0; uint16_t len = 0;
if (sptr) if (sptr)
len = min_t(int16_t, strlen(sptr), USHRT_MAX); len = min_t(uint16_t, strlen(sptr),
USHRT_MAX);
errcode = p9pdu_writef(pdu, proto_version, errcode = p9pdu_writef(pdu, proto_version,
"w", len); "w", len);
...@@ -438,7 +436,7 @@ p9pdu_vwritef(struct p9_fcall *pdu, int proto_version, const char *fmt, ...@@ -438,7 +436,7 @@ p9pdu_vwritef(struct p9_fcall *pdu, int proto_version, const char *fmt,
stbuf->n_gid, stbuf->n_muid); stbuf->n_gid, stbuf->n_muid);
} break; } break;
case 'D':{ case 'D':{
int32_t count = va_arg(ap, int32_t); uint32_t count = va_arg(ap, uint32_t);
const void *data = va_arg(ap, const void *); const void *data = va_arg(ap, const void *);
errcode = p9pdu_writef(pdu, proto_version, "d", errcode = p9pdu_writef(pdu, proto_version, "d",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment