diff options
author | Christoph Hellwig <hch@lst.de> | 2009-04-17 04:37:41 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-06-10 11:29:52 -0400 |
commit | 6cbff00f4632c8060b06bfc9585805217f11e12e (patch) | |
tree | 1886c4c855662172b84be2bfbd2aa5ac6a5c429d /fs/btrfs/ctree.h | |
parent | c289811cc096c57ff35550ee8132793a4f9b5b59 (diff) |
Btrfs: implement FS_IOC_GETFLAGS/SETFLAGS/GETVERSION
Add support for the standard attributes set via chattr and read via
lsattr. Currently we store the attributes in the flags value in
the btrfs inode, but I wonder whether we should split it into two so
that we don't have to keep converting between the two formats.
Remove the btrfs_clear_flag/btrfs_set_flag/btrfs_test_flag macros
as they were confusing the existing code and got in the way of the
new additions.
Also add the FS_IOC_GETVERSION ioctl for getting i_generation as it's
trivial.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 5fa7d7d287a4..4d6e0b6f21ea 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -1115,12 +1115,14 @@ struct btrfs_root { | |||
1115 | #define BTRFS_INODE_READONLY (1 << 2) | 1115 | #define BTRFS_INODE_READONLY (1 << 2) |
1116 | #define BTRFS_INODE_NOCOMPRESS (1 << 3) | 1116 | #define BTRFS_INODE_NOCOMPRESS (1 << 3) |
1117 | #define BTRFS_INODE_PREALLOC (1 << 4) | 1117 | #define BTRFS_INODE_PREALLOC (1 << 4) |
1118 | #define btrfs_clear_flag(inode, flag) (BTRFS_I(inode)->flags &= \ | 1118 | #define BTRFS_INODE_SYNC (1 << 5) |
1119 | ~BTRFS_INODE_##flag) | 1119 | #define BTRFS_INODE_IMMUTABLE (1 << 6) |
1120 | #define btrfs_set_flag(inode, flag) (BTRFS_I(inode)->flags |= \ | 1120 | #define BTRFS_INODE_APPEND (1 << 7) |
1121 | BTRFS_INODE_##flag) | 1121 | #define BTRFS_INODE_NODUMP (1 << 8) |
1122 | #define btrfs_test_flag(inode, flag) (BTRFS_I(inode)->flags & \ | 1122 | #define BTRFS_INODE_NOATIME (1 << 9) |
1123 | BTRFS_INODE_##flag) | 1123 | #define BTRFS_INODE_DIRSYNC (1 << 10) |
1124 | |||
1125 | |||
1124 | /* some macros to generate set/get funcs for the struct fields. This | 1126 | /* some macros to generate set/get funcs for the struct fields. This |
1125 | * assumes there is a lefoo_to_cpu for every type, so lets make a simple | 1127 | * assumes there is a lefoo_to_cpu for every type, so lets make a simple |
1126 | * one for u8: | 1128 | * one for u8: |
@@ -2260,6 +2262,8 @@ int btrfs_cont_expand(struct inode *inode, loff_t size); | |||
2260 | 2262 | ||
2261 | /* ioctl.c */ | 2263 | /* ioctl.c */ |
2262 | long btrfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg); | 2264 | long btrfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg); |
2265 | void btrfs_update_iflags(struct inode *inode); | ||
2266 | void btrfs_inherit_iflags(struct inode *inode, struct inode *dir); | ||
2263 | 2267 | ||
2264 | /* file.c */ | 2268 | /* file.c */ |
2265 | int btrfs_sync_file(struct file *file, struct dentry *dentry, int datasync); | 2269 | int btrfs_sync_file(struct file *file, struct dentry *dentry, int datasync); |