Whamcloud - gitweb
Pass 64-bit object numbers wherever possible, instead of truncating to 32-bit.
authoradilger <adilger>
Fri, 5 Jul 2002 07:37:46 +0000 (07:37 +0000)
committeradilger <adilger>
Fri, 5 Jul 2002 07:37:46 +0000 (07:37 +0000)
lustre/include/linux/lustre_lite.h
lustre/include/linux/lustre_mds.h
lustre/include/linux/obd_snap_support.h
lustre/include/linux/obdfs.h
lustre/llite/dir.c
lustre/llite/namei.c
lustre/mdc/mdc_request.c
lustre/obdfs/namei.c
lustre/obdfs/super.c

index 4b9bb0c..b63dfc9 100644 (file)
@@ -55,9 +55,9 @@ struct ll_inode_info {
 #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;
@@ -108,10 +108,10 @@ static inline struct lustre_handle *ll_i2obdconn(struct inode *inode)
         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;
 }
index 095ee84..90f3e50 100644 (file)
@@ -142,29 +142,29 @@ static inline struct mdc_obd *mdc_conn2mdc(struct lustre_handle *conn)
         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 **);
index bd8ca7b..75ec08a 100644 (file)
@@ -12,7 +12,7 @@
  * 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
index 27e6dc9..eea6d97 100644 (file)
@@ -14,8 +14,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;
index 84aa5ae..8e3141c 100644 (file)
@@ -470,9 +470,9 @@ struct ext2_dir_entry_2 * ext2_dotdot (struct inode *dir, struct page **p)
         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;
 
index 2be735d..463357b 100644 (file)
@@ -44,7 +44,7 @@ extern int ll_setattr(struct dentry *de, struct iattr *attr);
 
 /* 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);
@@ -136,7 +136,7 @@ static struct dentry *ll_lookup2(struct inode * dir, struct dentry *dentry,
         struct ll_inode_md md;
         struct lustre_handle lockh;
         int err, type, offset;
-        ino_t ino;
+        obd_id ino;
 
         ENTRY;
 
@@ -172,7 +172,7 @@ static struct dentry *ll_lookup2(struct inode * dir, struct dentry *dentry,
                 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)));
                 }
index b3bffae..77cf635 100644 (file)
@@ -81,7 +81,7 @@ int mdc_getstatus(struct lustre_handle *conn, struct ll_fid *rootfid,
 
 
 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);
@@ -355,7 +355,7 @@ int mdc_enqueue(struct lustre_handle *conn, int lock_type, struct lookup_intent
         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)
 {
@@ -404,7 +404,7 @@ int mdc_open(struct lustre_handle *conn, ino_t ino, int type, int flags,
 }
 
 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;
@@ -432,7 +432,7 @@ int mdc_close(struct lustre_handle *conn,
         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);
@@ -554,7 +554,7 @@ static int mdc_ioctl(long cmd, struct lustre_handle *conn, int len, void *karg,
         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);
 
index 985521e..1ab2986 100644 (file)
@@ -43,7 +43,7 @@ extern int obdfs_setattr(struct dentry *de, struct iattr *attr);
 
 /* 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);
@@ -89,8 +89,8 @@ static struct dentry *obdfs_lookup(struct inode * dir, struct dentry *dentry)
         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);
@@ -99,18 +99,18 @@ static struct dentry *obdfs_lookup(struct inode * dir, struct dentry *dentry)
         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:
index a43aa66..ea6ffad 100644 (file)
@@ -99,83 +99,82 @@ static struct super_block * obdfs_read_super(struct super_block *sb,
         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;
@@ -186,31 +185,31 @@ static struct super_block * obdfs_read_super(struct super_block *sb,
         /* 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);
@@ -407,23 +406,19 @@ int obdfs_setattr(struct dentry *de, struct iattr *attr)
 
 
 
-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)