aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2009-03-30 14:02:33 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-03-30 15:16:37 -0400
commita72bdb1cd244725ff47b3a29662e2cb820d8c60f (patch)
tree68f9022b303ca5183bd64eddbff41f0624e84188 /include
parent6dfede696391133eadd7ce90b61c9573ee6e5a90 (diff)
reiserfs: Clean up xattrs when REISERFS_FS_XATTR is unset
The current reiserfs xattr implementation will not clean up old xattr files if files are deleted when REISERFS_FS_XATTR is unset. This results in inaccessible lost files, wasting space. This patch compiles in basic xattr knowledge, such as how to delete them and change ownership for quota tracking. If the file system has never used xattrs, then the operation is quite fast: it returns immediately when it sees there is no .reiserfs_priv directory. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/reiserfs_fs_sb.h2
-rw-r--r--include/linux/reiserfs_xattr.h29
2 files changed, 7 insertions, 24 deletions
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h
index 12fc2a0d13be..cbb8868e844e 100644
--- a/include/linux/reiserfs_fs_sb.h
+++ b/include/linux/reiserfs_fs_sb.h
@@ -402,8 +402,8 @@ struct reiserfs_sb_info {
402 int reserved_blocks; /* amount of blocks reserved for further allocations */ 402 int reserved_blocks; /* amount of blocks reserved for further allocations */
403 spinlock_t bitmap_lock; /* this lock on now only used to protect reserved_blocks variable */ 403 spinlock_t bitmap_lock; /* this lock on now only used to protect reserved_blocks variable */
404 struct dentry *priv_root; /* root of /.reiserfs_priv */ 404 struct dentry *priv_root; /* root of /.reiserfs_priv */
405#ifdef CONFIG_REISERFS_FS_XATTR
406 struct dentry *xattr_root; /* root of /.reiserfs_priv/.xa */ 405 struct dentry *xattr_root; /* root of /.reiserfs_priv/.xa */
406#ifdef CONFIG_REISERFS_FS_XATTR
407 struct rw_semaphore xattr_dir_sem; 407 struct rw_semaphore xattr_dir_sem;
408#endif 408#endif
409 int j_errno; 409 int j_errno;
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h
index 58f32ba7f5a0..13cdd5e1cb60 100644
--- a/include/linux/reiserfs_xattr.h
+++ b/include/linux/reiserfs_xattr.h
@@ -43,6 +43,12 @@ struct reiserfs_xattr_handler {
43 struct list_head handlers; 43 struct list_head handlers;
44}; 44};
45 45
46int reiserfs_xattr_register_handlers(void) __init;
47void reiserfs_xattr_unregister_handlers(void);
48int reiserfs_xattr_init(struct super_block *sb, int mount_flags);
49int reiserfs_delete_xattrs(struct inode *inode);
50int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs);
51
46#ifdef CONFIG_REISERFS_FS_XATTR 52#ifdef CONFIG_REISERFS_FS_XATTR
47#define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir) 53#define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir)
48ssize_t reiserfs_getxattr(struct dentry *dentry, const char *name, 54ssize_t reiserfs_getxattr(struct dentry *dentry, const char *name,
@@ -51,9 +57,6 @@ int reiserfs_setxattr(struct dentry *dentry, const char *name,
51 const void *value, size_t size, int flags); 57 const void *value, size_t size, int flags);
52ssize_t reiserfs_listxattr(struct dentry *dentry, char *buffer, size_t size); 58ssize_t reiserfs_listxattr(struct dentry *dentry, char *buffer, size_t size);
53int reiserfs_removexattr(struct dentry *dentry, const char *name); 59int reiserfs_removexattr(struct dentry *dentry, const char *name);
54int reiserfs_delete_xattrs(struct inode *inode);
55int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs);
56int reiserfs_xattr_init(struct super_block *sb, int mount_flags);
57int reiserfs_permission(struct inode *inode, int mask); 60int reiserfs_permission(struct inode *inode, int mask);
58 61
59int reiserfs_xattr_del(struct inode *, const char *); 62int reiserfs_xattr_del(struct inode *, const char *);
@@ -64,9 +67,6 @@ extern struct reiserfs_xattr_handler user_handler;
64extern struct reiserfs_xattr_handler trusted_handler; 67extern struct reiserfs_xattr_handler trusted_handler;
65extern struct reiserfs_xattr_handler security_handler; 68extern struct reiserfs_xattr_handler security_handler;
66 69
67int reiserfs_xattr_register_handlers(void) __init;
68void reiserfs_xattr_unregister_handlers(void);
69
70static inline void reiserfs_write_lock_xattrs(struct super_block *sb) 70static inline void reiserfs_write_lock_xattrs(struct super_block *sb)
71{ 71{
72 down_write(&REISERFS_XATTR_DIR_SEM(sb)); 72 down_write(&REISERFS_XATTR_DIR_SEM(sb));
@@ -121,23 +121,6 @@ static inline void reiserfs_init_xattr_rwsem(struct inode *inode)
121 121
122#define reiserfs_permission NULL 122#define reiserfs_permission NULL
123 123
124#define reiserfs_xattr_register_handlers() 0
125#define reiserfs_xattr_unregister_handlers()
126
127static inline int reiserfs_delete_xattrs(struct inode *inode)
128{
129 return 0;
130};
131static inline int reiserfs_chown_xattrs(struct inode *inode,
132 struct iattr *attrs)
133{
134 return 0;
135};
136static inline int reiserfs_xattr_init(struct super_block *sb, int mount_flags)
137{
138 sb->s_flags = (sb->s_flags & ~MS_POSIXACL); /* to be sure */
139 return 0;
140};
141static inline void reiserfs_init_xattr_rwsem(struct inode *inode) 124static inline void reiserfs_init_xattr_rwsem(struct inode *inode)
142{ 125{
143} 126}