#define LL_COMMITCBD_RUNNING 0x4
struct ll_sb_info {
- struct lustre_handle ll_mdc_conn;
- struct lustre_handle ll_osc_conn;
- ino_t ll_rootino; /* number of root inode */
+ struct lustre_handle ll_mdc_conn;
+ struct lustre_handle ll_osc_conn;
+ obd_id ll_rootino; /* number of root inode */
wait_queue_head_t ll_commitcbd_waitq;
wait_queue_head_t ll_commitcbd_ctl_waitq;
return ll_s2obdconn(inode->i_sb);
}
-static inline void ll_ino2fid(struct ll_fid *fid, ino_t ino, __u32 generation,
+static inline void ll_ino2fid(struct ll_fid *fid, obd_id ino, __u32 generation,
int type)
{
- fid->id = (__u64)ino;
+ fid->id = ino;
fid->generation = generation;
fid->f_type = type;
}
return &class_conn2obd(conn)->u.mdc;
}
-int mdc_enqueue(struct lustre_handle *conn, int lock_type, struct lookup_intent *it,
- int lock_mode, struct inode *dir, struct dentry *de,
- struct lustre_handle *h, __u64 id, char *tgt, int tgtlen,
- void *data, int datalen);
+int mdc_enqueue(struct lustre_handle *conn, int lock_type,
+ struct lookup_intent *it, int lock_mode, struct inode *dir,
+ struct dentry *de, struct lustre_handle *h, __u64 id,
+ char *tgt, int tgtlen, void *data, int datalen);
int mdc_getstatus(struct lustre_handle *conn,
struct ll_fid *rootfid, __u64 *last_committed, __u64 *last_rcvd,
__u32 *last_xid, struct ptlrpc_request **);
int mdc_getattr(struct lustre_handle *conn,
- ino_t ino, int type, unsigned long valid, size_t ea_size,
+ obd_id ino, int type, unsigned long valid, size_t ea_size,
struct ptlrpc_request **request);
int mdc_statfs(struct lustre_handle *conn,
struct statfs *sfs, struct ptlrpc_request **request);
int mdc_setattr(struct lustre_handle *conn,
struct inode *, struct iattr *iattr, struct ptlrpc_request **);
int mdc_open(struct lustre_handle *conn,
- ino_t ino, int type, int flags, struct obdo *obdo, __u64 cookie,
+ obd_id ino, int type, int flags, struct obdo *obdo, __u64 cookie,
__u64 *fh, struct ptlrpc_request **request);
int mdc_close(struct lustre_handle *conn,
- ino_t ino, int type, __u64 fh, struct ptlrpc_request **req);
-int mdc_readpage(struct lustre_handle *conn, ino_t ino,
+ obd_id ino, int type, __u64 fh, struct ptlrpc_request **req);
+int mdc_readpage(struct lustre_handle *conn, obd_id ino,
int type, __u64 offset, char *addr, struct ptlrpc_request **);
int mdc_create(struct lustre_handle *conn,
- struct inode *dir, const char *name, int namelen,
+ struct inode *dir, const char *name, int namelen,
const char *tgt, int tgtlen, int mode, __u32 uid, __u32 gid,
__u64 time, __u64 rdev, struct obdo *obdo,
struct ptlrpc_request **);
* available snapshot slots (14 in 56 bytes vs. 7 in 56 bytes until we
* increase the size of OBD_OBDMDSZ).
*/
-typedef ino_t snap_id;
+typedef obd_id snap_id;
/* maximum number of snapshot tables we maintain in the kernel */
#define SNAP_MAX_TABLES 8
#include <linux/obd_class.h>
#include <linux/list.h>
-static __inline__ struct obdo *obdo_fromid(struct lustre_handle *conn, obd_id id,
- obd_mode mode, obd_flag valid)
+static inline struct obdo *obdo_fromid(struct lustre_handle *conn, obd_id id,
+ obd_mode mode, obd_flag valid)
{
struct obdo *oa;
int err;
return de;
}
-ino_t ll_inode_by_name(struct inode * dir, struct dentry *dentry, int *type)
+obd_id ll_inode_by_name(struct inode * dir, struct dentry *dentry, int *type)
{
- ino_t res = 0;
+ obd_id res = 0;
struct ext2_dir_entry_2 * de;
struct page *page;
/* from dir.c */
extern int ll_add_link (struct dentry *dentry, struct inode *inode);
-ino_t ll_inode_by_name(struct inode * dir, struct dentry *dentry, int *typ);
+obd_id ll_inode_by_name(struct inode * dir, struct dentry *dentry, int *typ);
int ext2_make_empty(struct inode *inode, struct inode *parent);
struct ext2_dir_entry_2 * ext2_find_entry (struct inode * dir,
struct dentry *dentry, struct page ** res_page);
struct ll_inode_md md;
struct lustre_handle lockh;
int err, type, offset;
- ino_t ino;
+ obd_id ino;
ENTRY;
err = mdc_getattr(&sbi->ll_mdc_conn, ino, type,
OBD_MD_FLNOTOBD|OBD_MD_FLBLOCKS, 0, &request);
if (err) {
- CERROR("failure %d inode %ld\n", err, (long)ino);
+ CERROR("failure %d inode %Ld\n", err, (long long)ino);
ptlrpc_free_req(request);
RETURN(ERR_PTR(-abs(err)));
}
int mdc_getattr(struct lustre_handle *conn,
- ino_t ino, int type, unsigned long valid, size_t ea_size,
+ obd_id ino, int type, unsigned long valid, size_t ea_size,
struct ptlrpc_request **request)
{
struct mdc_obd *mdc = mdc_conn2mdc(conn);
RETURN(0);
}
-int mdc_open(struct lustre_handle *conn, ino_t ino, int type, int flags,
+int mdc_open(struct lustre_handle *conn, obd_id ino, int type, int flags,
struct obdo *obdo,
__u64 cookie, __u64 *fh, struct ptlrpc_request **request)
{
}
int mdc_close(struct lustre_handle *conn,
- ino_t ino, int type, __u64 fh, struct ptlrpc_request **request)
+ obd_id ino, int type, __u64 fh, struct ptlrpc_request **request)
{
struct mdc_obd *mdc = mdc_conn2mdc(conn);
struct mds_body *body;
return rc;
}
-int mdc_readpage(struct lustre_handle *conn, ino_t ino, int type, __u64 offset,
+int mdc_readpage(struct lustre_handle *conn, obd_id ino, int type, __u64 offset,
char *addr, struct ptlrpc_request **request)
{
struct mdc_obd *mdc = mdc_conn2mdc(conn);
switch (cmd) {
case IOC_REQUEST_GETATTR: {
CERROR("-- getting attr for ino %lu\n", arg);
- err = mdc_getattr(&cl, connection, arg, S_IFDIR, ~0, 0,
+ err = mdc_getattr(&cl, connection, (obd_id)arg, S_IFDIR, ~0, 0,
&request);
CERROR("-- done err %d\n", err);
/* from dir.c */
extern int ext2_add_link (struct dentry *dentry, struct inode *inode);
-ino_t obdfs_inode_by_name(struct inode * dir, struct dentry *dentry, int *typ);
+obd_id obdfs_inode_by_name(struct inode * dir, struct dentry *dentry, int *typ);
int ext2_make_empty(struct inode *inode, struct inode *parent);
struct ext2_dir_entry_2 * ext2_find_entry (struct inode * dir,
struct dentry *dentry, struct page ** res_page);
struct obdo *oa;
struct inode * inode = NULL;
int type;
- ino_t ino;
-
+ obd_id ino;
+
ENTRY;
if (dentry->d_name.len > EXT2_NAME_LEN)
return ERR_PTR(-ENAMETOOLONG);
if (!ino)
goto negative;
- oa = obdo_fromid(IID(dir), ino, type,
+ oa = obdo_fromid(IID(dir), ino, type,
(__u32)(OBD_MD_FLNOTOBD | OBD_MD_FLBLOCKS));
if ( IS_ERR(oa) ) {
CERROR("obdo_fromid failed\n");
EXIT;
- return ERR_PTR(-EACCES);
+ return ERR_PTR(-EACCES);
}
- inode = iget4(dir->i_sb, ino, NULL, oa);
+ inode = iget4(dir->i_sb, (ino_t)ino, NULL, oa);
obdo_free(oa);
- if (!inode)
+ if (!inode)
return ERR_PTR(-EACCES);
negative:
int err;
unsigned long blocksize;
unsigned long blocksize_bits;
- unsigned long root_ino;
+ obd_id root_ino;
int scratch;
struct obdo *oa;
-
ENTRY;
- MOD_INC_USE_COUNT;
-
+ MOD_INC_USE_COUNT;
+
memset(sbi, 0, sizeof(*sbi));
-
- CDEBUG(D_INFO, "\n");
+
+ CDEBUG(D_INFO, "\n");
obdfs_options(data, &device, &version);
- if ( !device ) {
+ if (!device) {
CERROR("no device\n");
EXIT;
goto ERR;
}
devno = simple_strtoul(device, NULL, 0);
- CDEBUG(D_INFO, "\n");
- if ( devno >= MAX_OBD_DEVICES ) {
+ CDEBUG(D_INFO, "\n");
+ if (devno >= MAX_OBD_DEVICES) {
CERROR("device of %s too high (%d)\n", device, devno);
EXIT;
goto ERR;
- }
+ }
- CDEBUG(D_INFO, "\n");
+ CDEBUG(D_INFO, "\n");
obddev = &obd_dev[devno];
sbi->osi_obd = obddev;
err = obd_connect(&sbi->osi_conn, obddev);
- if ( err ) {
+ if (err) {
CERROR("OBDFS: cannot connect to %s\n", device);
EXIT;
goto ERR;
}
connected = 1;
- CDEBUG(D_INFO, "\n");
+ CDEBUG(D_INFO, "\n");
/* list of dirty inodes, and a mutex to hold while modifying it */
INIT_LIST_HEAD(&sbi->osi_inodes);
init_MUTEX (&sbi->osi_list_mutex);
- CDEBUG(D_INFO, "\n");
+ CDEBUG(D_INFO, "\n");
sbi->osi_super = sb;
- CDEBUG(D_INFO, "\n");
+ CDEBUG(D_INFO, "\n");
err = obd_get_info(&sbi->osi_conn, strlen("blocksize"),
"blocksize", &scratch,
(void *)&blocksize);
- if ( err ) {
+ if (err) {
CERROR("getinfo call to drive failed (blocksize)\n");
EXIT;
goto ERR;
}
- CDEBUG(D_INFO, "\n");
+ CDEBUG(D_INFO, "\n");
err = obd_get_info(&sbi->osi_conn, strlen("blocksize_bits"),
"blocksize_bits", &scratch,
(void *)&blocksize_bits);
- if ( err ) {
+ if (err) {
CERROR("getinfo call to drive failed (blocksize_bits)\n");
EXIT;
goto ERR;
}
- CDEBUG(D_INFO, "\n");
- err = obd_get_info(&sbi->osi_conn, strlen("root_ino"),
+ CDEBUG(D_INFO, "\n");
+ err = obd_get_info(&sbi->osi_conn, strlen("root_ino"),
"root_ino", &scratch, (void *)&root_ino);
- if ( err ) {
+ if (err) {
CERROR("getinfo call to drive failed (root_ino)\n");
EXIT;
goto ERR;
}
-
- CDEBUG(D_INFO, "\n");
+
+ CDEBUG(D_INFO, "\n");
sb->s_maxbytes = 1LL << 36;
CERROR("Max bytes: %Lx\n", sb->s_maxbytes);
sb->s_blocksize = PAGE_SIZE;
/* XXX how to get "sb->s_flags |= MS_RDONLY" here for snapshots? */
/* make root inode */
- CDEBUG(D_INFO, "\n");
+ CDEBUG(D_INFO, "\n");
oa = obdo_fromid(&sbi->osi_conn, root_ino, S_IFDIR,
(__u32)(OBD_MD_FLNOTOBD | OBD_MD_FLBLOCKS));
- CDEBUG(D_INFO, "mode %o\n", oa->o_mode);
- if ( IS_ERR(oa) ) {
+ CDEBUG(D_INFO, "mode %o\n", oa->o_mode);
+ if (IS_ERR(oa)) {
CERROR("obdo_fromid failed\n");
- iput(root);
+ iput(root);
EXIT;
goto ERR;
}
- CDEBUG(D_INFO, "\n");
- root = iget4(sb, root_ino, NULL, oa);
+ CDEBUG(D_INFO, "\n");
+ root = iget4(sb, (ino_t)root_ino, NULL, oa);
obdo_free(oa);
- CDEBUG(D_INFO, "\n");
+ CDEBUG(D_INFO, "\n");
if (!root) {
CERROR("OBDFS: bad iget4 for root\n");
sb->s_dev = 0;
err = -ENOENT;
EXIT;
goto ERR;
- }
-
- CDEBUG(D_INFO, "sbdev %d, rootino: %ld, dev %s, "
- "minor: %d, blocksize: %ld, blocksize bits %ld\n",
- sb->s_dev, root->i_ino, device, MINOR(devno),
+ }
+
+ CDEBUG(D_INFO, "sbdev %d, rootino: %Ld, dev %s, "
+ "minor: %d, blocksize: %ld, blocksize bits %ld\n",
+ sb->s_dev, (long long)root_ino, device, MINOR(devno),
blocksize, blocksize_bits);
sb->s_root = d_alloc_root(root);
list_add(&sbi->osi_list, &obdfs_super_list);
-static int obdfs_statfs(struct super_block *sb, struct statfs *buf)
+static int obdfs_statfs(struct super_block *sb, struct statfs *sfs)
{
- struct statfs tmp;
- int err;
+ int rc;
ENTRY;
- err = obd_statfs(ID(sb), &tmp);
- if ( err ) {
- CERROR("obd_statfs fails (%d)\n", err);
- return err;
- }
- memcpy(buf, &tmp, sizeof(*buf));
- CDEBUG(D_SUPER, "statfs returns avail %ld\n", tmp.f_bavail);
- EXIT;
+ rc = obd_statfs(ID(sb), sfs);
+ if (rc)
+ CERROR("obd_statfs fails: rc = %d\n", rc);
+ else
+ CDEBUG(D_SUPER, "statfs returns avail %ld\n", sfs->f_bavail);
- return err;
+ RETURN(rc);
}
static inline void obdfs_read_inode2(struct inode *inode, void *opaque)