1 #ifndef _FS_CEPH_SUPER_H
2 #define _FS_CEPH_SUPER_H
6 #include <asm/unaligned.h>
13 #include <linux/wait.h>
15 #include <linux/slab.h>
20 #define CEPH_SUPER_MAGIC 0x00c36400
24 #define CEPH_BLOCK_SHIFT 20
25 #define CEPH_BLOCK (1 << CEPH_BLOCK_SHIFT)
27 #define CEPH_MOUNT_OPT_DIRSTAT (1<<4)
28 #define CEPH_MOUNT_OPT_RBYTES (1<<5)
29 #define CEPH_MOUNT_OPT_NOASYNCREADDIR (1<<7)
30 #define CEPH_MOUNT_OPT_INO32 (1<<8)
31 #define CEPH_MOUNT_OPT_DCACHE (1<<9)
33 #define CEPH_MOUNT_OPT_DEFAULT (CEPH_MOUNT_OPT_RBYTES)
35 #define ceph_set_mount_opt(fsc, opt) \
36 (fsc)->mount_options->flags |= CEPH_MOUNT_OPT_##opt;
37 #define ceph_test_mount_opt(fsc, opt) \
38 (!!((fsc)->mount_options->flags & CEPH_MOUNT_OPT_##opt))
40 #define CEPH_RSIZE_DEFAULT 0
41 #define CEPH_RASIZE_DEFAULT (8192*1024)
42 #define CEPH_MAX_READDIR_DEFAULT 1024
43 #define CEPH_MAX_READDIR_BYTES_DEFAULT (512*1024)
44 #define CEPH_SNAPDIRNAME_DEFAULT ".snap"
87 #ifdef CONFIG_DEBUG_FS
88 struct dentry *debugfs_dentry_lru, *debugfs_caps;
89 struct dentry *debugfs_congestion_kb;
90 struct dentry *debugfs_bdi;
91 struct dentry *debugfs_mdsc, *debugfs_mdsmap;
122 #define CHECK_CAPS_NODELAY 1
123 #define CHECK_CAPS_AUTHONLY 2
124 #define CHECK_CAPS_FLUSH 4
154 static inline void ceph_put_cap_snap(
struct ceph_cap_snap *capsnap)
171 #define CEPH_MAX_DIRFRAG_REP 4
228 #define CEPH_D_COMPLETE 1
354 return ceph_inode(inode)->i_vino;
365 static inline u32 ceph_ino_to_ino32(
__u64 vino)
367 u32 ino = vino & 0xffffffff;
379 #if BITS_PER_LONG == 32
380 return ceph_ino_to_ino32(vino.
ino);
389 #if BITS_PER_LONG == 32
398 ino = ceph_ino_to_ino32(ino);
405 #define ceph_vinop(i) ceph_inode(i)->i_vino.ino, ceph_inode(i)->i_vino.snap
407 static inline u64 ceph_ino(
struct inode *inode)
409 return ceph_inode(inode)->i_vino.ino;
411 static inline u64 ceph_snap(
struct inode *inode)
413 return ceph_inode(inode)->i_vino.snap;
416 static inline int ceph_ino_compare(
struct inode *inode,
void *
data)
424 static inline struct inode *ceph_find_inode(
struct super_block *sb,
427 ino_t t = ceph_vino_to_ino(vino);
428 return ilookup5(sb, t, ceph_ino_compare, &vino);
435 #define CEPH_I_NODELAY 4
436 #define CEPH_I_FLUSH 8
437 #define CEPH_I_NOFLUSH 16
439 static inline void ceph_i_clear(
struct inode *inode,
unsigned mask)
448 static inline void ceph_i_set(
struct inode *inode,
unsigned mask)
457 static inline bool ceph_i_test(
struct inode *inode,
unsigned mask)
486 static inline loff_t ceph_make_fpos(
unsigned frag,
unsigned off)
488 return ((loff_t)frag << 32) | (loff_t)off;
571 #define CEPH_F_SYNC 1
572 #define CEPH_F_ATEND 2
634 static inline int default_congestion_kb(
void)
657 if (congestion_kb > 256*1024)
658 congestion_kb = 256*1024;
660 return congestion_kb;
673 void *
p,
void *
e,
bool deletion);
686 static inline bool __ceph_have_pending_cap_snap(
struct ceph_inode_info *ci)
729 extern int ceph_setxattr(
struct dentry *,
const char *,
const void *,
746 unsigned cap,
unsigned seq,
u64 realmino,
int flags,
749 static inline void ceph_remove_cap(
struct ceph_cap *
cap)
751 spin_lock(&cap->
ci->i_ceph_lock);
753 spin_unlock(&cap->
ci->i_ceph_lock);
780 int mds,
int drop,
int unless,
int force);
782 int mds,
int drop,
int unless);
785 int *got, loff_t endoff);
803 loff_t off,
size_t len);
806 loff_t off,
size_t len);
822 struct dentry *dentry,
int err);
824 struct dentry *dentry,
int err);
851 int p_locks,
int f_locks);