orangefs: use ORANGEFS_NAME_LEN everywhere; remove ORANGEFS_NAME_MAX
authorMartin Brandenburg <martin@omnibond.com>
Sat, 20 Feb 2016 19:22:40 +0000 (14:22 -0500)
committerMike Marshall <hubcap@omnibond.com>
Wed, 24 Feb 2016 22:07:50 +0000 (17:07 -0500)
Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
fs/orangefs/dcache.c
fs/orangefs/downcall.h
fs/orangefs/namei.c
fs/orangefs/orangefs-dev-proto.h
fs/orangefs/super.c
fs/orangefs/upcall.h

index 3c1703fbb60e8a4f409669365bb26f2140f34f44..2de92b71d8618cc6f7f45a862eb763b025414422 100644 (file)
@@ -32,7 +32,7 @@ static int orangefs_revalidate_lookup(struct dentry *dentry)
        new_op->upcall.req.lookup.parent_refn = parent->refn;
        strncpy(new_op->upcall.req.lookup.d_name,
                dentry->d_name.name,
-               ORANGEFS_NAME_LEN);
+               ORANGEFS_NAME_MAX);
 
        gossip_debug(GOSSIP_DCACHE_DEBUG,
                     "%s:%s:%d interrupt flag [%d]\n",
index 72d4cac54821accc735fa1eae996295fddd649bb..66b99210f1f954c000d60ed1f75def010b2a95cf 100644 (file)
@@ -33,7 +33,7 @@ struct orangefs_symlink_response {
 
 struct orangefs_getattr_response {
        struct ORANGEFS_sys_attr_s attributes;
-       char link_target[ORANGEFS_NAME_LEN];
+       char link_target[ORANGEFS_NAME_MAX];
 };
 
 struct orangefs_mkdir_response {
index b3ae3749a932e1146dc6e5bd76264595d69ccea2..f26f6694c48d5e92f3ce4ab772267fccf21a11a2 100644 (file)
@@ -38,7 +38,7 @@ static int orangefs_create(struct inode *dir,
                               ORANGEFS_TYPE_METAFILE, mode);
 
        strncpy(new_op->upcall.req.create.d_name,
-               dentry->d_name.name, ORANGEFS_NAME_LEN);
+               dentry->d_name.name, ORANGEFS_NAME_MAX);
 
        ret = service_operation(new_op, __func__, get_interruptible_flag(dir));
 
@@ -116,7 +116,7 @@ static struct dentry *orangefs_lookup(struct inode *dir, struct dentry *dentry,
        gossip_debug(GOSSIP_NAME_DEBUG, "%s called on %s\n",
                     __func__, dentry->d_name.name);
 
-       if (dentry->d_name.len > (ORANGEFS_NAME_LEN - 1))
+       if (dentry->d_name.len > (ORANGEFS_NAME_MAX - 1))
                return ERR_PTR(-ENAMETOOLONG);
 
        new_op = op_alloc(ORANGEFS_VFS_OP_LOOKUP);
@@ -133,7 +133,7 @@ static struct dentry *orangefs_lookup(struct inode *dir, struct dentry *dentry,
        new_op->upcall.req.lookup.parent_refn = parent->refn;
 
        strncpy(new_op->upcall.req.lookup.d_name, dentry->d_name.name,
-               ORANGEFS_NAME_LEN);
+               ORANGEFS_NAME_MAX);
 
        gossip_debug(GOSSIP_NAME_DEBUG,
                     "%s: doing lookup on %s under %pU,%d (follow=%s)\n",
@@ -234,7 +234,7 @@ static int orangefs_unlink(struct inode *dir, struct dentry *dentry)
 
        new_op->upcall.req.remove.parent_refn = parent->refn;
        strncpy(new_op->upcall.req.remove.d_name, dentry->d_name.name,
-               ORANGEFS_NAME_LEN);
+               ORANGEFS_NAME_MAX);
 
        ret = service_operation(new_op, "orangefs_unlink",
                                get_interruptible_flag(inode));
@@ -283,8 +283,8 @@ static int orangefs_symlink(struct inode *dir,
 
        strncpy(new_op->upcall.req.sym.entry_name,
                dentry->d_name.name,
-               ORANGEFS_NAME_LEN);
-       strncpy(new_op->upcall.req.sym.target, symname, ORANGEFS_NAME_LEN);
+               ORANGEFS_NAME_MAX);
+       strncpy(new_op->upcall.req.sym.target, symname, ORANGEFS_NAME_MAX);
 
        ret = service_operation(new_op, __func__, get_interruptible_flag(dir));
 
@@ -347,7 +347,7 @@ static int orangefs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode
                              ORANGEFS_TYPE_DIRECTORY, mode);
 
        strncpy(new_op->upcall.req.mkdir.d_name,
-               dentry->d_name.name, ORANGEFS_NAME_LEN);
+               dentry->d_name.name, ORANGEFS_NAME_MAX);
 
        ret = service_operation(new_op, __func__, get_interruptible_flag(dir));
 
@@ -420,10 +420,10 @@ static int orangefs_rename(struct inode *old_dir,
 
        strncpy(new_op->upcall.req.rename.d_old_name,
                old_dentry->d_name.name,
-               ORANGEFS_NAME_LEN);
+               ORANGEFS_NAME_MAX);
        strncpy(new_op->upcall.req.rename.d_new_name,
                new_dentry->d_name.name,
-               ORANGEFS_NAME_LEN);
+               ORANGEFS_NAME_MAX);
 
        ret = service_operation(new_op,
                                "orangefs_rename",
index 5a8725a88eacac0fe4454575e5ef5e642c81c3fc..9eac9d9a3f3a91d4cb608f8c4e3e0566848de214 100644 (file)
@@ -46,7 +46,6 @@
  * Misc constants. Please retain them as multiples of 8!
  * Otherwise 32-64 bit interactions will be messed up :)
  */
-#define ORANGEFS_NAME_LEN              0x00000100
 #define ORANGEFS_MAX_DEBUG_STRING_LEN  0x00000400
 #define ORANGEFS_MAX_DEBUG_ARRAY_LEN   0x00000800
 
index 65ddc74e96b66f9eb28d0c5e746aba60d05aae28..eac24eb7fe802ee288d090ed04320c7af6d3feb1 100644 (file)
@@ -170,7 +170,7 @@ static int orangefs_statfs(struct dentry *dentry, struct kstatfs *buf)
        buf->f_type = sb->s_magic;
        memcpy(&buf->f_fsid, &ORANGEFS_SB(sb)->fs_id, sizeof(buf->f_fsid));
        buf->f_bsize = new_op->downcall.resp.statfs.block_size;
-       buf->f_namelen = ORANGEFS_NAME_LEN;
+       buf->f_namelen = ORANGEFS_NAME_MAX;
 
        buf->f_blocks = (sector_t) new_op->downcall.resp.statfs.blocks_total;
        buf->f_bfree = (sector_t) new_op->downcall.resp.statfs.blocks_avail;
index 781cbc38523adafd734e32af20bfc256ad27d4ef..af6dcac180ab1d366c7f6ce2981733e7d353575d 100644 (file)
@@ -27,20 +27,20 @@ struct orangefs_lookup_request_s {
        __s32 sym_follow;
        __s32 __pad1;
        struct orangefs_object_kref parent_refn;
-       char d_name[ORANGEFS_NAME_LEN];
+       char d_name[ORANGEFS_NAME_MAX];
 };
 
 struct orangefs_create_request_s {
        struct orangefs_object_kref parent_refn;
        struct ORANGEFS_sys_attr_s attributes;
-       char d_name[ORANGEFS_NAME_LEN];
+       char d_name[ORANGEFS_NAME_MAX];
 };
 
 struct orangefs_symlink_request_s {
        struct orangefs_object_kref parent_refn;
        struct ORANGEFS_sys_attr_s attributes;
-       char entry_name[ORANGEFS_NAME_LEN];
-       char target[ORANGEFS_NAME_LEN];
+       char entry_name[ORANGEFS_NAME_MAX];
+       char target[ORANGEFS_NAME_MAX];
 };
 
 struct orangefs_getattr_request_s {
@@ -56,13 +56,13 @@ struct orangefs_setattr_request_s {
 
 struct orangefs_remove_request_s {
        struct orangefs_object_kref parent_refn;
-       char d_name[ORANGEFS_NAME_LEN];
+       char d_name[ORANGEFS_NAME_MAX];
 };
 
 struct orangefs_mkdir_request_s {
        struct orangefs_object_kref parent_refn;
        struct ORANGEFS_sys_attr_s attributes;
-       char d_name[ORANGEFS_NAME_LEN];
+       char d_name[ORANGEFS_NAME_MAX];
 };
 
 struct orangefs_readdir_request_s {
@@ -84,8 +84,8 @@ struct orangefs_readdirplus_request_s {
 struct orangefs_rename_request_s {
        struct orangefs_object_kref old_parent_refn;
        struct orangefs_object_kref new_parent_refn;
-       char d_old_name[ORANGEFS_NAME_LEN];
-       char d_new_name[ORANGEFS_NAME_LEN];
+       char d_old_name[ORANGEFS_NAME_MAX];
+       char d_new_name[ORANGEFS_NAME_MAX];
 };
 
 struct orangefs_statfs_request_s {