aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jfs
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-07-23 05:20:10 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2007-07-23 05:20:10 -0400
commit39fe5434cb9de5da40510028b17b96bc4eb312b3 (patch)
tree7a02a317b9ad57da51ca99887c119e779ccf3f13 /fs/jfs
parent0fc72b81d3111d114ab378935b1cf07680ca1289 (diff)
parentf695baf2df9e0413d3521661070103711545207a (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'fs/jfs')
-rw-r--r--fs/jfs/ioctl.c2
-rw-r--r--fs/jfs/jfs_inode.h1
-rw-r--r--fs/jfs/jfs_metapage.c2
-rw-r--r--fs/jfs/namei.c32
-rw-r--r--fs/jfs/super.c4
-rw-r--r--fs/jfs/xattr.c2
6 files changed, 39 insertions, 4 deletions
diff --git a/fs/jfs/ioctl.c b/fs/jfs/ioctl.c
index fe063af6fd..3c8663bea9 100644
--- a/fs/jfs/ioctl.c
+++ b/fs/jfs/ioctl.c
@@ -69,7 +69,7 @@ int jfs_ioctl(struct inode * inode, struct file * filp, unsigned int cmd,
69 if (IS_RDONLY(inode)) 69 if (IS_RDONLY(inode))
70 return -EROFS; 70 return -EROFS;
71 71
72 if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER)) 72 if (!is_owner_or_cap(inode))
73 return -EACCES; 73 return -EACCES;
74 74
75 if (get_user(flags, (int __user *) arg)) 75 if (get_user(flags, (int __user *) arg))
diff --git a/fs/jfs/jfs_inode.h b/fs/jfs/jfs_inode.h
index 2374b595f2..f0ec72b263 100644
--- a/fs/jfs/jfs_inode.h
+++ b/fs/jfs/jfs_inode.h
@@ -32,6 +32,7 @@ extern void jfs_truncate_nolock(struct inode *, loff_t);
32extern void jfs_free_zero_link(struct inode *); 32extern void jfs_free_zero_link(struct inode *);
33extern struct dentry *jfs_get_parent(struct dentry *dentry); 33extern struct dentry *jfs_get_parent(struct dentry *dentry);
34extern void jfs_get_inode_flags(struct jfs_inode_info *); 34extern void jfs_get_inode_flags(struct jfs_inode_info *);
35extern struct dentry *jfs_get_dentry(struct super_block *sb, void *vobjp);
35extern void jfs_set_inode_flags(struct inode *); 36extern void jfs_set_inode_flags(struct inode *);
36extern int jfs_get_block(struct inode *, sector_t, struct buffer_head *, int); 37extern int jfs_get_block(struct inode *, sector_t, struct buffer_head *, int);
37 38
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c
index 77c7f1129d..62e96be02a 100644
--- a/fs/jfs/jfs_metapage.c
+++ b/fs/jfs/jfs_metapage.c
@@ -213,7 +213,7 @@ int __init metapage_init(void)
213 * Allocate the metapage structures 213 * Allocate the metapage structures
214 */ 214 */
215 metapage_cache = kmem_cache_create("jfs_mp", sizeof(struct metapage), 215 metapage_cache = kmem_cache_create("jfs_mp", sizeof(struct metapage),
216 0, 0, init_once, NULL); 216 0, 0, init_once);
217 if (metapage_cache == NULL) 217 if (metapage_cache == NULL)
218 return -ENOMEM; 218 return -ENOMEM;
219 219
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
index 25161c4121..932797ba43 100644
--- a/fs/jfs/namei.c
+++ b/fs/jfs/namei.c
@@ -1477,6 +1477,38 @@ static struct dentry *jfs_lookup(struct inode *dip, struct dentry *dentry, struc
1477 return dentry; 1477 return dentry;
1478} 1478}
1479 1479
1480struct dentry *jfs_get_dentry(struct super_block *sb, void *vobjp)
1481{
1482 __u32 *objp = vobjp;
1483 unsigned long ino = objp[0];
1484 __u32 generation = objp[1];
1485 struct inode *inode;
1486 struct dentry *result;
1487
1488 if (ino == 0)
1489 return ERR_PTR(-ESTALE);
1490 inode = iget(sb, ino);
1491 if (inode == NULL)
1492 return ERR_PTR(-ENOMEM);
1493
1494 if (is_bad_inode(inode) ||
1495 (generation && inode->i_generation != generation)) {
1496 result = ERR_PTR(-ESTALE);
1497 goto out_iput;
1498 }
1499
1500 result = d_alloc_anon(inode);
1501 if (!result) {
1502 result = ERR_PTR(-ENOMEM);
1503 goto out_iput;
1504 }
1505 return result;
1506
1507 out_iput:
1508 iput(inode);
1509 return result;
1510}
1511
1480struct dentry *jfs_get_parent(struct dentry *dentry) 1512struct dentry *jfs_get_parent(struct dentry *dentry)
1481{ 1513{
1482 struct super_block *sb = dentry->d_inode->i_sb; 1514 struct super_block *sb = dentry->d_inode->i_sb;
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index 20e4ac1c79..4b372f5506 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -27,6 +27,7 @@
27#include <linux/kthread.h> 27#include <linux/kthread.h>
28#include <linux/posix_acl.h> 28#include <linux/posix_acl.h>
29#include <linux/buffer_head.h> 29#include <linux/buffer_head.h>
30#include <linux/exportfs.h>
30#include <asm/uaccess.h> 31#include <asm/uaccess.h>
31#include <linux/seq_file.h> 32#include <linux/seq_file.h>
32 33
@@ -737,6 +738,7 @@ static const struct super_operations jfs_super_operations = {
737}; 738};
738 739
739static struct export_operations jfs_export_operations = { 740static struct export_operations jfs_export_operations = {
741 .get_dentry = jfs_get_dentry,
740 .get_parent = jfs_get_parent, 742 .get_parent = jfs_get_parent,
741}; 743};
742 744
@@ -774,7 +776,7 @@ static int __init init_jfs_fs(void)
774 jfs_inode_cachep = 776 jfs_inode_cachep =
775 kmem_cache_create("jfs_ip", sizeof(struct jfs_inode_info), 0, 777 kmem_cache_create("jfs_ip", sizeof(struct jfs_inode_info), 0,
776 SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD, 778 SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD,
777 init_once, NULL); 779 init_once);
778 if (jfs_inode_cachep == NULL) 780 if (jfs_inode_cachep == NULL)
779 return -ENOMEM; 781 return -ENOMEM;
780 782
diff --git a/fs/jfs/xattr.c b/fs/jfs/xattr.c
index b2375f0774..9b7f2cdaae 100644
--- a/fs/jfs/xattr.c
+++ b/fs/jfs/xattr.c
@@ -697,7 +697,7 @@ static int can_set_system_xattr(struct inode *inode, const char *name,
697 struct posix_acl *acl; 697 struct posix_acl *acl;
698 int rc; 698 int rc;
699 699
700 if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER)) 700 if (!is_owner_or_cap(inode))
701 return -EPERM; 701 return -EPERM;
702 702
703 /* 703 /*