aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/reiserfs_acl.h3
-rw-r--r--include/linux/reiserfs_fs.h4
-rw-r--r--include/linux/reiserfs_xattr.h40
3 files changed, 44 insertions, 3 deletions
diff --git a/include/linux/reiserfs_acl.h b/include/linux/reiserfs_acl.h
index d180446470f2..52240e02de02 100644
--- a/include/linux/reiserfs_acl.h
+++ b/include/linux/reiserfs_acl.h
@@ -49,7 +49,8 @@ static inline int reiserfs_acl_count(size_t size)
49#ifdef CONFIG_REISERFS_FS_POSIX_ACL 49#ifdef CONFIG_REISERFS_FS_POSIX_ACL
50struct posix_acl *reiserfs_get_acl(struct inode *inode, int type); 50struct posix_acl *reiserfs_get_acl(struct inode *inode, int type);
51int reiserfs_acl_chmod(struct inode *inode); 51int reiserfs_acl_chmod(struct inode *inode);
52int reiserfs_inherit_default_acl(struct inode *dir, struct dentry *dentry, 52int reiserfs_inherit_default_acl(struct reiserfs_transaction_handle *th,
53 struct inode *dir, struct dentry *dentry,
53 struct inode *inode); 54 struct inode *inode);
54int reiserfs_cache_default_acl(struct inode *dir); 55int reiserfs_cache_default_acl(struct inode *dir);
55extern struct xattr_handler reiserfs_posix_acl_default_handler; 56extern struct xattr_handler reiserfs_posix_acl_default_handler;
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index e00d240314c5..67ad310fa88b 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -1615,6 +1615,10 @@ struct reiserfs_journal_header {
1615#define JOURNAL_MAX_COMMIT_AGE 30 1615#define JOURNAL_MAX_COMMIT_AGE 30
1616#define JOURNAL_MAX_TRANS_AGE 30 1616#define JOURNAL_MAX_TRANS_AGE 30
1617#define JOURNAL_PER_BALANCE_CNT (3 * (MAX_HEIGHT-2) + 9) 1617#define JOURNAL_PER_BALANCE_CNT (3 * (MAX_HEIGHT-2) + 9)
1618#define JOURNAL_BLOCKS_PER_OBJECT(sb) (JOURNAL_PER_BALANCE_CNT * 3 + \
1619 2 * (REISERFS_QUOTA_INIT_BLOCKS(sb) + \
1620 REISERFS_QUOTA_TRANS_BLOCKS(sb)))
1621
1618#ifdef CONFIG_QUOTA 1622#ifdef CONFIG_QUOTA
1619/* We need to update data and inode (atime) */ 1623/* We need to update data and inode (atime) */
1620#define REISERFS_QUOTA_TRANS_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & (1<<REISERFS_QUOTA) ? 2 : 0) 1624#define REISERFS_QUOTA_TRANS_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & (1<<REISERFS_QUOTA) ? 2 : 0)
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h
index 958fcaca0e8b..20eca09729a2 100644
--- a/include/linux/reiserfs_xattr.h
+++ b/include/linux/reiserfs_xattr.h
@@ -46,14 +46,50 @@ int reiserfs_removexattr(struct dentry *dentry, const char *name);
46int reiserfs_permission(struct inode *inode, int mask); 46int reiserfs_permission(struct inode *inode, int mask);
47 47
48int reiserfs_xattr_get(struct inode *, const char *, void *, size_t); 48int reiserfs_xattr_get(struct inode *, const char *, void *, size_t);
49int __reiserfs_xattr_set(struct inode *, const char *, const void *,
50 size_t, int);
51int reiserfs_xattr_set(struct inode *, const char *, const void *, size_t, int); 49int reiserfs_xattr_set(struct inode *, const char *, const void *, size_t, int);
50int reiserfs_xattr_set_handle(struct reiserfs_transaction_handle *,
51 struct inode *, const char *, const void *,
52 size_t, int);
52 53
53extern struct xattr_handler reiserfs_xattr_user_handler; 54extern struct xattr_handler reiserfs_xattr_user_handler;
54extern struct xattr_handler reiserfs_xattr_trusted_handler; 55extern struct xattr_handler reiserfs_xattr_trusted_handler;
55extern struct xattr_handler reiserfs_xattr_security_handler; 56extern struct xattr_handler reiserfs_xattr_security_handler;
56 57
58#define xattr_size(size) ((size) + sizeof(struct reiserfs_xattr_header))
59static inline loff_t reiserfs_xattr_nblocks(struct inode *inode, loff_t size)
60{
61 loff_t ret = 0;
62 if (reiserfs_file_data_log(inode)) {
63 ret = _ROUND_UP(xattr_size(size), inode->i_sb->s_blocksize);
64 ret >>= inode->i_sb->s_blocksize_bits;
65 }
66 return ret;
67}
68
69/* We may have to create up to 3 objects: xattr root, xattr dir, xattr file.
70 * Let's try to be smart about it.
71 * xattr root: We cache it. If it's not cached, we may need to create it.
72 * xattr dir: If anything has been loaded for this inode, we can set a flag
73 * saying so.
74 * xattr file: Since we don't cache xattrs, we can't tell. We always include
75 * blocks for it.
76 *
77 * However, since root and dir can be created between calls - YOU MUST SAVE
78 * THIS VALUE.
79 */
80static inline size_t reiserfs_xattr_jcreate_nblocks(struct inode *inode)
81{
82 size_t nblocks = JOURNAL_BLOCKS_PER_OBJECT(inode->i_sb);
83
84 if ((REISERFS_I(inode)->i_flags & i_has_xattr_dir) == 0) {
85 nblocks += JOURNAL_BLOCKS_PER_OBJECT(inode->i_sb);
86 if (REISERFS_SB(inode->i_sb)->xattr_root == NULL)
87 nblocks += JOURNAL_BLOCKS_PER_OBJECT(inode->i_sb);
88 }
89
90 return nblocks;
91}
92
57static inline void reiserfs_init_xattr_rwsem(struct inode *inode) 93static inline void reiserfs_init_xattr_rwsem(struct inode *inode)
58{ 94{
59 init_rwsem(&REISERFS_I(inode)->i_xattr_sem); 95 init_rwsem(&REISERFS_I(inode)->i_xattr_sem);