]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: remove set_default_*() methods
authorSage Weil <sage@inktank.com>
Thu, 6 Dec 2012 06:03:34 +0000 (22:03 -0800)
committerSage Weil <sage@inktank.com>
Mon, 24 Dec 2012 03:39:22 +0000 (19:39 -0800)
This is a poor interface.  The hadoop stuff is shifting to specify this
information on file creation instead.

Signed-off-by: Sage Weil <sage@inktank.com>
src/client/Client.cc
src/client/Client.h
src/include/cephfs/libcephfs.h
src/libcephfs.cc

index d876454f0f4be34dc9708ca581e6d885992df386..362099d9cec35531523d4172f36ddd1ee0559ba3 100644 (file)
@@ -149,10 +149,6 @@ Client::Client(Messenger *m, MonClient *mc)
     initialized(false), mounted(false), unmounting(false),
     local_osd(-1), local_osd_epoch(0),
     unsafe_sync_write(0),
-    file_stripe_unit(0),
-    file_stripe_count(0),
-    object_size(0),
-    file_replication(0),
     client_lock("Client::client_lock")
 {
   monclient->set_messenger(m);
@@ -5163,8 +5159,7 @@ int Client::open(const char *relpath, int flags, mode_t mode, int stripe_unit,
 int Client::open(const char *relpath, int flags, mode_t mode)
 {
   /* Use default file striping parameters */
-  return open(relpath, flags, mode, file_stripe_unit, file_stripe_count,
-      object_size, NULL);
+  return open(relpath, flags, mode, 0, 0, 0, NULL);
 }
 
 int Client::lookup_hash(inodeno_t ino, inodeno_t dirino, const char *name)
@@ -6661,7 +6656,6 @@ int Client::_create(Inode *dir, const char *name, int flags, mode_t mode, Inode
   req->head.args.open.stripe_unit = stripe_unit;
   req->head.args.open.stripe_count = stripe_count;
   req->head.args.open.object_size = object_size;
-  req->head.args.open.file_replication = file_replication;
   req->dentry_drop = CEPH_CAP_FILE_SHARED;
   req->dentry_unless = CEPH_CAP_FILE_EXCL;
 
@@ -6682,11 +6676,10 @@ int Client::_create(Inode *dir, const char *name, int flags, mode_t mode, Inode
   trim_cache();
 
   ldout(cct, 3) << "create(" << path << ", 0" << oct << mode << dec 
-         << " layout " << file_stripe_unit
-         << ' ' << file_stripe_count
-         << ' ' << object_size
-         << ' ' << file_replication
-         <<") = " << res << dendl;
+               << " layout " << stripe_unit
+               << ' ' << stripe_count
+               << ' ' << object_size
+               <<") = " << res << dendl;
   return res;
 
  fail:
@@ -7227,33 +7220,6 @@ int Client::ll_release(Fh *fh)
 // =========================================
 // layout
 
-// default layout
-
-void Client::set_default_file_stripe_unit(int stripe_unit)
-{
-  if (stripe_unit > 0)
-    file_stripe_unit = stripe_unit;
-}
-
-void Client::set_default_file_stripe_count(int count)
-{
-  if (count > 0)
-    file_stripe_count = count;
-}
-
-void Client::set_default_object_size(int size)
-{
-  if (size > 0)
-    object_size = size;
-}
-
-void Client::set_default_file_replication(int replication)
-{
-  if (replication >= 0)
-    file_replication = replication;
-}
-
-
 // expose file layouts
 
 int Client::describe_layout(int fd, ceph_file_layout *lp)
index 9512a2d8861d3752f74e058e05c8d145464999d8..125e194a9f4ab934b22e451a5236f0d6fb67ce58 100644 (file)
@@ -273,10 +273,6 @@ public:
 
   int unsafe_sync_write;
 
-  int file_stripe_unit;
-  int file_stripe_count;
-  int object_size;
-  int file_replication;
 public:
   entity_name_t get_myname() { return messenger->get_myname(); } 
   void sync_write_commit(Inode *in);
@@ -659,11 +655,6 @@ public:
   int get_local_osd();
   int get_pool_replication(int64_t pool);
 
-  void set_default_file_stripe_unit(int stripe_unit);
-  void set_default_file_stripe_count(int count);
-  void set_default_object_size(int size);
-  void set_default_file_replication(int replication);
-
   int enumerate_layout(int fd, vector<ObjectExtent>& result,
                       loff_t length, loff_t offset);
 
index 9cf66049d4d6d04c10c25beb57061c0158838d27..adeea248dd2e32c478c63f22c527b66d5a654a4f 100644 (file)
@@ -867,53 +867,13 @@ int ceph_get_file_stripe_address(struct ceph_mount_info *cmount, int fd, loff_t
 /** @} filelayout */
 
 /**
- * @defgroup libcephfs_h_default_filelayout Control the Default File Layout.
- * Functions for setting and getting the default file layout for new files.
- *
- * @{
- */
-
-/**
- * Set the default stripe unit of files created in this mount.
- *
- * @param cmount the ceph mount handle to use.
- * @param stripe the stripe size to use
- * @returns 0 on success or a negative error code on failure.
+ * No longer available.  Do not use.
+ * These functions will return -EOPNOTSUPP.
  */
 int ceph_set_default_file_stripe_unit(struct ceph_mount_info *cmount, int stripe);
-
-/**
- * Set the default stripe count of files created in this mount.
- *
- * @param cmount the ceph mount handle to use.
- * @param count the stripe count to use
- * @returns 0 on success or a negative error code on failure.
- */
 int ceph_set_default_file_stripe_count(struct ceph_mount_info *cmount, int count);
-
-/**
- * Set the default object size to use for striping.
- *
- * @param cmount the ceph mount handle to use.
- * @param size the default size for objects
- * @returns 0 on success or a negative error code on failure
- */
 int ceph_set_default_object_size(struct ceph_mount_info *cmount, int size);
-
-/**
- * No longer available.  Do not use.
- * Set the default preferred placement group.  This option will return
- * -EOPNOTSUPP as it is no longer supported.
- */
 int ceph_set_default_preferred_pg(struct ceph_mount_info *cmount, int osd);
-
-/**
- * Set the default file replication factor.
- *
- * @param cmount the ceph mount handle to use.
- * @param replication the default replication factor for files in this filesystem.
- * @returns 0 on success or negative error code on failure.
- */
 int ceph_set_default_file_replication(struct ceph_mount_info *cmount, int replication);
 
 /**
index c33f6284afcd3964768a68b68ad6b60b6b70f297..d085f846265b8f3144823c892dfe2ccc0d3f528b 100644 (file)
@@ -722,36 +722,28 @@ extern "C" int ceph_get_file_replication(struct ceph_mount_info *cmount, int fh)
 extern "C" int ceph_set_default_file_stripe_unit(struct ceph_mount_info *cmount,
                                                 int stripe)
 {
-  if (!cmount->is_mounted())
-    return -ENOTCONN;
-  cmount->get_client()->set_default_file_stripe_unit(stripe);
-  return 0;
+  // this option no longer exists
+  return -EOPNOTSUPP;
 }
 
 extern "C" int ceph_set_default_file_stripe_count(struct ceph_mount_info *cmount,
                                                  int count)
 {
-  if (!cmount->is_mounted())
-    return -ENOTCONN;
-  cmount->get_client()->set_default_file_stripe_unit(count);
-  return 0;
+  // this option no longer exists
+  return -EOPNOTSUPP;
 }
 
 extern "C" int ceph_set_default_object_size(struct ceph_mount_info *cmount, int size)
 {
-  if (!cmount->is_mounted())
-    return -ENOTCONN;
-  cmount->get_client()->set_default_object_size(size);
-  return 0;
+  // this option no longer exists
+  return -EOPNOTSUPP;
 }
 
 extern "C" int ceph_set_default_file_replication(struct ceph_mount_info *cmount,
                                                 int replication)
 {
-  if (!cmount->is_mounted())
-    return -ENOTCONN;
-  cmount->get_client()->set_default_file_replication(replication);
-  return 0;
+  // this option no longer exists
+  return -EOPNOTSUPP;
 }
 
 extern "C" int ceph_set_default_preferred_pg(struct ceph_mount_info *cmount, int osd)